View Issue Details

IDProjectCategoryView StatusLast Update
0019510FPCPackagespublic2017-03-18 23:34
ReporterjoshuaAssigned ToMichael Van Canneyt 
PrioritynormalSeveritymajorReproducibilityalways
Status resolvedResolutionfixed 
Product VersionProduct Build 
Target Version3.2.0Fixed in Version3.1.1 
Summary0019510: Access Violation / Segmentation Fault when stopping LazDaemon daemon + OnStop/OnDestroy event not called in Debian.
DescriptionI'm using Lazarus 0.9.30, FPC 2.4.2, testing on Debian 6.

On issuing kill -9 or -15 or -TERM, the daemon will either stop with AV or show segmentation fault - this affects cleandir example also.

I was told by my programmer that this might have something to do with fpsigaction or signaling procedure call.

Also, only OnShutdown event is called on kill -15/-9 or OS reboot. OnDestroy, OnStop are not called.

Attached the test program. Thanks.
Additional InformationTrace from GDB.

joshua@debian:~/Desktop/Data/testapps/basicdaemon$ gdb ./project1
.............
Reading symbols from /home/joshua/Desktop/Data/testapps/basicdaemon/project1...done.
(gdb) run -r
Starting program: /home/joshua/Desktop/Data/testapps/basicdaemon/project1 -r
^C
Program received signal SIGINT, Interrupt.
0xb7fe2424 in __kernel_vsyscall ()
(gdb) bt
#0 0xb7fe2424 in __kernel_vsyscall ()
0000001 0x08048732 in SYSTEM_FPSYSCALL$LONGINT$LONGINT$LONGINT$$LONGINT ()
0000002 0x0809f481 in BASEUNIX_FPSIGSUSPEND$SIGSET_T$$LONGINT ()
0000003 0x0809f56a in BASEUNIX_SIGPAUSE$LONGINT$$LONGINT ()
0000004 0x00000000 in ?? ()
(gdb)
TagsNo tags attached.
Fixed in Revision35624
FPCOldBugId0
FPCTarget
Attached Files

Activities

2011-06-07 07:30

 

basicdaemon.zip (196,225 bytes)

Jam Hitz

2011-07-04 12:12

reporter   ~0049643

I can also confirm that this is the case.

Michael Van Canneyt

2011-10-09 19:16

administrator   ~0052807

Signal 9 (KILL) cannot be caught by definition, the program will be removed from memory.

I will look at the TERM (15) signal behaviour.

Marco van de Voort

2015-01-16 11:01

manager   ~0080439

See also http://forum.lazarus.freepascal.org/index.php/topic,13371.0/topicseen.html

Michael Van Canneyt

2017-03-18 23:34

administrator   ~0099042

TERM signal will now first send stop to service, and then a SHUTDOWN if the service didn't stop.

Issue History

Date Modified Username Field Change
2011-06-07 07:30 joshua New Issue
2011-06-07 07:30 joshua File Added: basicdaemon.zip
2011-07-04 12:12 Jam Hitz Note Added: 0049643
2011-10-06 12:29 Vincent Snijders Project Packages => FPC
2011-10-06 15:51 Jonas Maebe FPCOldBugId => 0
2011-10-06 15:51 Jonas Maebe Category - => Packages
2011-10-06 15:51 Jonas Maebe Product Version 0.9.30 =>
2011-10-06 15:51 Jonas Maebe Status new => assigned
2011-10-06 15:51 Jonas Maebe Assigned To => Michael Van Canneyt
2011-10-09 19:16 Michael Van Canneyt Note Added: 0052807
2015-01-16 11:01 Marco van de Voort Note Added: 0080439
2017-03-18 23:34 Michael Van Canneyt Fixed in Revision => 35624
2017-03-18 23:34 Michael Van Canneyt Note Added: 0099042
2017-03-18 23:34 Michael Van Canneyt Status assigned => resolved
2017-03-18 23:34 Michael Van Canneyt Fixed in Version => 3.1.1
2017-03-18 23:34 Michael Van Canneyt Resolution open => fixed
2017-03-18 23:34 Michael Van Canneyt Target Version => 3.2.0