[Dnsmasq-discuss] dnsmasq rc5 segfault

Carlos Carvalho carlos at fisica.ufpr.br
Sat Jul 12 22:59:35 BST 2008


Simon Kelley (simon at thekelleys.org.uk) wrote on 12 July 2008 08:09:
 >Carlos Carvalho wrote:
 >> Simon Kelley (simon at thekelleys.org.uk) wrote on 11 July 2008 19:40:
 >>  >Carlos Carvalho wrote:
 >>  >> Today dnsmasq died. It was the first time since I use it :-(
 >>  >> 
 >>  >> In its log there's no sign of problems. The last entry is for a
 >>  >> DHCPNAK; it's the only such record with 2.43. The kernel log says
 >>  >> 
 >>  >> Jul 11 14:27:38 hoggar dnsmasq[11797]: segfault at 10 ip 08061e91 sp bfffe770 error 4 in dnsmasq[8048000+22000]
 >>  >> 
 >>  >> The kernel is compiled with several PAX protections, in particular
 >>  >> non-executable pages.
 >>  >> 
 >>  >> Any ideas on how to debug this? All I can imagine demand a significant
 >>  >> amount of work here :-(
 >>  >> 
 >>  >
 >>  >Best bet is to be ready to catch the next one.
 >>  >
 >>  >1) rebuild dnsmasq with
 >>  >
 >>  >make CFLAGS=-g
 >> 
 >> Done.
 >> 
 >>  >2) enable coredumps and move to a directory where they can be written
 >>  >
 >>  >ulimit -c unlimited
 >> 
 >> Done.
 >> 
 >>  >3) run dnsmasq in the foreground
 >>  >
 >>  >dnsmasq -d
 >> 
 >> D... ops, sorry, I can't run a segfaulting program as root in the
 >> central server of the department...
 >> 
 >> I ran it normally and sent it a quit signal but it didn't produce a
 >> core; it works for other programs. I changed the chdir / in dnsmasq.c
 >> to "/tmp" to no avail (it does the chdir). Why doesn't it produce a core?
 >> 
 >If you're changing code, try making
 >
 >   if (daemon->options & OPT_DEBUG)
 >     prctl(PR_SET_DUMPABLE, 1);
 >
 >in dnsmasq.c
 >
 >unconditional

Worked! I had seen it but didn't understand the reason, so I tried
without it. It's the setuid that avoids it, and it's a linux specific
behavior. I really should have rtFm, sorry...

It's now ready for the bug to show up. To answer Jan, the crash
happened after about 22h of operation, so it's not in the new startup
code. It was running with query-port=0, so it's not in the new dns
code either. I don't use the new naptr nor server-id-override
functions. So I don't see a direct relation to the changes in 2.43...



More information about the Dnsmasq-discuss mailing list