Re: [Cppcms-users] Segmentaion fault occurs to booster::aio::io_service running in booster::thread
Brought to you by:
artyom-beilis
From: CN <cn...@fa...> - 2016-05-10 09:17:24
|
> The program no longer causes segmentation fault after signals arrive if > parameter "daemon.enable" in file "t.js" is set to "false" and launched > by this shell script: > > ========= > #!/bin/sh > ### BEGIN INIT INFO > # Provides: t > # Default-Start: 2 3 4 5 > # Default-Stop: 0 1 6 > # Short-Description: My Program > # Description: Test signals. > ### END INIT INFO > > > PATH=/sbin:/bin:/usr/sbin:/usr/bin > DAEMON=/tmp/a.out > NAME=t > CONFIGFILE="-c /tmp/t.js" > DESC="My Program" > SCRIPTNAME=/etc/init.d/$NAME > PIDFILE=/tmp/t.pid > > test -x $DAEMON || exit 0 > > . /lib/lsb/init-functions > > case "$1" in > start) > log_daemon_msg "Starting $DESC" $NAME > start-stop-daemon --start --oknodo --quiet --pidfile $PIDFILE > --exec $DAEMON -b -m -- $CONFIGFILE > log_end_msg $? > ;; > stop) > log_daemon_msg "Stopping $DESC" $NAME > start-stop-daemon --stop --retry TERM/10 --quiet --pidfile > $PIDFILE --exec $DAEMON --remove-pidfile > log_end_msg $? > ;; > reload|force-reload) > log_daemon_msg "Reloading $DESC" $NAME > start-stop-daemon --stop --signal HUP --retry 10 --quiet > --pidfile $PIDFILE --exec $DAEMON > log_end_msg $? > ;; > restart) > log_daemon_msg "Restarting $DESC" $NAME > $0 stop > $0 start > ;; > status) > status_of_proc -p "$PIDFILE" "$DAEMON" "$NAME" && exit 0 || exit > $? > ;; > *) > echo "Usage: $SCRIPTNAME > {start|stop|restart|reload|force-reload|status}" >&2 > exit 1 > ;; > esac > > exit 0 > > ========= > > Please note the "-b -m" options under "start)", in case this script is > *generally correct* and also useful to anyone in this community. I do not understand the effects coming from "reload|force-reload)" in the shell script: unknown symptom (1): reload|force-reload) start-stop-daemon --stop --signal HUP --quiet --pidfile $PIDFILE --exec $DAEMON These are the commands I issued: /tmp/t.sh start /tmp/t.sh reload Here is its log: May 10 16:55:49 host t: ==1==: (t.cpp:51) May 10 16:56:20 host t: begin handler: (t.cpp:12) May 10 16:56:20 host t: end handler: (t.cpp:15) May 10 16:56:20 host t: ==2==: (t.cpp:53) May 10 16:56:20 host t: ==3==: (t.cpp:55) May 10 16:56:20 host t: ==4==: (t.cpp:58) May 10 16:56:20 host t: ==1==: (t.cpp:51) May 10 16:56:20 host t: ==1==: (t.cpp:51) My understanding is that since parameter "daemon.enable" in "t.js" is set to "false", process forking is then not involved. Why t.cpp:51 appears twice? unknown symptom (2): After "--retry 5" is added to make the script look so: reload|force-reload) start-stop-daemon --stop --signal HUP --retry 5 --quiet --pidfile $PIDFILE --exec $DAEMON , command "/tmp/t.sh reload" does not return until 5 seconds pass. Besides, there is no process running for "a.out" after the command returns. Why is that? Best regards, CN -- http://www.fastmail.com - mmm... Fastmail... |