Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Segfault on OCIStmtExecute()
Hi all,
I'm trying to figure out how to deal with cursor in oci. Following code gets
segfault under rh linux as/oracle 9.0.2./gcc 2.96. The code is based on oci
cdemorid demo which has been tested. What is the possible reason for this?
TIA
// stack trace
#0 0x08557583 in kpucHTtoIL ()
#1 0x0848bd99 in ttcrs2c ()
#2 0x08649e92 in ttcacs ()
#3 0x08650653 in ttcdrv ()
#4 0x0834f778 in nioqwa ()
#5 0x084a1b81 in upirtrc ()
#6 0x0824228a in kpurcsc ()
#7 0x081e5df2 in kpuexecv8 ()
#8 0x081e7db7 in kpuexec ()
#9 0x0806983f in OCIStmtExecute ()
#10 0x0805be1b in main (argc=1, argv=0xbffec654) at cdemorid.c:128
#11 0x40079657 in __libc_start_main (main=0x805bc10 <main>, argc=1,
ubp_av=0xbffec654, init=0x805aa20 <_init>, fini=0x87b68b0 <_fini>,
rtld_fini=0x4000dcd4 <_dl_fini>, stack_end=0xbffec64c)
at ../sysdeps/generic/libc-start.c:129
/////////////////////////////
////////////////////////////
init_handles(&envhp, &errhp, (ub4)OCI_DEFAULT);
OCILogon(envhp, errhp, &svchp, username, strlen (username), password, strlen
(password), dbname, strlen(dbname));
OCIHandleAlloc(envhp, (void **)&fstmt_p, OCI_HTYPE_STMT, 0, NULL);
OCIStmtPrepare(fstmt_p, errhp, (unsigned char *)sql,
strlen(sql),OCI_NTV_SYNTAX, OCI_DEFAULT);
OCIBindByPos(fstmt_p,&bind1_p, errhp, 1, &fstmt_p1, 0,
SQLT_RSET,0,0,0,0,0,OCI_DEFAULT);
// segfault comes
OCIStmtExecute(svchp, fstmt_p, errhp, 1, 0, NULL, NULL,
OCI_DEFAULT);
OCIDefineByPos(fstmt_p1,&define_p, errhp, 1, &cc, sizeof(int), SQLT_INT,
0,0,0,OCI_DEFAULT);
OCIStmtFetch2(fstmt_p1,
errhp,
1,
OCI_DEFAULT,
1,
OCI_DEFAULT);
Received on Tue Apr 22 2003 - 13:47:50 CDT