无法在linux中编译Pro * c代码

时间:2018-03-27 17:27:19

标签: oracle stored-procedures oracle-pro-c

我在C项目中有一个pro * C文件,我正在尝试编译但是在编译后我没有得到C代码。

以下是环境变量:

ORACLE_HOME           = /opt/vgi/oracle/12.1.0.2/client

procTest.pc文件:

#include <stdio.h>
#include <string.h>
#include <sqlda.h>
#include <sqlcpr.h>


EXEC SQL BEGIN DECLARE SECTION;
VARCHAR uid[30];
VARCHAR pwd[30];
EXEC SQL END DECLARE SECTION;

EXEC SQL INCLUDE SQLCA.H;

void main()
{
    strcpy(uid.arr,"SCOTT");
    uid.len =strlen(uid.arr);
    strcpy(pwd.arr,"TIGER");
    pwd.len = strlen(pwd.arr);

    EXEC SQL WHENEVER SQLERROR GOTO errexit;
    EXEC SQL CONNECT :uid IDENTIFIED BY :pwd;

    printf("Connected to Oracle8i using Scott/Tiger\n");

    EXEC SQL COMMIT WORK RELEASE;
    return;

errexit:
    printf("Connection failed");
    return;


} 

/* end of main */

编译时得到的输出:

bash-4.1$ proc procTest.pc

Pro*C/C++: Release 12.1.0.2.0 - Production on Tue Mar 27 13:22:43 2018

Copyright (c) 1982, 2014, Oracle and/or its affiliates.  All rights reserved.

System default option values taken from: /opt/vgi/oracle/12.1.0.2/client/precomp/admin/pcscfg.cfg

dbgc_init_all failed with ORA-48141
ORA-00600: internal error code, arguments: [17998], [2], [], [], [], [], [], [], [], [], [], []
ORA-00600: internal error code, arguments: [17998], [2], [], [], [], [], [], [], [], [], [], []


----- Call Stack Trace -----
calling              call     entry                argument values in hex
location             type     point                (? means dubious value)
-------------------- -------- -------------------- ----------------------------
skgudmp()+188        call     kgdsdst()            000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
kgeriv_int()+191     call     skgudmp()            000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
kgeriv()+19          call     kgeriv_int()         000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
kgeasi()+237         call     kgeriv()             000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
pcgini()+1438        call     kgeasi()             000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
pc2main()+1207       call     pcgini()             000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
pcmain()+35          call     pc2main()            000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
lpmcall()+680        call     pcmain()             000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
lpmpmai()+420        call     lpmcall()            000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
main()+458           call     lpmpmai()            000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
__libc_start_main()  call     main()               000000000 ? 000000000 ?
+253                                               000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?

Call stack signature: 0x4f7f9afc37164890



call stack performance statistics:
total                  : 0.000000 sec
setup                  : 0.000000 sec
stack unwind           : 0.000000 sec
symbol translation     : 0.000000 sec
printing the call stack: 0.000000 sec
printing frame data    : 0.000000 sec
printing argument data : 0.000000 sec


----- End of Call Stack Trace -----

kgepop: no error frame to pop to for error 600
ORA-00600: internal error code, arguments: [kgepop: no error frame to pop to], [], [], [], [], [], [], [], [], [], [], []
ORA-00600: internal error code, arguments: [17998], [2], [], [], [], [], [], [], [], [], [], []
ORA-00600: internal error code, arguments: [kgepop: no error frame to pop to], [], [], [], [], [], [], [], [], [], [], []
ORA-00600: internal error code, arguments: [17998], [2], [], [], [], [], [], [], [], [], [], []


----- Call Stack Trace -----
calling              call     entry                argument values in hex
location             type     point                (? means dubious value)
-------------------- -------- -------------------- ----------------------------
skgudmp()+188        call     kgdsdst()            000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
kgerinv_internal()+  call     skgudmp()            000000000 ? 000000000 ?
111                                                000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
kgerinv()+40         call     kgerinv_internal()   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
kgerin()+130         call     kgerinv()            000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
kgepop()+633         call     kgerin()             000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
kgeasi()+382         call     kgepop()             000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
pcgini()+1438        call     kgeasi()             000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
pc2main()+1207       call     pcgini()             000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
pcmain()+35          call     pc2main()            000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
lpmcall()+680        call     pcmain()             000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
lpmpmai()+420        call     lpmcall()            000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
main()+458           call     lpmpmai()            000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
__libc_start_main()  call     main()               000000000 ? 000000000 ?
+253                                               000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?

Call stack signature: 0x6c275a0c4ae84a31



call stack performance statistics:
total                  : 0.000000 sec
setup                  : 0.000000 sec
stack unwind           : 0.000000 sec
symbol translation     : 0.000000 sec
printing the call stack: 0.000000 sec
printing frame data    : 0.000000 sec
printing argument data : 0.000000 sec


----- End of Call Stack Trace -----

ORA-00600: internal error code, arguments: [kgepop: no error frame to pop to], [], [], [], [], [], [], [], [], [], [], []
ORA-00600: internal error code, arguments: [17998], [2], [], [], [], [], [], [], [], [], [], []
ORA-00600: internal error code, arguments: [kgepop: no error frame to pop to], [], [], [], [], [], [], [], [], [], [], []
ORA-00600: internal error code, arguments: [17998], [2], [], [], [], [], [], [], [], [], [], []


----- Call Stack Trace -----
calling              call     entry                argument values in hex
location             type     point                (? means dubious value)
-------------------- -------- -------------------- ----------------------------
skgudmp()+188        call     kgdsdst()            000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
kgepop()+711         call     skgudmp()            000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
kgeasi()+382         call     kgepop()             000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
pcgini()+1438        call     kgeasi()             000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
pc2main()+1207       call     pcgini()             000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
pcmain()+35          call     pc2main()            000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
lpmcall()+680        call     pcmain()             000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
lpmpmai()+420        call     lpmcall()            000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
main()+458           call     lpmpmai()            000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?
__libc_start_main()  call     main()               000000000 ? 000000000 ?
+253                                               000000000 ? 000000000 ?
                                                   000000000 ? 000000000 ?

Call stack signature: 0xa8f3ded765e05f1e



call stack performance statistics:
total                  : 0.010000 sec
setup                  : 0.000000 sec
stack unwind           : 0.000000 sec
symbol translation     : 0.010000 sec
printing the call stack: 0.000000 sec
printing frame data    : 0.000000 sec
printing argument data : 0.000000 sec


----- End of Call Stack Trace -----

我第一次尝试pro * C而且我不知道这里有什么问题。

2 个答案:

答案 0 :(得分:3)

这听起来很像Bug 20406840 : PROC 12.1.0.2 THROWS ORA-600 [17998] WHEN PRECOMPILING BY 'OTHER' USER

  

问题:   从12.1.0.1升级到12.1.0.2后,Pro * C抛出ORA-600 [17998]   当通过&#39;其他&#39;进行预编译时用户,不安装Oracle用户。

     

替代方法:   &#39; chmod 777 $ ADR_BASE / diag / plsql&#39;由安装的Oralce用户。   创建目录$ ADR_BASE / diag / plsql / user_后,   即使$ ADR_BASE / diag / plsql的权限重置775,Pro * C也能正常工作。

基本上,由于12.1.0.2中的错误,除非您以安装Oracle的用户身份运行,否则您无权创建目录并且崩溃。有一个补丁和一个解决方法。

答案 1 :(得分:1)

kfinity answer的区别很小:将chmod 777移至diag文件夹,并且在第一次编译运行后,有必要将其重置为chmod775。Source