Re: esql core dumped !
Posted in 2003
Hi , Guess, the picture is clear now. First thing, you are right - ESQL/C does NOT recommend the use of $ include or EXEC SQL include <*.h> within the BEGIN/END declare section. Only because, it works with some ESQL/C version on some platforms, does not warranty it to work everywhere.. The ESQL/C programmer's manual also does not recommend the use of such syntax. I can only suggest one thing - if you MUST, and have to use the $include files, try moving them out of the BEGIN/END DECLARE section, and then try to compile the application. It should work better , and should not report any errors. Something like this -- #include <stdio.h> #include <time.h> #include <string.h> #include <stdlib.h> exec sql include "tab_one.h"; exec sql include "tab_two.h"; .... .... exec sql include "tab_250.h"; ;;;;;;; The problem may not be with the ESQL/C file, but infact with the header files that are being included. And by this I only mean, that the header file has some C specific syntaxes, and when you try to include that header file withing the BEGIN/END DECLARE SECTION, what we are trying to do here is mixing up the C specific with the ESQL/C specific, and which may confuse the compiler (to the extent that it may core dump). I seriously recommend that you remove the header files out of the BEGIN/ END declare section, and recompile the applications. We have ahd such cases reported earlier too, and have asked customers to try the same solution, and has worked for them. Try this, and hopefully it will work! Thanks and Regards, Abhi. -------------------------------------------------------------------- There are 10 kinds of people,,,,, .... those who understand binary notations, and those who don't. -------------------------------------------------------------------- "hobbes" <pasdespam@yahoo.fr> Sent by: owner-informix-list@iiug.org 08/27/2003 01:57 AM Please respond to "hobbes" To: informix-list@iiug.org cc: Subject: Re: esql core dumped ! >Hi Hobbes, Hi ! > I have been reading though the chain of mails. Just wanted to >clarify one more thing - you said that your include files are all #include >*.h (header files) right? That's right >They are not $include (header file). Am I right? That's right too >If this is the case, then ideally you should not be getting a core >dump when trying to compile your *.ec application. One thing you might >want to try to understand if this is an ESQL/C issue for sure is to do - >% esql -e <filename>. The -e option does a preprocess only, and no >compilation or linking. Since ESQL/C basically is just a preprocessor, >this will indicate if this is an ESQL/C issue. If ESQL/C still core dumps, >you can be sure that there is an ESQL/C problem. See the generated *.c >file is correct, or has some issues. Our compilation process is in 3 step. 1) Preprocessing with one of our proprietary preprocessor 2) Preprocessing the esql embedded with the appropriate tool (proc/c or oracle, esqlc for informix....) 3) Finally linking and compiling with a c compiler . This time gcc. So, the only thing i'm trying to do is preprocessing (so i use -e and -ansi options) That's why i thought of an esql/c issue. >A small repro, indicating of what exactly is happing in your repro,,, like >a psuedo code, would help. I could try some stuff at my end, and see if I >find anything suspicious. The code is pretty simple. ========================== #include <stdio.h> #include <time.h> #include <string.h> #include <stdlib.h> exec sql begin declare section; exec sql include "tab_one.h"; exec sql include "tab_two.h"; .... .... exec sql include "tab_250.h"; exec sql end declare section; extern void DEFAULT_tab_one(struct tab_one_ *_elt); ....and so on.... void TEST_DEF_tab_one(long _user, struct tab_one_ *_elt) { /* DEFAULT initialising */ (void) DEFAULT_tab_one(_elt); /* init from user */ switch(_user) { default: break; } } ... and so on .... ========================== A very repetitive source since it is auto-generated. The core happens in the exec sql include part. I know that include between declare section is not recommended. But: 1) i 've got declaration of string type in my .h so i do not have any other choice 2) Some version of esql/c are ok with that, and others are not... >Also make sure that you do not have $include statements but instead >#include. Having $include would mean that they would be preprocesed. Not >that it should throw an error either ways, but it would help eliminate >some options and narrow down your problem area. OK :) My first message is certainly not really clear.... since i do exec sql include. I need preprocessing for having access to variable in this part of code... The declaration of type string => do not let me any other choice :) >Third - Yes, there seems to be some problem with the product put up at the >"passport advantage" web site that you pointed in the mail below. The >problem has been reported to the concerned department, and we should have >a resolution on that sometime soon. OK :) thx for the test and for the "action" :) And thank you for the time you spend to give me ways to explore. Arnaud sending to informix-list