Ticket #130 (closed defect: fixed)

Opened 21 months ago

Last modified 20 months ago

[CRASH] start-stop-daemon: Segmentation Fault on --stop

Reported by: matej@laitl.cz Owned by: roy
Priority: major Milestone:
Component: rc Version: 0.4
Keywords: Cc:

Description

Hi Roy,
I get following crash when trying to stop openntpd daemon previously started by s-s-d:

esprimo ~ # /etc/init.d/ntpd start
ntpd |* Starting ntpd... [ ok ]
esprimo ~ # /etc/init.d/ntpd stop
ntpd |* Stopping ntpd...
ntpd |/etc/init.d/ntpd: line 37: 18833 Segmentation fault start-stop-daemon --stop --exec /usr/sbin/ntpd --name ntpd --user root
ntpd |* Failed to stop openntpd [ !! ]
ntpd |* ERROR: ntpd failed to stop
esprimo ~ # pgrep ntpd
18816
18817
esprimo ~ # start-stop-daemon --stop --exec /usr/sbin/ntpd --name ntpd --user root
Segmentation fault
esprimo ~ # gdb start-stop-daemon
GNU gdb 6.7.1
Copyright (C) 2007 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later < http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law. Type "show copying"
and "show warranty" for details.
This GDB was configured as "i686-pc-linux-gnu"...
Using host libthread_db library "/lib/libthread_db.so.1".
(gdb) run --stop --exec /usr/sbin/ntpd --name ntpd --user root
Starting program: /sbin/start-stop-daemon --stop --exec /usr/sbin/ntpd --name ntpd --user root

Program received signal SIGSEGV, Segmentation fault.
0x0804e736 in start_stop_daemon (argc=8, argv=0xbfd38774) at start-stop-daemon.c:843
843 start-stop-daemon.c: No such file or directory.

in start-stop-daemon.c

(gdb) bt
#0 0x0804e736 in start_stop_daemon (argc=8, argv=0xbfd38774) at start-stop-daemon.c:843
#1 0x08050bff in run_applets (argc=8, argv=0xbfd38754) at rc-applets.c:440
#2 0x080590a0 in main (argc=8, argv=0xbfd38754) at rc.c:791
#3 0xb7ddcfdc in libc_start_main () from /lib/libc.so.6
#4 0x0804b9b1 in _start ()
(gdb) cont
Continuing.

Program terminated with signal SIGSEGV, Segmentation fault.
The program no longer exists.
(gdb) q
esprimo ~ # start-stop-daemon --version
start-stop-daemon (OpenRC) 0.4.0-svn-exported (Gentoo Linux)

(the version I use is the one from openrc-0.4.0 gentoo ebuild - includes some patches that do not touch start-stop-daemon.c)

I'm happy to provide more information on your request.

Matěj

Attachments

ntpd Download (971 bytes) - added by matej@laitl.cz 21 months ago.
/etc/init.d/ntpd
ssd.diff Download (594 bytes) - added by roy 21 months ago.
Fix ssd not to crash

Change History

Changed 21 months ago by matej@laitl.cz

  • attachment ntpd Download added

/etc/init.d/ntpd

Changed 21 months ago by roy

Fix ssd not to crash

comment:1 Changed 21 months ago by roy

Does the above patch fix the issue for you?

comment:2 Changed 20 months ago by matej@laitl.cz

Great, I'm not able to reproduce the crash with above patch applied; ssd works as expected.

Thanks, Roy. (not closing the bug myself in case you use it to track thing to commit)

comment:3 Changed 20 months ago by roy

  • Status changed from new to closed
  • Resolution set to fixed
Note: See TracTickets for help on using tickets.