[ESQL/C] Segmentation Fault on Prepare
Posted in 1993
This problem is driving me crazy! I'm getting a segmentation fault on a prepare statement, for no apparent reason. Any help is greatly appreciated. Platform: Sun IPX, ESQL/C 4.10.UE1, informix online 5.01.UC1. The code: A vanilla prepare statement, illustrated below (simplified): sprintf(prep_str, "SELECT fld1, fld2 FROM %s ORDER BY fld1", from_clause); $prepare p1 from prep_str; /* Statement that segfaults */ $declare c1 cursor for p1; . . . The above statements are parts of a subroutine that is linked to the main routine that calls it. It will work for a certain number of times (around 32) and then fail, always at the same iteration. Sounds like a memory leak internal to esql/c. My debugger tells me that the prepare (that gets translated to an _iqnprep() call in c) calls _iqlocate_cursor() which calls stcmpr() which produces the segmentation fault. I can certify that there's nothing wrong with the c variables that are used in the prepare statement (prep_str and from_clause in the example above). Can anyone offer some advice, other than calling informix tech support? John Droggitis Bell Communications Research johnd@leis.bellcore.com