crux: I got the same error.
When process_id == -1 (main process), then DEVICE.name become devices[-1].name at src/locking.c:45. Negative index cause memory access violation and result in SIGSEGV. I propose more reliable patch:
--- a/smstools/src/locking.c
+++ b/smstools/src/locking.c
@@ -42,7 +42,7 @@ int lockfile( char* filename)
lockfile=open(lockfilename,O_CREAT|O_EXCL|O_WRONLY,0644);
if (lockfile>=0)
{
- snprintf(pid, sizeof(pid), "%i %s\n", (int)getpid(), DEVICE.name);
+ snprintf(pid, sizeof(pid), "%i %s\n", (int)getpid(), (process_id != -1) ? DEVICE.name : "MAIN" );
write(lockfile, pid, strlen(pid));
close(lockfile);
sync();
|