Developer forums (C::B DEVELOPMENT STRICTLY!) > Contributions to C::B

SIGPIPE handler is not set to default handler

(1/3) > >>

blacksages:
SIGPIPE signal handler is set to SIG_IGN instead of SIG_DFL
Even though gnu gcc default (edit: the default compiler on codeblocks I used) signal handler should not ignore the signals : https://www.gnu.org/software/libc/manual/html_node/Operation-Error-Signals.html

I reported this error on stackoverflow: https://stackoverflow.com/questions/53801914/why-was-default-sigpipe-handler-changed

A detailed example is given on my stackoverflow post please look into it for more information.

this was tested on fedora 28, it is not a behaviour of fedora but codeblocks itself

stahta01:
Do you understand that Code::Blocks is an IDE; and, it is not a compiler?

Because your post seems to be about an compiler issue instead of a IDE issue.

Edit: The link implies you know the difference between the CB IDE and the GCC Compiler.

Looks like an Linux expert is going to have to read your link to decide if this is a valid CB issue.

Tim .

blacksages:
Sorry I should make this clearer.

I installed codeblocks and the default compiler given was gcc. SIGPIPE signal handler by GCC standard should be SIG_DFL, but codeblocks doesn't respect that standard.
In my post I elaborate on how I tried to use GCC with the command-line, and it showed in command-line that SIG_DFL was used, so indeed it is not a problem with the compiler.

edit: One of the comment on my post suggested it was due to gtk library

BlueHazzard:
I do not think codeblocks alters anything in your signal handlers....
Codeblocks does not alter the code or anything about your program. I think the problem is in the console runner codeblocks uses. Can you try if the error happens also if you run the with codeblocks compiled program from the shell and not from within codeblocks?

oBFusCATed:

--- Quote from: blacksages on January 19, 2019, 10:28:58 am ---... SIGPIPE signal handler by GCC standard should be SIG_DFL, but codeblocks doesn't respect that standard...

--- End quote ---
Can you provide a quote from the standard where it is specified that the signal handlers should have been reset to defaults after a fork/exec? From the info given up to now I can only conclude that they are inherited from the parent process and so they have random state after fork/exec. So if your program has some expectations, it should use the specific system calls to set them up.

p.s. signal handlers are OS feature and they have nothing to do with GCC.
p.p.s. There is no mention of SIGPIPE in C::B's source code...

Navigation

[0] Message Index

[#] Next page

Go to full version