Re: how to build gnugk with debug-info('-g' option) Thanks!

Bo Xu <[email protected]>
Newsgroups gmane.comp.telephony.openh323gk.user
Message-ID <CAFgLERnjB=kK38+4=dGbta2_6ALC52HYQkk1Hj1FpQxJJWFfQw@mail.gmail.com>
I continued to do some testing and GDB shows a segmentation fault by
dynamic_cast in ProxyChannel.cxx, around line-1250:

...
void TCPProxySocket::DetachRemote()
{
PWaitAndSignal lock(m_remoteLock);

if (remote) {
remote->remote = NULL; // detach myself from remote
* CallSignalSocket * css = dynamic_cast<CallSignalSocket *> (remote);*
if (!css || !css->MaintainConnection())
remote->SetDeletable();

remote = NULL;
}
}
...


the line who cause segmentation fault is:
* CallSignalSocket * css = dynamic_cast<CallSignalSocket *> (remote);*

when one of the connected endpoints crash, then this segmentation fault
happens and gnuGK crash too.  I tried adding a try/catch but still cannot
avoid this segmentation fault, I am not sure why this segmentation fault
cannot be caught,  could you help me find a way to handle this segmentation
fault? Thanks!

Regards,
Bo Xu




On Thu, Jul 17, 2014 at 4:35 PM, Bo Xu <[email protected]> wrote:

> Hello Jan,
>
> here is the backtrace mentioned in 14.3 Debugging GnuGk (on Linux)
>  ,Thanks!
>
>
> ...
> [New Thread 13843]
> [New Thread 13695]
> [New Thread 13688]
> [New Thread 13682]
> Missing separate debuginfo for /usr/local/lib/libpcap.so.1
> Try: yum --disablerepo='*' --enablerepo='*-debug*' install
> /usr/lib/debug/.build-id/9f/c636ddb5b085c564d56f0cf114e0364d1e04a0
> Missing separate debuginfo for
> Try: yum --disablerepo='*' --enablerepo='*-debug*' install
> /usr/lib/debug/.build-id/9d/2c86b060c510aca82bc27181f58d52e2aa6c1c
> Reading symbols from /usr/local/lib/libpcap.so.1...done.
> Loaded symbols for /usr/local/lib/libpcap.so.1
> Reading symbols from /lib64/libresolv.so.2...(no debugging symbols
> found)...done.
> Loaded symbols for /lib64/libresolv.so.2
> Reading symbols from /lib64/libpthread.so.0...(no debugging symbols
> found)...done.
> [Thread debugging using libthread_db enabled]
> Loaded symbols for /lib64/libpthread.so.0
> Reading symbols from /lib64/librt.so.1...(no debugging symbols
> found)...done.
> Loaded symbols for /lib64/librt.so.1
> Reading symbols from /lib64/libdl.so.2...(no debugging symbols
> found)...done.
> Loaded symbols for /lib64/libdl.so.2
> Reading symbols from /usr/lib64/libstdc++.so.6...(no debugging symbols
> found)...done.
> Loaded symbols for /usr/lib64/libstdc++.so.6
> Reading symbols from /lib64/libm.so.6...(no debugging symbols
> found)...done.
> Loaded symbols for /lib64/libm.so.6
> Reading symbols from /lib64/libgcc_s.so.1...(no debugging symbols
> found)...done.
> Loaded symbols for /lib64/libgcc_s.so.1
> Reading symbols from /lib64/libc.so.6...(no debugging symbols
> found)...done.
> Loaded symbols for /lib64/libc.so.6
> Reading symbols from /lib64/ld-linux-x86-64.so.2...(no debugging symbols
> found)...done.
> Loaded symbols for /lib64/ld-linux-x86-64.so.2
> Reading symbols from /lib64/libnss_files.so.2...(no debugging symbols
> found)...done.
> Loaded symbols for /lib64/libnss_files.so.2
> Core was generated by `./gnugk -c
> /root/openh323gk/zMYgnugkRUN/gatekeeper_Layland.ini -o /root/openh32'.
> Program terminated with signal 11, Segmentation fault.
> #0  0x000000386a4bb3b9 in __dynamic_cast () from /usr/lib64/libstdc++.so.6
> Missing separate debuginfos, use: debuginfo-install
> glibc-2.12-1.132.el6.x86_64 libgcc-4.4.7-4.el6.x86_64
> libstdc++-4.4.7-4.el6.x86_64
> (gdb) bt
> #0  0x000000386a4bb3b9 in __dynamic_cast () from /usr/lib64/libstdc++.so.6
> #1  0x0000000000511231 in TCPProxySocket::DetachRemote
> (this=0x7fafac0f54e0)
>     at ProxyChannel.cxx:1245
> #2  0x0000000000510fca in TCPProxySocket::~TCPProxySocket
> (this=0x7fafac0f54e0,
>     __vtt_parm=0x987428, __in_chrg=<value optimized out>) at
> ProxyChannel.cxx:1238
> #3  0x0000000000515424 in CallSignalSocket::~CallSignalSocket
> (this=0x7fafac0f54e0,
>     __in_chrg=<value optimized out>, __vtt_parm=<value optimized out>)
>     at ProxyChannel.cxx:1714
> #4  0x00000000005154ac in CallSignalSocket::~CallSignalSocket
> (this=0x7fafac0f54e0,
>     __in_chrg=<value optimized out>, __vtt_parm=<value optimized out>)
>     at ProxyChannel.cxx:1714
> #5  0x00000000005581e7 in ProxyHandler::CleanUp (this=0x181ce60)
>     at ProxyChannel.cxx:13966
> #6  0x000000000040e0b1 in SocketsReader::Exec (this=0x181ce60) at
> yasocket.cxx:1059
> #7  0x000000000055966c in ProxyHandler::Exec (this=0x181ce60) at
> ProxyChannel.cxx:14322
> #8  0x000000000040ac7c in RegularJob::Run (this=0x181ce60) at job.cxx:432
> #9  0x0000000000409b98 in Worker::Main (this=0x181d360) at job.cxx:182
> #10 0x00000000009139a2 in PThread::PX_ThreadStart (arg=0x181d360)
>     at ptlib/unix/tlibthrd.cxx:491
> ---Type <return> to continue, or q <return> to quit---
>
>
> Regards,
> Bo Xu
>
>
>
>
> On Thu, Jul 17, 2014 at 3:53 PM, Bo Xu <[email protected]> wrote:
>
>> Hello Jan,
>>
>> Thanks a lot!
>>
>> Regards,
>> Bo Xu
>>
>>
>>
>>
>>
>>
>>
>> Hi,
>>
>> just compile GnuGk with "make debugnoshared".
>>
>> For more details see chapter 14.3 in the manual.
>>
>> Regards,
>> Jan
>>
>>
>> On 17. Juli 2014 18:42:40 MESZ, Bo Xu <boxuscience@...> wrote:
>> >Hi,
>> >
>> >I am running gnuGK-3.6 on linux, sometimes when one of the connected
>> >endpoints crashed then gnuGK also crashed and I got "Segmentation fault
>> >(core dumped)" error and I got the dumped core. I want to debug this
>> >core
>> >with gdb so I need to build the gnuGK with '-g' option, but I don't
>> >know
>> >how to modify the Makefile to do it, could you tell me how to add '-g'
>> >option into the Makefile when building  gnuGK? Thanks!
>> >
>> >Regards,
>> >Bo Xu
>> >
>>
>>
>>
>> On Thu, Jul 17, 2014 at 12:42 PM, Bo Xu <[email protected]> wrote:
>>
>>> Hi,
>>>
>>> I am running gnuGK-3.6 on linux, sometimes when one of the connected
>>> endpoints crashed then gnuGK also crashed and I got "Segmentation fault
>>> (core dumped)" error and I got the dumped core. I want to debug this core
>>> with gdb so I need to build the gnuGK with '-g' option, but I don't know
>>> how to modify the Makefile to do it, could you tell me how to add '-g'
>>> option into the Makefile when building  gnuGK? Thanks!
>>>
>>> Regards,
>>> Bo Xu
>>>
>>
>>
>

------------------------------------------------------------------------------
Want fast and easy access to all the code in your enterprise? Index and
search up to 200,000 lines of code with a free copy of Black Duck
Code Sight - the same software that powers the world's largest code
search on Ohloh, the Black Duck Open Hub! Try it now.
http://p.sf.net/sfu/bds

_______________________________________________________

Posting: mailto:[email protected]
Archive: http://sourceforge.net/mailarchive/forum.php?forum_name=openh323gk-users
Unsubscribe: http://lists.sourceforge.net/lists/listinfo/openh323gk-users
Homepage: http://www.gnugk.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.