Re: esql/c v5, sqlexec problem followup
Posted in 1995
fleur, What error/errno do you get when the child closes the inhereted file descriptors? It seems like this should be the solution and does sound like it works. (Although I'm also at a loss for why forking twice would have any effect.) As another thought, when the fork is done, the child also inherets the parent's shared memory connections. Watch out to make sure this doesn't bite you down the line when you try to shutdown the engine. There may be a hole where the child is still attached although the engine doesn't know it. You might end up with some problems removing shared memory. (This may not be an issue with SE, it's just a thought.) Finally, my experience has been that Informix tech support is very good. BUT! You have to fight your way through the front line folks first. They're the ones who answer the phones and ask the bone head questions like you're running into. Just stand your ground and mention the word "escalate" several times. Eventually, they will pass you off to the next level and you can really get help. (I suppose the front-line guys serve their purpose. But, it gets really frustrating when you know that their advice is bogus but they refuse to help anymore until you follow it. The worst case I had was having to reinstall everything even though the serial number file showed I had done it right the first time.) --Craig (craig@chemistry.utah.edu) > > [...gobs of stuff deleted...] > > After much experemnetation, it looks like if I just close all file > descriptors up to OPEN_MAX as one of the very first things in the child > program, everything is fine. My best guess is that somehow it gets hung > up onm the pipes that get dup'ed when child processes are forked. I'm not > completely satisfied with this explanation though, since forking twice > shouldn't get rid of this problem. And since all the closes on all the > file descriptors fail. All of them. (I don't close stdin stdout or > stderr). > > When I called support, dude didn't know what a signal was. When I started > to explain it to him he said I would have to call the OS vendor for > support. After explaining part of his job to him he asked for the signal > handler function. I told him I could just tell him, since it was one > line. I read it to him, my function returned an int. So after I read it > to him (int sigchld_handler(int sig) { waitpid(-1, NULL, WNOHANG); return; > }) I tilod him it should probably be a void function. He thought I meant > to replace the word "return" with the word "void". He also asked me when > I called the signal handler. The support person knew neither the platform > or the LANGUAGE he was supporting. I was appalled. He hasn't gotten back > to me yet either, I got to this point on my own. Is their support ALWAYS > this horrible? >