c - My shell segfault when I do "kill -11 0" -


when try command "/bin/kill -11 0" on bash, tcsh or zsh, doesn't segfault when try in mine, does.

so must have didn't handle.

do know can ?

thanks.

your program doesn't segfault when sends signal 11.

if execution of programs results in "segment fault" (that is, program performs illegal memory reference), operating system sends program sigsegv (signal 11 on linux). program cannot distinguish between sigsegv sent operating system result of program fault , sigsegv sent call raise or kill, possibly process, respond though there had been real program error.

if want protect shell signals sent pid 0 child process, need make sure child processes in different process group calling setpgid in child after fork.

by default, program terminated sigsegv. default, shell invoked program report program terminated sigsegv. popularly known "segfaulting", indicated above, might not have been result of real program fault.

if want program else, have catch signal sigsegv signal handler; example, if cleanup needs done before program terminates. shells (and databases) that, necessary in user code.

note: signal 11 sigsegv on linux, there no guarantee sigsegv signal 11 on different os (or in future version of linux). should always use name of signal rather number.


Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -