Compilation with esql shows Illegal instruction
Posted in 2016
On HP-UX 11.31 Itanium with Informix 11.70.FC8W1, the esql preprocessor core-dumped with "Illegal instruction" when a host variable used a deeply nested struct/array reference (e.g. :inf_cl.lib_con_fm.gener.mes[3].eds) in an EXEC SQL PUT. It failed even with preprocess-only (-e). Suggestions included checking line endings, using a pointer host variable, reinstalling CSDK, and getting a gdb/adb stack trace; none helped. IBM reproduced it (HP-UX Itanium only, a bug in the esqlc binary) and logged a defect, advising a PMR to expedite a fix. The poster's workaround was copying struct elements into temporary host variables.
Auto-generated by DrWatson from the posts below — may be imperfect; read the full thread.
Topics: Connectivity: ESQL/C, 4GL & Embedded SQL, Platform-Specific Issues
My enviroment: HP-UX 11.31 Itanimum 64 bits Informix 11.70 FC8 W1 Hi, I trying to compile a program with the command: /opt/informix/bin/esql est2.ec -o est2.exe It results in : opt/informix/bin/esql[821]: 26790 Illegal instruction(coredump) The origin program is very large. I make a example program, diminishing the original code (only for detect the source error) The error occurs in this sentence: exec sql put cur_resmovfm from :inf_cl.lib_con_fm.gener.mes[glbtol_intervalos].eds I tried with: esql -e est2.ec and the error is the same. I debugged the esql and the error occurs in: /opt/informix/lib/esql/esqlc -t unix est2.ec Are there limitations with the use of structures in esqlc ? Any bug known with HP-UX Itanium and Informix ? Please, provide me any clues according yor experience. Thanks in advance. Bellow is the example code. est2.ec ------- exec sql Begin declare section; struct nyd { double eds; }; struct sec_transf { struct nyd mes[7]; }; struct fact_calc_comp { struct sec_transf gener; }; struct inform_cliente { struct fact_calc_comp lib_con_fm; }inf_cl; exec sql end declare section; main(argc, argv) int argc; char *argv[]; { /* exec sql Prepare ins_into_resmovfm from "Insert into cs_comp_movil_fm(cod_periodo) values(?)"; exec sql Declare cur_resmovfm cursor with hold for ins_into_resmovfm; exec sql Open cur_resmovfm; */ exec sql put cur_resmovfm from :inf_cl.lib_con_fm.gener.mes[3].eds ; }
Make sure the source code in in your system file format (that you don't have CR+LF instead of CR as end of line marker) and that your last line has a CR added to it. On Wed, Jul 6, 2016 at 5:24 PM, ROGER VILCA <rvilca@luzdelsur.com.pe> wrote: > My enviroment: > HP-UX 11.31 Itanimum 64 bits > Informix 11.70 FC8 W1 > > Hi, > I trying to compile a program with the command: > /opt/informix/bin/esql est2.ec -o est2.exe > It results in : > opt/informix/bin/esql[821]: 26790 Illegal instruction(coredump) > > The origin program is very large. I make a example program, diminishing the > original code (only for detect the source error) > > The error occurs in this sentence: > > exec sql put cur_resmovfm from > :inf_cl.lib_con_fm.gener.mes[glbtol_intervalos].eds > > I tried with: > esql -e est2.ec > and the error is the same. > > I debugged the esql and the error occurs in: > > /opt/informix/lib/esql/esqlc -t unix est2.ec > > Are there limitations with the use of structures in esqlc ? > Any bug known with HP-UX Itanium and Informix ? > > Please, provide me any clues according yor experience. > Thanks in advance. > > Bellow is the example code. > > est2.ec > ------- > > exec sql Begin declare section; > > struct nyd > { double eds; > }; > > struct sec_transf > { > struct nyd mes[7]; > }; > > struct fact_calc_comp > { > struct sec_transf gener; > }; > > struct inform_cliente > { > struct fact_calc_comp lib_con_fm; > }inf_cl; > > exec sql end declare section; > > main(argc, argv) > int argc; > char *argv[]; > { > /* > > exec sql Prepare ins_into_resmovfm from > > "Insert into cs_comp_movil_fm(cod_periodo) values(?)"; > > exec sql Declare cur_resmovfm cursor with hold > > for ins_into_resmovfm; > > exec sql Open cur_resmovfm; > */ > > exec sql put cur_resmovfm from > > :inf_cl.lib_con_fm.gener.mes[3].eds > > ; > } > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > -- Fernando Nunes Portugal http://informix-technology.blogspot.com My email works... but I don't check it frequently... --001a114ac942d850e00536fa3de9
Try creating a pointer type of the type of inf_cl.lib_con_fm.gener.mes (IE *struct nyd) as a host variable and initialize it to point to inf_cl.lib_con_fm.gener.mes. Then you can: exec sql begin declare section; struct nyd { double eds; }; ... struct nyd *nyd_ptr; exec sql end declare section; nyd_ptr = &inf_cl.lib_con_fm.gener.mes[3]; exec sql put from :nyd_ptr->eds; nyd_ptr++; The multi-level structure dereference may be too much for the compiler. Art Art S. Kagel, President and Principal Consultant ASK Database Management www.askdbmgt.com Blog: http://informix-myview.blogspot.com/ Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Wed, Jul 6, 2016 at 12:24 PM, ROGER VILCA <rvilca@luzdelsur.com.pe> wrote: > My enviroment: > HP-UX 11.31 Itanimum 64 bits > Informix 11.70 FC8 W1 > > Hi, > I trying to compile a program with the command: > /opt/informix/bin/esql est2.ec -o est2.exe > It results in : > opt/informix/bin/esql[821]: 26790 Illegal instruction(coredump) > > The origin program is very large. I make a example program, diminishing the > original code (only for detect the source error) > > The error occurs in this sentence: > > exec sql put cur_resmovfm from > :inf_cl.lib_con_fm.gener.mes[glbtol_intervalos].eds > > I tried with: > esql -e est2.ec > and the error is the same. > > I debugged the esql and the error occurs in: > > /opt/informix/lib/esql/esqlc -t unix est2.ec > > Are there limitations with the use of structures in esqlc ? > Any bug known with HP-UX Itanium and Informix ? > > Please, provide me any clues according yor experience. > Thanks in advance. > > Bellow is the example code. > > est2.ec > ------- > > exec sql Begin declare section; > > struct nyd > { double eds; > }; > > struct sec_transf > { > struct nyd mes[7]; > }; > > struct fact_calc_comp > { > struct sec_transf gener; > }; > > struct inform_cliente > { > struct fact_calc_comp lib_con_fm; > }inf_cl; > > exec sql end declare section; > > main(argc, argv) > int argc; > char *argv[]; > { > /* > > exec sql Prepare ins_into_resmovfm from > > "Insert into cs_comp_movil_fm(cod_periodo) values(?)"; > > exec sql Declare cur_resmovfm cursor with hold > > for ins_into_resmovfm; > > exec sql Open cur_resmovfm; > */ > > exec sql put cur_resmovfm from > > :inf_cl.lib_con_fm.gener.mes[3].eds > > ; > } > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --001a1143e7984f665e0536fa40b8
blockquote, div.yahoo_quoted { margin-left: 0 !important; border-left:1px #715FFA solid !important; padding-left:1ex !important; background-color:white !important; } You might want to just generate the c code. The esql program is just a preprocessor which converts the sql statements into function calls and then runs the generated text file through the 'c' compiler. If you can run the preprocessor only, then you know that the problem is with the installation of the 'c' compiler. Sent from Yahoo Mail for iPad On Wednesday, July 6, 2016, 9:41 AM, Fernando Nunes <domusonline@gmail.com> wrote: Make sure the source code in in your system file format (that you don't have CR+LF instead of CR as end of line marker) and that your last line has a CR added to it. On Wed, Jul 6, 2016 at 5:24 PM, ROGER VILCA <rvilca@luzdelsur.com.pe> wrote: > My enviroment: > HP-UX 11.31 Itanimum 64 bits > Informix 11.70 FC8 W1 > > Hi, > I trying to compile a program with the command: > /opt/informix/bin/esql est2.ec -o est2.exe > It results in : > opt/informix/bin/esql[821]: 26790 Illegal instruction(coredump) > > The origin program is very large. I make a example program, diminishing the > original code (only for detect the source error) > > The error occurs in this sentence: > > exec sql put cur_resmovfm from > :inf_cl.lib_con_fm.gener.mes[glbtol_intervalos].eds > > I tried with: > esql -e est2.ec > and the error is the same. > > I debugged the esql and the error occurs in: > > /opt/informix/lib/esql/esqlc -t unix est2.ec > > Are there limitations with the use of structures in esqlc ? > Any bug known with HP-UX Itanium and Informix ? > > Please, provide me any clues according yor experience. > Thanks in advance. > > Bellow is the example code. > > est2.ec > ------- > > exec sql Begin declare section; > > struct nyd > { double eds; > }; > > struct sec_transf > { > struct nyd mes[7]; > }; > > struct fact_calc_comp > { > struct sec_transf gener; > }; > > struct inform_cliente > { > struct fact_calc_comp lib_con_fm; > }inf_cl; > > exec sql end declare section; > > main(argc, argv) > int argc; > char *argv[]; > { > /* > > exec sql Prepare ins_into_resmovfm from > > "Insert into cs_comp_movil_fm(cod_periodo) values(?)"; > > exec sql Declare cur_resmovfm cursor with hold > > for ins_into_resmovfm; > > exec sql Open cur_resmovfm; > */ > > exec sql put cur_resmovfm from > > :inf_cl.lib_con_fm.gener.mes[3].eds > > ; > } > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > -- Fernando Nunes Portugal http://informix-technology.blogspot.com My email works... but I don't check it frequently... --001a114ac942d850e00536fa3de9 ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum.
Hi, The error also ocurrs with "preprocess only" (option -e) #esql -e est2.ec /opt/informix/bin/esql[821]: 25649 Illegal instruction(coredump)
Thanks Art, I've probed with this recomendation, but the error remains. As workaround, I'm using temporary variables. With this variables (copies of the elements of structures) I use the "exec sql put" sentence. Regards, Roger
Try reinstalling the CSDK Art Art S. Kagel, President and Principal Consultant ASK Database Management www.askdbmgt.com Blog: http://informix-myview.blogspot.com/ Disclaimer: Please keep in mind that my own opinions are my own opinions and do not reflect on the IIUG, nor any other organization with which I am associated either explicitly, implicitly, or by inference. Neither do those opinions reflect those of other individuals affiliated with any entity with which I am affiliated nor those of the entities themselves. On Thu, Jul 7, 2016 at 7:44 PM, ROGER VILCA <rvilca@luzdelsur.com.pe> wrote: > Hi, > > The error also ocurrs with "preprocess only" (option -e) > > #esql -e est2.ec > /opt/informix/bin/esql[821]: 25649 Illegal instruction(coredump) > > > > ******************************************************************************* > Forum Note: Use "Reply" to post a response in the discussion forum. > > --001a114449589c2aa6053714a2fd
If you are getting a core dump, you might want to use either adb or gdb to see what function is getting the IOP. Also you might want to make sure that the esql preprocessor is the correct one. Also with gdb/adb you can get a stack trace which would need to be given to tech support when you contact them. Chances are that the problem will not reproduce on another environment. So try to give them as much information as you can. Also, be aware that when a program is loaded for execution, if the build is not a static build, then there can be late binding of the 'so'/ddl libraries. It is entirely possible that some other library that was loaded by 'ls' process as part of execution start is actually causing the problem. Madison Pruet Retired and Loving it On Thursday, July 7, 2016 5:52 PM, ROGER VILCA <rvilca@luzdelsur.com.pe> wrote: Thanks Art, I've probed with this recomendation, but the error remains. As workaround, I'm using temporary variables. With this variables (copies of the elements of structures) I use the "exec sql put" sentence. Regards, Roger ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum.
This has been reproduced and entered as a defect yesterday. It reproduces on HP-UX Itanium only, and yes, the error clearly seems to=20 be in esqlc binary. In case a fix is required, I'd recommend opening a PMR to expedite the=20 fix. (separate CSDK support might be required.) HTH, Andreas From: "Madison Pruet" <madison=5Fpruet@yahoo.com> To: ids@iiug.org Date: 08.07.2016 02:17 Subject: Re: Compilation with esql shows Illegal instructio [37391] Sent by: ids-bounces@iiug.org If you are getting a core dump, you might want to use either adb or gdb to = see=20 what function is getting the IOP. Also you might want to make sure that=20 the=20 esql preprocessor is the correct one. Also with gdb/adb you can get a=20 stack=20 trace which would need to be given to tech support when you contact them.=20 Chances are that the problem will not reproduce on another environment. So = try=20 to give them as much information as you can.=20 Also, be aware that when a program is loaded for execution, if the build=20 is=20 not a static build, then there can be late binding of the 'so'/ddl=20 libraries.=20 It is entirely possible that some other library that was loaded by 'ls'=20 process as part of execution start is actually causing the problem.=20 Madison=20 Pruet=20 Retired and Loving it=20 On Thursday, July 7, 2016 5:52 PM, ROGER VILCA <rvilca@luzdelsur.com.pe>=20 wrote:=20 Thanks Art,=20 I've probed with this recomendation, but the error remains.=20 As workaround, I'm using temporary variables. With this variables (copies=20 of=20 the elements of structures) I use the "exec sql put" sentence.=20 Regards,=20 Roger=20 ***************************************************************************= ****=20 Forum Note: Use "Reply" to post a response in the discussion forum.=20 ***************************************************************************= ****=20 Forum Note: Use "Reply" to post a response in the discussion forum.=20
blockquote, div.yahoo_quoted { margin-left: 0 !important; border-left:1px #715FFA solid !important; padding-left:1ex !important; background-color:white !important; } Good job. Sent from Yahoo Mail for iPad On Friday, July 8, 2016, 12:46 AM, Andreas Legner <andreas.legner@de.ibm.com> wrote: This has been reproduced and entered as a defect yesterday. It reproduces on HP-UX Itanium only, and yes, the error clearly seems to=20 be in esqlc binary. In case a fix is required, I'd recommend opening a PMR to expedite the=20 fix. (separate CSDK support might be required.) HTH, Andreas From: "Madison Pruet" <madison=5Fpruet@yahoo.com> To: ids@iiug.org Date: 08.07.2016 02:17 Subject: Re: Compilation with esql shows Illegal instructio [37391] Sent by: ids-bounces@iiug.org If you are getting a core dump, you might want to use either adb or gdb to = see=20 what function is getting the IOP. Also you might want to make sure that=20 the=20 esql preprocessor is the correct one. Also with gdb/adb you can get a=20 stack=20 trace which would need to be given to tech support when you contact them.=20 Chances are that the problem will not reproduce on another environment. So = try=20 to give them as much information as you can.=20 Also, be aware that when a program is loaded for execution, if the build=20 is=20 not a static build, then there can be late binding of the 'so'/ddl=20 libraries.=20 It is entirely possible that some other library that was loaded by 'ls'=20 process as part of execution start is actually causing the problem.=20 Madison=20 Pruet=20 Retired and Loving it=20 On Thursday, July 7, 2016 5:52 PM, ROGER VILCA <rvilca@luzdelsur.com.pe>=20 wrote:=20 Thanks Art,=20 I've probed with this recomendation, but the error remains.=20 As workaround, I'm using temporary variables. With this variables (copies=20 of=20 the elements of structures) I use the "exec sql put" sentence.=20 Regards,=20 Roger=20 ***************************************************************************= ****=20 Forum Note: Use "Reply" to post a response in the discussion forum.=20 ***************************************************************************= ****=20 Forum Note: Use "Reply" to post a response in the discussion forum.=20 ******************************************************************************* Forum Note: Use "Reply" to post a response in the discussion forum.