From: Bob H. <hil...@fl...> - 1998-11-29 01:41:02
|
A Debian user reported that dictd segfaulted on startup if the "-l server" option was used. An extract from his de-bugging report follows: -- /usr/sbin/dictd -f -l server -d nodetach verbose nofork :I: 2461 starting dictd 1.4.8/rf on Linux 2.0.35 Sat Nov 28 15:37:00 1998 :I: wn WordNet (r) 1.6 :I: wn 121967 2485903 7313559 22955733 :I: 2461 accepting on 2628 :I: Forked 2466 :I: 2461 accepting on 2628 :I: connected Segmentation fault Using the original source, debugging with ddd and backtracing from the segmentation fault in vprintf shows the following information: Program received signal SIGSEGV, Segmentation fault. 0x40046e3e in vfprintf () (gdb) frame 1 #1 0x40051443 in vsprintf () (gdb) frame 2 #2 0x80593f6 in log_info_va (format=0x80641d3 ":I: Reaped %d%s%s\n", ap=0xbffff41c) at log.c:192 (gdb) frame 3 #3 0x80594b0 in log_info (format=0x80641d3 ":I: Reaped %d%s%s\n") at log.c:215 (gdb) frame 4 #4 0x804a0d1 in reaper (dummy=17) at dictd.c:105 (gdb) Looking in the source code, I found that in reaper() at dictd.c:105 the function log_info is called. The format string contains 3 parameters, but only two are passed: log_info( ":I: Reaped %d%s%s\n", pid, _dict_daemon ? " IN CHILD": "" ); This is incorrect and causes the crash. When the second "%s" is removed, the recompiled version runs now with and without the "-l server" argument: -- The following patch to dictd.c fixes this bug. Please include it in the next release of dictd. -- start patch --- dictd.c Sun Mar 1 07:06:42 1998 +++ dictd.c_fixed Sat Nov 28 18:29:48 1998 @@ -102,7 +102,7 @@ ++_dict_reaps; if (flg_test(LOG_SERVER)) - log_info( ":I: Reaped %d%s%s\n", + log_info( ":I: Reaped %d%s\n", pid, _dict_daemon ? " IN CHILD": "" ); } -- end patch Bob -- _ |_) _ |_ Robert D. Hilliard <hil...@fl...> |_) (_) |_) Palm City, FL USA PGP Key ID: A8E40EB9 |