tags:

views:

98

answers:

2

I get a crash (i.e. abort) as follows and wanted to know if there's anything that I can get from the memory map information provided that could be useful?

___________


*** glibc detected *** free(): invalid pointer: 0x000000000070f0c0 ***

======= Backtrace: =========
/lib64/libc.so.6[0x7f4f2ee88cb8]
/lib64/libc.so.6(cfree+0x76)[0x7f4f2ee8b276]
/home/bbazso/usr/local/lib/rtmpserver/libvanrtmpstreamer.so(_ZN12VANSProtocol15SignalInputDataEPv+0x10d0)[0x7f4f2a29de60]
/opt/trx-HEAD/crtmpserver/20091229/lib/libthelib.so(_ZN11TCPProtocol15SignalInputDataEPv+0x1d)[0x7f4f2fba27dd]
/opt/trx-HEAD/crtmpserver/20091229/lib/libthelib.so(_ZN10TCPCarrier7OnEventER11epoll_event+0x1b1)[0x7f4f2fb86cc1]
/opt/trx-HEAD/crtmpserver/20091229/lib/libthelib.so(_ZN16IOHandlerManager5PulseEv+0x21c)[0x7f4f2fb8919c]
/home/bbazso/workspace/trx-live/trx-libs/VanRtmp/.libs/libvanrtmp.so.0(_ZN3van15cRtmpServerLoop19RtmpProtocolHandlerEv+0x55)[0x7f4f370b5365]
/home/bbazso/workspace/trx-live/trx-libs/VanRtmp/.libs/libvanrtmp.so.0(_Z19HandleTrafficThreadPv+0x9)[0x7f4f370b5429]
/opt/trx-HEAD/glib/2.18.0/lib/libglib-2.0.so.0[0x7f4f3125e344]
/lib64/libpthread.so.0[0x7f4f2f18a3ba]
/lib64/libc.so.6(clone+0x6d)[0x7f4f2eef6fcd]
======= Memory map: ========
00400000-0050e000 r-xp 00000000 08:01 8421382                            /home/bbazso/workspace/trx-live/StreamingServer/.libs/lt-vanstreamingserver
0070d000-0070f000 rw-p 0010d000 08:01 8421382                            /home/bbazso/workspace/trx-live/StreamingServer/.libs/lt-vanstreamingserver
0070f000-00713000 rw-p 0070f000 00:00 0 
01e7f000-02520000 rw-p 01e7f000 00:00 0                                  [heap]
7f4f18000000-7f4f18026000 rw-p 7f4f18000000 00:00 0 
7f4f18026000-7f4f1c000000 ---p 7f4f18026000 00:00 0 
7f4f1d8a9000-7f4f1d8aa000 ---p 7f4f1d8a9000 00:00 0 
7f4f1d8aa000-7f4f1e0aa000 rwxp 7f4f1d8aa000 00:00 0 
7f4f1e0aa000-7f4f1e0ab000 ---p 7f4f1e0aa000 00:00 0 
7f4f1e0ab000-7f4f1e8ab000 rwxp 7f4f1e0ab000 00:00 0 
7f4f1e8ab000-7f4f1e8ac000 ---p 7f4f1e8ab000 00:00 0 
7f4f1e8ac000-7f4f1f0ac000 rwxp 7f4f1e8ac000 00:00 0 
7f4f1f0ac000-7f4f1f0ad000 ---p 7f4f1f0ac000 00:00 0 
7f4f1f0ad000-7f4f1f8ad000 rwxp 7f4f1f0ad000 00:00 0 
7f4f1f8ad000-7f4f1f8ae000 ---p 7f4f1f8ad000 00:00 0 
7f4f1f8ae000-7f4f200ae000 rwxp 7f4f1f8ae000 00:00 0 
7f4f200ae000-7f4f200b4000 r-xp 00000000 08:01 4121121                    /home/bbazso/usr/local/lib/gstreamer-0.10/libgstvanaudio.so
7f4f200b4000-7f4f202b3000 ---p 00006000 08:01 4121121                    /home/bbazso/usr/local/lib/gstreamer-0.10/libgstvanaudio.so
7f4f202b3000-7f4f202b4000 rw-p 00005000 08:01 4121121                    /home/bbazso/usr/local/lib/gstreamer-0.10/libgstvanaudio.so
7f4f202b4000-7f4f202c3000 r-xp 00000000 08:01 7627054                    /opt/trx-HEAD/gstreamer/gst-plugins-base/0.10.20/lib/gstreamer-0.10/libgstaudioconvert.so
7f4f202c3000-7f4f204c3000 ---p 0000f000 08:01 7627054                    /opt/trx-HEAD/gstreamer/gst-plugins-base/0.10.20/lib/gstreamer-0.10/libgstaudioconvert.so
7f4f204c3000-7f4f204c4000 rw-p 0000f000 08:01 7627054                    /opt/trx-HEAD/gstreamer/gst-plugins-base/0.10.20/lib/gstreamer-0.10/libgstaudioconvert.so
7f4f204c4000-7f4f204c8000 r-xp 00000000 08:01 7627057                    /opt/trx-HEAD/gstreamer/gst-plugins-base/0.10.20/lib/gstreamer-0.10/libgstaudiorate.so
7f4f204c8000-7f4f206c8000 ---p 00004000 08:01 7627057                    /opt/trx-HEAD/gstreamer/gst-plugins-base/0.10.20/lib/gstreamer-0.10/libgstaudiorate.so
7f4f206c8000-7f4f206c9000 rw-p 00004000 08:01 7627057                    /opt/trx-HEAD/gstreamer/gst-plugins-base/0.10.20/lib/gstreamer-0.10/libgstaudiorate.so
7f4f206c9000-7f4f2077b000 r-xp 00000000 08:01 4121119                    /home/bbazso/usr/local/lib/gstreamer-0.10/libgstvanaac.so
7f4f2077b000-7f4f2097b000 ---p 000b2000 08:01 4121119                    /home/bbazso/usr/local/lib/gstreamer-0.10/libgstvanaac.so
7f4f2097b000-7f4f20980000 rw-p 000b2000 08:01 4121119                    /home/bbazso/usr/local/lib/gstreamer-0.10/libgstvanaac.so
7f4f20980000-7f4f2098a000 rw-p 7f4f20980000 00:00 0 
7f4f2098a000-7f4f209c3000 r-xp 00000000 08:01 7250237                    /opt/intel/ipp/5.3.3.075/em64t/sharedlib/libippdcy8.so.5.3
7f4f209c3000-7f4f20ac2000 ---p 00039000 08:01 7250237                    /opt/intel/ipp/5.3.3.075/em64t/sharedlib/libippd[INFO] VanStreamingServer - Caught signal: 6
[INFO] VanStreamingServer - Aborting
Aborted (core dumped)
+5  A: 

Compare these two lines:

*** glibc detected *** free(): invalid pointer: 0x000000000070f0c0 ***

and

0070f000-00713000 rw-p 0070f000 00:00 0

The last one is the stack of the executable, so it looks like the app is trying to free() a pointer to stack memory.

Nikolai N Fetissov
Normally, you're only supposed to free memory on the heap right? So this is a problem! Any good tips on trying to find out why I would be freeing something on the heap illegally?
bbazso
Could be for a number of reasons - logical error (taking address of stack class instance and giving it to shared_ptr, for example), buffer overrun, etc. If it's your code - you have a stack trace right there - shouldn't be a problem to find the error. If not - bug the vendor. In any case running the thing under **valgrind** will probably help narrow down the scope.
Nikolai N Fetissov
+2  A: 

I suggest posting this on http://groups.google.com/group/c-rtmp-server

I will answer you there :)

Cheers, Andrei

crtmpserver
I added the question to the group. Thanks for your help!
bbazso
+1 for answering for your projects!
Nikolai N Fetissov