Seg fault in ESQL/c
Posted in 1997
Hi, We are migrating some applications/databases from Informix 5 to ODS 7.23 both on Unix boxes. Vers. 5 was a Sun/OS machine and ODS is a Solaris 2.5.1 machine. (Let me note here that the new machine only has 64 memory.) We have been successfully compiling the Esql/c code until now when a relatively simple query is receiving a segmentation fault. ---------------------------------------------------------------- EXEC SQL select count (*) into :numrows from dmlecomponents where listrelname = :relation and listattname = :attribute; ---------------------------------------------------------------- the .c file looks something like this: ----------------------------------------------------------------- /* * EXEC SQL select count (*) into :numrows * from dmlecomponents * where listrelname = :relation * and listattname = :attribute; */ #line 283 "dbPicklist.ec" { #line 283 "dbPicklist.ec" static const char *sqlcmdtxt[] = #line 283 "dbPicklist.ec" { #line 283 "dbPicklist.ec" " select count ( * ) from dmlecomponents where listrelname = ? and listattna me = ?", 0 }; #line 286 "dbPicklist.ec" static _SQCURSOR _SQ0 = {0}; static struct sqlvar_struct _sqibind[] = { { 100, 0, 0, 0, 0, 0, 0, 0, 0 }, { 100, 0, 0, 0, 0, 0, 0, 0, 0 }, #line 286 "dbPicklist.ec" }; static struct sqlvar_struct _sqobind[] = { { 103, sizeof(numrows), 0, 0, 0, 0, 0, 0, 0 }, #line 286 "dbPicklist.ec" }; #line 286 "dbPicklist.ec" _sqibind[0].sqldata = relation; ------------------------------------------------------------------------ our debugger (gdb) is giving us this message: #0 0xef5cb180 in _smalloc () #1 0xef5cb1c4 in malloc () #2 0x62990 in _sqrealloc () #3 0x5b5d0 in _sqg_desc () #4 0x5c15c in _sqr_messages () #5 0x61928 in __slct () #6 0x61830 in _iqslct () #7 0x26fd4 in LogicalEntity (relation=0xefffd258 "item", attribute=0xefffd228 "remarks") at dbPicklist.ec:286 #8 0x2a118 in Dereference (sel_ptr=0x4fb7ac, deref_col=0xefffd3a0, output_no=1, select_no=0xefffd314, relations=0xeffff600, numrel=0xeffff684) at deref.ec:182 #9 0x2fbac in dbQuery (queryptr=0xeffffaa8, view_id=6, results=0xeffff8f4) at dbQuery.ec:266 #10 0x2086c in main (argc=3, argv=0xeffffb2c) at fixedQuery.ec:92 Any ideas? This seemed to work fine on the version 5 of Esql.....why is it not working now? Could it be the malloc () failed? How can you tell? Thanks for any help! Maria ----------------------------------------------------- Maria L. Wilson Computer Sciences Corporation NASA Langley Research Center 3217 North Armistead Ave. Hampton, Va 23666 email: m.l.wilson@larc.nasa.gov phone: 757-766-8265 fax: 757-766-2571 If there is no God, who pops up the next Kleenex? -- Art Hoppe -----------------------------------------------------