I have a strange problem while running my code, it gets terminated almost immeadeletely after printing "rtsig 42’ on the terminal.
Has anyone got this error before and would request some one tell me how i can go about debugging this??
Why don’t you just compile your code with the -g option (for debug) and then run it in the debugger:
You can find plenty of online resources that show gdb commands.
Alternatively, you can run dumper (assuming it’s not already running) and wait for the crash to occur. Dumper then places a file in /var/dumps (by default) which you can load into gdb to see where it crashed:
gdb yourProgramName /var/dumps/yourProgramName.core
This will show the line it crashed on (assuming you compiled with the -g option).
Thanks for your guidance…
I do use GDB regularly to an extent, but here i did not use it since it was not printing any memoryfault or coredumped statements when the program exited.
I do have a handler in my application for the SIGRTMIN+1 that is(rtsig 42) in which i am coming out of my application, but when my app is started i am wondering who is sending this signal to my application and who is printing “rtsig 42”, since i am not printing that in my program.
with thanks and regards
SIGRTMAX+1 is SIGSELECT
you are using select() somewhere, right?
SIGSELECT is usually queued: synchronous via sigwaitinfo(). If you’re changing this it might explain this anomaly.
I was able to figure out the cause of the issue…it was because i was trying to find out the process id from the process name i had and was trying to send SIGRTMIN+1 and it somehow ended up in sending signal to my application.
Thanks for all guidance…mean while the signal i am using is SIGRTMIN+1 and not SIGRTMAX+1.