Re: Segmentation Violation on FREE?
Posted in 1998
Idiot wrote: > > I have a client that does the following: > > sprintf(szSql,...); > PREPARE stmtID FROM :szSql; > DECLARE cursID FOR stmtID; > FREE stmtID; > OPEN cursID; > FETCH cursID; > CLOSE cursID; > FREE cursID; > > Every now and then they receive segmentation violations and Informix dump > core file. I am working with the core file as we speak. A first look made > us believe that the FREE along with a valloc call is responsible. Remember > I am still investigating. I am wondering if anyone seen this before? I am > running 7.23 UC11 on HP-UX B.10.01. The ESQL/C library is 7.23 UC5 which > Informix says ok to use with engine version 7.23 UC11. Freeing a statement that is to be accessed by a cursor later is bad news! The SEGV you are seeing is what usually happens when one tries this trick. Yes the manuals seem to support this but it bombs almost everytime. Art S. Kagel