segmentation fault when try to connect oracle 19c database using olog() function

759 Views Asked by At

I am using Linux8 environment and i have installed oracle 19c client. I have tried sample example of C program in which uses olog() oci function to connect to a remote database using the client. when I execute the program with exiting database name(Giving database name in olog() function) then i am getting segmentation fault issue. If i am passing wrong database in olog() function then i am getting other issues, not segmentation fault. below is the sample code:

//

    static Lda_Def lda;                                                  
    ub4      hda[HDA_SIZE / sizeof(size_t)];                        
    void logon();
    
    main(argc, argv)
    eword argc;
    text **argv;
    {

        
        printf("\nWelcome\n");

        logon();                                      

    }
    void err_report(cursor)
    Cda_Def *cursor;
    {
        sword n;
        text msg[512];                     

        if (cursor->fc > 0)
            printf("\n-- ORACLE error when processing OCI function %s \n\n",
                oci_func_tab[cursor->fc]);
        else
            printf("\n-- ORACLE error\n");

        n = (sword)oerhms(&lda, cursor->rc, msg, (sword) sizeof msg);
        printf("%s\n", msg);

    }
    void logon()
    {

        if (olog(&lda, (ub1 *)hda, (text *)"skills", -1, (text *)"skill", -1,
            (text *)"ORCLPDB", -1, OCI_LM_DEF))
        {
            err_report((Cda_Def *)&lda);
            exit(OCI_EXIT_FAILURE);
        }

        printf("\n Connected to ORACLE as ocitest\n");

    }
 below is the error stack:
gdb) run
Using host libthread_db library "/usr/lib64/libthread_db.so.1".
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff5051992 in kpuhhaerr () from /oraclient/19.4.0.0.0/client/lib/libclntsh.so.19.1
Missing separate debuginfos, use: debuginfo-install glibc-2.17-323.0.1.el7_9.x86_64 libaio-0.3.109-13.el7.x86_64 libgcc-4.8.5-28.0.1.el7_5.1.x86_64 numactl-libs-2.0.9-7.el7.x86_64
(gdb) where
#0 0x00007ffff5051992 in kpuhhaerr () from /oraclient/19.4.0.0.0/client/lib/libclntsh.so.19.1
#1 0x00007ffff6f70f8b in ttcrbur () from /oraclient/19.4.0.0.0/client/lib/libclntsh.so.19.1
#2 0x00007ffff6f51b40 in ttcdrv () from /oraclient/19.4.0.0.0/client/lib/libclntsh.so.19.1
#3 0x00007ffff6f2157d in nioqwa () from /oraclient/19.4.0.0.0/client/lib/libclntsh.so.19.1
#4 0x00007ffff6f02aa8 in upirtrc () from /oraclient/19.4.0.0.0/client/lib/libclntsh.so.19.1
#5 0x00007ffff41cba55 in upirtr () from /oraclient/19.4.0.0.0/client/lib/libclntsh.so.19.1
#6 0x00007ffff41c657f in upilgni () from /oraclient/19.4.0.0.0/client/lib/libclntsh.so.19.1
#7 0x00007ffff51647ca in upilogc () from /oraclient/19.4.0.0.0/client/lib/libclntsh.so.19.1
#8 0x00007ffff51646de in upilog () from /oraclient/19.4.0.0.0/client/lib/libclntsh.so.19.1
#9 0x00007ffff50b20f7 in ocilog () from /oraclient/19.4.0.0.0/client/lib/libclntsh.so.19.1
#10 0x000000000040172c in logon()
#11 0x0000000000400d30 in main (argc=1, argv=0x7fffffffdf28)

Please help me to solve this issue.
Thanks in advance.
0

There are 0 best solutions below