From Bugzilla Helper: User-Agent: Mozilla/4.0 (compatible; MSIE 5.01; Windows NT 5.0; Computer Associates International v2.501a) In my c program, that using a C-API connects to a database, I issue a signal(SIGPIPE, SIG_IGN); then connect to the database do nothing with the database and start a infinite loop. In another window I issue kill -13 pid and I get a SEGV and core dump. If I ignore other signals none of them cause a SEGV except SIGSEGV and SIGPIPE. Reproducible: Always Steps to Reproduce: 1. Compile the program 2. run the program 3. issue a ps -a and get the pid 4. issue a kill -13 pid Actual Results: Segmentation fault (core dump). Expected Results: Nothing should have happened it was supposed to ignore the signal. Here is the program: #include "codqlhdr.h" #include <stdio.h> #include <string.h> #include <stdlib.h> #include <unistd.h> #include <sys/types.h> #define TIME 5 int main() { odbSessH sh; odbStatus rc; odbMMProp mmProp; char *envfile = getenv("JAS_ENVFILE"); char msg[128]; char t; long msglen; long errorcode; /*IGNORE SIGPIPE*/ signal(SIGPIPE,SIG_IGN); /* SESSION START */ printf("make keep sleeping for %d(s) \n",TIME); sleep(TIME); printf("\n======START SESSION!!======\n"); rc = odbSesStart(&sh,NULL,NULL,NULL,NULL); if(rc != ODB_NORMAL) { printf("It was not able to connect to the Jasmine server at LINE31.\n"); odbGetError(sh,&errorcode,msg,128,&msglen); printf("Detail information(%s).\n",msg); exit(1); } /* loop eternally */ for(;;); return(0); }
I tried to reproduce the bug but could not compile your program without the API. Nonetheless, I may give you 2 suggestions: 1) Move getenv() outside the declarations 2) Make sure, you include signal.h
I realize you would not be able to reproduce exactly without the api which I can't provide. Can you try connecting to any database? Also I did as you suggested and its better, just a segmentation fault without the core dump.
Without the "odb" this seems to work. I would assume odb is unblocking SIGPIPE for internal use and not handling it correctly