Hello, I have a system which reads I2C data from a few sensors and stores their data in shared memory which is protected using a shared semaphore.
In order to prevent a deadlock among other processes if a process is killed while it's holding the lock I temporarily block SIGTERM and SIGINT while the process owns the lock [while modifying the shared data]. I run the processes as a regular user, with the exception of an SNMP agent which runs as root. What I'm seeing is: - For two processes (which I run as a regular user), everything works fine and I've set up SIGINT and SIGTERM handlers using sigaction(). - The SNMP agent sets up handlers for SIGINT and SIGTERM using signal(), and the process is run as root. When this function calls sigprocmask() in order to temporarily block the signals, it crashes and prints out "Bad system call". Anyone know why sigprocmask() could be failing so hard in the third process? -- Kind Regards, Jan
