Search code examples
coracle-databaseunixcoredumporacle-pro-c

sqlcxt() causes segmentation fault


Lets state the conditions where sqlcxt() can cause segmentation fault, I am woking on unix, using ProC for database connections to Oracle database.

My program crashes and the core file shows that the crash is due to the sqlcxt() function

A loadobject was found with an unexpected checksum value.
See `help core mismatch' for details, and run `proc -map'
to see what checksum values were expected and found.

...

dbx: warning: Some symbolic information might be incorrect.

...

t@null (l@1) program terminated by signal SEGV

 (no mapping at the fault address)0xffffffffffffffff:     
<bad address 0xffffffffffffffff>
Current function is dbMatchConsortium
  442               **sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn);**

Solution

  • There is a decent chance that the problem you are having is some sort of pointer-error / memory allocation error in your C code. These things are never easy to find. Some things that you might try:

    1. See if you can comment out (or #ifdef) out sections of your program and if the problem disappears. If so then you can close in on the bad section
    2. Run your program in a debugger.
    3. Do a code review with somebody else - this will often lead to finding more than one problem (Usually works in my code).

    I hope that this helps. Please add more details and I will check back on this question and see if I can help you .