2010-09-09 05:46:11     lmudflapth

Document created by Aaronwu Employee on Aug 22, 2013
Version 1Show Document
  • View in full screen mode

2010-09-09 05:46:11     lmudflapth

Mahalakshmi M (INDIA)

Message: 93299   

 

Hi,

 

I have enabled  -fmudflap and -lmudflap while compilation and Linking for my sample Application code.It worked fine and mudflap violations came.

 

Then i tried with my Multithreaded application with the following options.

 

UCLINUX_COMPILE_OPTIONS = -Wall -Wstrict-prototypes -Wshadow -Os -fomit-frame-pointer -D_GNU_SOURCE -DNDEBUG -O2 -Dlinux -D__linux__ -Dunix -D__uClinux__ -DEMBED -fno-builtin -fmudflapth

 

UCLINUX_COMPILE_OPTIONS_CXX = -Wall -Wshadow -Os -fomit-frame-pointer -D_GNU_SOURCE -DNDEBUG -O2 -Dlinux -D__linux__ -Dunix -D__uClinux__ -DEMBED -fno-builtin -fmudflapth

 

LDLIBS += -lpthread -lmudflapth

 

With these options mudflap violations are not happening.

 

Will mudflap work for multithreaded application?

 

Please find the below output got for non threaded and threaded application.

 

Non Threaded Application [ enabled options is -fmudflap and -lmudflap ]

*********************************************************************************

root:/> ./Sample

 

HELLO WORLD

 

*******

mudflap violation 1 (check/read): time=1207010531.882000 ptr=0x674f128 size=4

pc=0x6a27d62 location=`Thread.c:8 (ETH_ThreadRunFunction)'

      [0x0x6a270a2]

Nearby object 1: checked region begins 35B after and ends 38B after

mudflap object 0x674f12c: name=`malloc region'

bounds=[0x674f0fc,0x674f105] size=10 area=heap check=0r/0w liveness=0

alloc time=1207010531.881000 pc=0x6a277be

      [0x0x6a276dc]

number of nearby objects: 1

80

 

*************************************************************************

Threaded Application [ enabled options is -fmudflapth and -lmudflapth ]

 

root:/> ./Sample

 

HELLO WORLD in Thread

 

88

root:/>

 

 

 

Thanks,

 

Maha

QuoteReplyEditDelete

 

 

2010-09-09 13:01:33     Re: lmudflapth

Mike Frysinger (UNITED STATES)

Message: 93307   

 

post your simple code

QuoteReplyEditDelete

 

 

2010-09-13 02:08:02     Re: lmudflapth

Mahalakshmi M (INDIA)

Message: 93372   

 

Please find the sample application without[ thread [Sample.zip] and with thread [ SampleTh.zip]  as attachment.

 

Also find the attached output files [ Output.txt and OutputTh.txt  for sample application without thread and with thread]

 

Kindly add ur suggestions.

 

SampleTh.zip

Sample.zip

QuoteReplyEditDelete

Attachments

Outcomes