proc编译正常,执行Illegal instruction(coredump)
主机:Aix5.3
编译:gcc
代码很简单:
int i;
char cftp_usr[21];
sprintf(username,"test");
sprintf(password,"test");
sprintf(dbhost,"cur.test.com");
memset(cftp_usr,0,sizeof(cftp_usr));
EXEC SQL WHENEVER SQLERROR DO sql_error("ORACLE error--\n");
EXEC SQL WHENEVER NOTFOUND DO nothing();
EXEC SQL CONNECT :username IDENTIFIED BY :password USING :dbhost;
/*下一句执行错误 */
EXEC SQL SELECT ftp_user into :cftp_usr FROM KPI_FTP_INFO where busi_type=1;
/* 正常 */
EXEC SQL select kpi_op_accept.nextval into :op_accept from dual;
EXEC SQL COMMIT WORK;
用dbx跟踪后:
"sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn);" is executed.
Illegal instruction (reserved addressing fault) in . at 0x0 ($t1)
0x00000000 00000000 Invalid opcode.