* Debugging memset crashes
@ 2011-02-24 6:58 Praveen kumar
2011-02-24 7:37 ` Dave Hylands
0 siblings, 1 reply; 2+ messages in thread
From: Praveen kumar @ 2011-02-24 6:58 UTC (permalink / raw)
To: kernelnewbies
Hi,
I have an embedded system on which i get crash (Caused by memset ) at long
run( Reproducible 2/10 times ),
I wanted to know efficient ways (materials) to handle memset crashes .
*Program terminated with signal 11, Segmentation fault. *
#0 memset (dstpp=0xd2, c=<value optimized out>, len=3374)
at ../../../src/Common/OS/linux/memset.c:20
20 ../../../src/Common/OS/linux/memset.c: No such file or directory.
in ../../../src/Common/OS/linux/memset.c
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
*(1) Display the backtrace for the thread that crashed. *
#0 memset (dstpp=0xd2, c=<value optimized out>, len=3374)
at ../../../src/Common/OS/linux/memset.c:20
#1 0x100e76c4 in LPREncode (pEnc=0x5b1debc8, pRTPPacket=0x5be69ee4)
at ../../../src/Common/comm/lpr/lpr.c:647
#2 0x100dde50 in RTPChanWork (pChan=<value optimized out>)
at ../../../src/Common/comm/rtpchan/rtpchan.c:2699
#3 0x100de5d8 in RTPTxTask (userDefined=<value optimized out>)
at ../../../src/Common/comm/rtpchan/rtpchan.c:2853
#4 0x1051d744 in pthread_entry (args=<value optimized out>)
at ../../../src/Common/OS/linux/psosapi/pthreadapi.c:222
#5 0x0ffaadec in start_thread (arg=<value optimized out>)
at pthread_create.c:298
#6 0x0f892530 in clone () from /lib/libc.so.6
Previous frame inner to this frame (corrupt stack?)
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-
*(2) Display argument parameters and local variables for the thread. *
dstpp = (void *) 0xd2
c = <value optimized out>
len = 3374
xlen = <value optimized out>
cccc = <value optimized out>
dstp = 210
do anyone have some information..
Thanks in Advance
Praveen
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110224/e13edd33/attachment-0001.html
^ permalink raw reply [flat|nested] 2+ messages in thread
* Debugging memset crashes
2011-02-24 6:58 Debugging memset crashes Praveen kumar
@ 2011-02-24 7:37 ` Dave Hylands
0 siblings, 0 replies; 2+ messages in thread
From: Dave Hylands @ 2011-02-24 7:37 UTC (permalink / raw)
To: kernelnewbies
Hi Praveen,
On Wed, Feb 23, 2011 at 11:58 PM, Praveen kumar <chatpravi@gmail.com> wrote:
> Hi,
> I have an embedded system on which i get crash (Caused by memset )? at long
> run( Reproducible 2/10 times ),
> I wanted to know efficient ways (materials) to handle memset crashes .
>
> Program terminated with signal 11, Segmentation fault.
>
> #0 memset (dstpp=0xd2, c=<value optimized out>, len=3374)
> ????at ../../../src/Common/OS/linux/memset.c:20
> 20 ../../../src/Common/OS/linux/memset.c: No such file or directory.
> in ../../../src/Common/OS/linux/memset.c
The problem is probably that memset has been passed either a bad
pointer, or a bad size.
>From your backtrace, the dstpp of 0xd2 is almost certainly the
problem. The first 4K (and sometimes 64K) starting at location zero is
invalid. Passing a pointer in that range will cause an page fault (or
segmentation fault).
memset doesn't do any parameter checking, so if you want parameter
checking you'll need to do that yourself. You could add a function
like my_memest and use a macro to map memset to my_memset. Or you
could play with LD_PRELOAD (if your runtime library is in a shared
library) and intercept the calls that way.
http://stackoverflow.com/questions/69859/how-could-i-intercept-linux-sys-calls
http://developers.sun.com/solaris/articles/lib_interposers_code.html
http://www.jayconrod.com/cgi/view_post.py?23
Yet another technique is to use the linker's wrap capability
http://stackoverflow.com/questions/998464/function-interposition-in-linux-without-dlsym
Dave Hylands
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2011-02-24 7:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-02-24 6:58 Debugging memset crashes Praveen kumar
2011-02-24 7:37 ` Dave Hylands
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).