When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
34 messages · Page 1 of 1 (latest)
When your question is answered use !solved to mark the question as resolved.
Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question run !howto ask.
here the code
and here there's the context of project : the paragraph about the problem is the 5th
from 5 to 5.4
i forget to change the signum from SIGKILL to SIGTERM but it doesn't matter
What do you mean by that? Are you trying to capture SIGKILL? Cause if yes, then that actually does matter big time.
The SIGKILL signal is used to cause immediate program termination. It cannot be handled or ignored, and is therefore always fatal. It is also not possible to block this signal.
This signal is usually generated only by explicit request. Since it cannot be handled, you should generate it only as a last resort, after first trying a less drastic method such as C-c or SIGTERM. If a process does not respond to any other termination signals, sending it a SIGKILL signal will almost always cause it to go away.
In fact, if SIGKILL fails to terminate a process, that by itself constitutes an operating system bug which you should report.
Source: https://www.gnu.org/software/libc/manual/html_node/Termination-Signals.html
i mean that first i tried to use in the handler of SIGUSR1 the raise function with SIGTERM, then (after i saw that it didn't work) i change the signum from SIGTERM to SIGKILL, but it still not working
What do you mean by "signum"?
I only know that word from a mathematical context where it's 1 for positive numbers and -1 for negative numbers
Do you mean "signal"?
I mean I can't really help you cause I can't read the assignment. Idk what language that is, but I'm not capable of it
it's c
That is C?
is note the source code
i literally write it
it's the excersie
the zip containt the source code
i can translate ità
is not a problem
Okay, then do that
Just saying, at least for me I won't bother reading your source code if I can't understand the context
the focus is from 5 to 5.4
Are you trying to send the SIGTERM manually or automatically?
Also do you even ever register a signal handler for anything but SIGALARM?
And does it need to be killpg(grpid, SIGUSR1); or kill(grpid, SIGUSR1);?
1)manually, in handler_sigusr1() of port and ship modules. 2) In master i have an handler for SIGARLM and SIGINT. 3) killpg cause i send the signal to all the processes of that process group (all the children of master).
In master i have an handler for SIGARLM and SIGINT.
You have a handler forSIGINT, but you're never registering it
my bad, i forgot that this handler is useless: the master (father) should have a natural termination, without sending signals because otherwise it cannot deallocate the IPCs in the cleanup function
in master
Anyway the problem persist in run_simulation, when i send the signals with killpg to children processes
i also included the screenshots of gdb where you can see the error
or you can use make gdb and try it
This question is being automatically marked as stale.
If your question has been answered, run !solved.
If your question is not answered feel free to bump the post or re-ask.
Take a look at !howto ask for tips on improving your question.