Re: DNS related crash on start and reload on Debian 8

Jan Willamowius <[email protected]> Thu, 22 Mar 2018 16:18:10 +0100
Newsgroups gmane.comp.telephony.openh323gk.user
Message-ID <[email protected]>
NOTE: You receive this message on the OLD GnuGk mailinglist
that will go away soon. Please re-subscribe for the NEW mailinglist at
https://lists.gnugk.org/cgi-bin/mailman/listinfo/gnugk-users

--

Hi Esa,

thanks for providing these stack traces.

This is an issue in PTLib where a fix for a memory leak seems to have
unwated side effects. I have reverted the patch and now the leak is
back, but its not crashing anymore.

Regards,
Jan

-- =

Jan Willamowius, Founder of the GNU Gatekeeper Project
EMail  : [email protected]
Website: https://www.gnugk.org
Support: https://www.willamowius.com/gnugk-support.html

Relaxed Communications GmbH
Frahmredder 91
22393 Hamburg
Gesch=E4ftsf=FChrer: Jan Willamowius
HRB 125261 (Amtsgericht Hamburg)
USt-IdNr: DE286003584


Esa Nyrhinen wrote:
> Hi,
> =

> Running GnuGk 4.8 on a Debian 8.10.
> Compiled as "debugnoshared" along with its dependencies but the issue is
> repeatable with GnuGk and its dependencies compiled as "optnoshared" too
> and regardless of if GnuGk is run as root or a limited user.
> =

> Configured as a H.460.18/19 client gatekeeper so it refers to its parent
> via DNS & SRV records. Crashes either on start or reload depending on
> TraceLevel=3D.
> =

> The IPs and DNS names have been replaced in the output below.
> =

> With TraceLevel=3D3 crashes on config reload via status port.
> =

> The last line of the log is:
> 2018/03/21 20:18:57.626 2             RasSrv.cxx(947)   GK      Home =3D
> 1.2.3.4
> =

> The core dump says:
> Program terminated with signal SIGABRT, Aborted.
> #0  0x00007f978e85f067 in __GI_raise (sig=3Dsig@entry=3D6) at
> ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> 56      ../nptl/sysdeps/unix/sysv/linux/raise.c: No such file or director=
y.
> (gdb) bt
> #0  0x00007f978e85f067 in __GI_raise (sig=3Dsig@entry=3D6) at
> ../nptl/sysdeps/unix/sysv/linux/raise.c:56
> #1  0x00007f978e860523 in __GI_abort () at abort.c:118
> #2  0x00007f978e89d1b4 in __libc_message (do_abort=3Ddo_abort@entry=3D1,
> fmt=3Dfmt@entry=3D0x7f978e992210 "*** Error in `%s': %s: 0x%s ***\n") at
> ../sysdeps/posix/libc_fatal.c:175
> #3  0x00007f978e8a298e in malloc_printerr (action=3D1, str=3D0x7f978e98e3=
26
> "free(): invalid pointer", ptr=3D<optimized out>) at malloc.c:4996
> #4  0x00007f978e8a3696 in _int_free (av=3D<optimized out>, p=3D<optimized
> out>, have_lock=3D0) at malloc.c:3840  =

> #5  0x0000000000930db8 in DnsRecordListFree (rec=3D0x1bd8c40) at
> ptclib/pdns.cxx:315
> #6  0x0000000000932609 in PDNS::Cached_DnsQuery (name=3D0x1b9c490
> "_h323rs._udp.example.com", type=3D33, options=3D0, queryResults=3D0x7f97=
8c32c200)
>     at ptclib/pdns.cxx:711
> #7  0x000000000088305f in PDNS::Lookup<33u, PDNS::SRVRecordList,
> PDNS::SRVRecord> (name=3D..., recordList=3D...)  =

>     at /home/asdf/gnugk/build/ptlib/include/ptclib/pdns.h:226
> #8  0x0000000000882a59 in PDNS::GetRecords (service=3D...,
> serviceList=3D...) at /home/asdf/gnugk/build/ptlib/include/ptclib/pdns.h:=
287
> #9  0x0000000000931e9f in PDNS::LookupSRV (srvLookupStr=3D...,
> defaultPort=3D1720, addrList=3Dstd::vector of length 0, capacity 0) at
> ptclib/pdns.cxx:578
> #10 0x0000000000931e3a in PDNS::LookupSRV (domain=3D..., service=3D...,
> defaultPort=3D1720, addrList=3Dstd::vector of length 0, capacity 0) at
> ptclib/pdns.cxx:567
> #11 0x0000000000931926 in PDNS::LookupSRV (url=3D..., service=3D...,
> returnList=3D...) at ptclib/pdns.cxx:529
> #12 0x00000000004d9a91 in GkClient::OnReload (this=3D0x1bd68c0) at
> GkClient.cxx:1669
> #13 0x0000000000506dc1 in RasServer::LoadConfig (this=3D0x1bcce50) at
> RasSrv.cxx:1044
> #14 0x00000000005978c0 in ReloadHandler () at gk.cxx:1095
> #15 0x0000000000462629 in StatusClient::ExecCommand
> (this=3D0x7f976c004920, cmd=3D...) at GkStatus.cxx:1846
> #16 0x0000000000469837 in SimpleClassJobA<StatusClient, PString>::Run
> (this=3D0x7f9764006780) at job.h:236
> #17 0x000000000040e5a3 in Worker::Main (this=3D0x7f976c006990) at job.cxx=
:182
> #18 0x000000000099892a in PThread::PX_ThreadStart (arg=3D0x7f976c006990)
> at ptlib/unix/tlibthrd.cxx:493
> #19 0x00007f978fecd064 in start_thread (arg=3D0x7f978c32d700) at
> pthread_create.c:309
> #20 0x00007f978e91262d in clone () at
> ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
> =

> With TraceLevel=3D6 the gatekeeper crashes on start.
> =

> The lines of the log are:
> 2018/03/21 20:44:31.680 4               pdns.cxx(566)   DNS     SRV
> Lookup "_h323rs._udp.example.com"
> 2018/03/21 20:44:31.680 5               pdns.cxx(727)   DNS     SRV
> physical lookup "_h323rs._udp.example.com 33      0"
> 2018/03/21 20:44:31.689 6               pdns.cxx(741)   DNS     Query
> success: 0x2b94120
> 2018/03/21 20:44:31.689 6               pdns.cxx(744)   DNS     Query:
> name=3D"", type=3D0, len=3D0
> 2018/03/21 20:44:31.689 6               pdns.cxx(744)   DNS     Query:
> name=3D"^Z<F8>@", type=3D157, len=3D0
> 2018/03/21 20:44:31.689 6               pdns.cxx(744)   DNS     Query:
> name=3D"H<89>}<F8>H<8B>E<F8>H<C7>", type=3D4332, len=3D35144
> =

> Looking at the pdns.cxx sources it seems that the contents of the pName
> field are garbled for some reason.
> =

> Program terminated with signal SIGSEGV, Segmentation fault.
> #0  0x00000000009328ff in PDNS::Cached_DnsQuery (name=3D0x2b57520
> "_h323rs._udp.example.com", type=3D33, options=3D0, queryResults=3D0x7ffe=
3b0fcf60)
>     at ptclib/pdns.cxx:743
> #1  0x000000000088305f in PDNS::Lookup<33u, PDNS::SRVRecordList,
> PDNS::SRVRecord> (name=3D..., recordList=3D...)  =

>     at /home/asdf/gnugk/build/ptlib/include/ptclib/pdns.h:226
> #2  0x0000000000882a59 in PDNS::GetRecords (service=3D...,
> serviceList=3D...) at /home/asdf/gnugk/build/ptlib/include/ptclib/pdns.h:=
287
> #3  0x0000000000931e9f in PDNS::LookupSRV (srvLookupStr=3D...,
> defaultPort=3D1720, addrList=3Dstd::vector of length 0, capacity 0) at
> ptclib/pdns.cxx:578
> #4  0x0000000000931e3a in PDNS::LookupSRV (domain=3D..., service=3D...,
> defaultPort=3D1720, addrList=3Dstd::vector of length 0, capacity 0) at
> ptclib/pdns.cxx:567
> #5  0x0000000000931926 in PDNS::LookupSRV (url=3D..., service=3D...,
> returnList=3D...) at ptclib/pdns.cxx:529
> #6  0x00000000004d9a91 in GkClient::OnReload (this=3D0x2b91890) at
> GkClient.cxx:1669
> #7  0x0000000000506dc1 in RasServer::LoadConfig (this=3D0x2b88740) at
> RasSrv.cxx:1044
> #8  0x00000000005088a9 in RasServer::Run (this=3D0x2b88740) at RasSrv.cxx=
:1439
> #9  0x000000000059a50c in Gatekeeper::Main (this=3D0x2b61e90) at gk.cxx:1=
836
> #10 0x00000000009be043 in PProcess::InternalMain (this=3D0x2b61e90) at
> ptlib/common/osutils.cxx:1540
> #11 0x0000000000596913 in main (argc=3D3, argv=3D0x7ffe3b0fdfe8,
> envp=3D0x7ffe3b0fe008) at gk.cxx:53
> =

> Regards,
> Esa


---------------------------------------------------------------------------=
---
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________________

Posting: mailto:[email protected]
Archive: https://sourceforge.net/mailarchive/forum.php?forum_name=3Dopenh32=
3gk-users
Unsubscribe: https://lists.sourceforge.net/lists/listinfo/openh323gk-users
Homepage: https://www.gnugk.org/