Segmentation Fault at sqlcxt


 
Thread Tools Search this Thread
Top Forums Programming Segmentation Fault at sqlcxt
# 1  
Old 08-30-2006
Segmentation Fault at sqlcxt

Hi all,
After compiling my Pro-c program, while trying to run it I am receving segmentation violation at-

sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn);

The exact error is-

Program received signal SIGSEGV, Segmentation fault.
0x7af99090 in _sigfillset+0x5c0 () from /usr/lib/libc.2


following is the Backtrace of the core file thru gdb-

/opt/langtools/bin/gdb /home/vs9178/cms/bin/edget core
HP gdb 3.2 for PA-RISC 1.1 or 2.0 (narrow), HP-UX 11.00.
Copyright 1986 - 2001 Free Software Foundation, Inc.
Hewlett-Packard Wildebeest 3.2 (based on GDB) is covered by the
GNU General Public License. Type "show copying" to see the conditions to
change it and/or distribute copies. Type "show warranty" for warranty/support.
..
Core was generated by `edget'.
Program terminated with signal 11, Segmentation fault.

warning: The shared libraries were not privately mapped; setting a
breakpoint in a shared library will not work until you rerun the program.

#0 0xc0198090 in _sigfillset+0x5c0 () from /usr/lib/libc.2
(gdb) bt
#0 0xc0198090 in _sigfillset+0x5c0 () from /usr/lib/libc.2
#1 0xc0195bbc in _sscanf+0x68c () from /usr/lib/libc.2
#2 0xc019b294 in malloc+0x18c () from /usr/lib/libc.2
#3 0xcdeb4f6c in sltstidinit+0x18 () from /usr/local/opt/oracle/product/acmdb01d/lib32/libclntsh.sl.9.0
#4 0xcde65774 in lxhLangEnv+0x5c () from /usr/local/opt/oracle/product/acmdb01d/lib32/libclntsh.sl.9.0
#5 0xcde64b74 in lxhnlangid+0x34 () from /usr/local/opt/oracle/product/acmdb01d/lib32/libclntsh.sl.9.0
#6 0xcd679150 in sqgctx+0x2d0 () from /usr/local/opt/oracle/product/acmdb01d/lib32/libclntsh.sl.9.0
#7 0xcd678dcc in sqgrct+0x50 () from /usr/local/opt/oracle/product/acmdb01d/lib32/libclntsh.sl.9.0
#8 0xcd668008 in sqlcmex+0x370 () from /usr/local/opt/oracle/product/acmdb01d/lib32/libclntsh.sl.9.0
#9 0xcd6685cc in sqlcxt+0x78 () from /usr/local/opt/oracle/product/acmdb01d/lib32/libclntsh.sl.9.0
#10 0x2981c in check_out_ok (project=0x40029668 "acm", release=42, dir=0x401d2628 "uc/clf", flnm=0x401d268c "try.c")
at cms_get.c:1994
#11 0x2a174 in edit_one_source (cms_project=0x40029668 "acm", cms_release=42, dir=0x401d2628 "uc/clf",
flnm=0x401d268c "try.c", target_dir=0x400ddd50 "/home/vs1111@\002\362\327\017\017\377", target_flnm=0x400ddd68 "try.c",
mr=5307, cr=1) at cms_get.c:2300
#12 0x2a59c in edget (argc=5, argv=0x7f7f0a34) at cms_get.c:2409
#13 0x56c40 in main (argc=5, argv=0x7f7f0a34) at main.c:145
(gdb) quit


Any help in this regard is highly appreciated.

TIA.
# 2  
Old 08-30-2006
First off, this is usually caused by overwriting the bounds of an array - usually a char array.

Next, the problem "shows" sqlcxt, but it occurs because of your code, most likely at check_out_ok or from an argument passed into check_out_ok.
# 3  
Old 08-30-2006
It's hard to say without seeing the code, but you might be trying to dereference a NULL pointer.
Code:
sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn);

Unless this "sqlcxt" function knows to leave it alone, the "(void **)0" thing is highly abnormal. 0 is NULL, and not an address normal programs have read or write access to, hence the crash when it tries to use it. Box that code in with error checking and find out where that NULL is coming from.
# 4  
Old 09-20-2008
Hi
If am not wrong sqlcxt is a part of the code which has been replaced by the equivalent code for an SQL Query after compiling ur .pc...if thts the case...could u plz post the query whr sqlcxt has occured...
# 5  
Old 01-27-2009
possible solution

Hi,
For me, I was using oracle 9i client (64 bit) on a 64 bit machine and I got the same error - seg fault trying to access a SQL function. I recompiled using 32 bit libraries and it works. You may want to try that if its ok for you to use 32 bit.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Programming

C. To segmentation fault or not to segmentation fault, that is the question.

Oddities with gcc, 2.95.3 for the AMIGA and 4.2.1 for MY current OSX 10.14.1... I am creating a basic calculator for the AMIGA ADE *NIX emulator in C as it does not have one. Below are two very condensed snippets of which I have added the results inside the each code section. IMPORTANT!... (11 Replies)
Discussion started by: wisecracker
11 Replies

2. Homework & Coursework Questions

Segmentation Fault

this is a network programming code to run a rock paper scissors in a client and server. I completed it and it was working without any error. After I added the findWinner function to the server code it starts giving me segmentation fault. -the segmentation fault is fixed Current problem -Also... (3 Replies)
Discussion started by: femchi
3 Replies

3. Programming

Using gdb, ignore beginning segmentation fault until reproduce environment segmentation fault

I use a binary name (ie polo) it gets some parameter , so for debugging normally i do this : i wrote script for watchdog my app (polo) and check every second if it's not running then start it , the problem is , if my app , remain in state of segmentation fault for a while (ie 15 ... (6 Replies)
Discussion started by: pooyair
6 Replies

4. Programming

Segmentation fault in C

i have this code int already_there(char *client_names, char *username) { int i; for(i = 0; i<NUM; i++) { printf("HERE\n"); if (strcmp(client_names, username)==0) return(1); } return(0); } and i get a segmentation fault, whats wrong here? (7 Replies)
Discussion started by: omega666
7 Replies

5. Programming

segmentation fault.

This code is causing a segmentation fault and I can't figure out why. I'm new to UNIX and I need to learn how to avoid this segmentation fault thing. Thank you so much. Thanks also for the great answers to my last post.:):b: int main() { mysqlpp::Connection conn(false); if... (3 Replies)
Discussion started by: sepoto
3 Replies

6. Programming

Segmentation fault.

I'm getting a segmentation fault. I'm new to Linux programming. Thanks so much for all of your input.:eek: #include </usr/include/mysql++/mysql++.h> #include <stdio.h> #include <iostream> #include <sstream> #include <string.h> using namespace std; int outputToImport(const char*... (1 Reply)
Discussion started by: sepoto
1 Replies

7. Programming

segmentation fault

What is segmentation fault(core dumped) (1 Reply)
Discussion started by: gokult
1 Replies

8. Programming

Why not a segmentation fault??

Hi, Why I don't receive a segmentation fault in the following sample. int main(void) { char buff; sprintf(buff,"Hello world"); printf("%s\n",buff); } If I define a buffer of 10 elements and I'm trying to put inside it twelve elements, Should I receive a sigsev... (22 Replies)
Discussion started by: lagigliaivan
22 Replies

9. Linux

Segmentation fault

Hi, on a linux Red HAT(with Oracle DB 9.2.0.7) I have following error : RMAN> delete obsolete; RMAN retention policy will be applied to the command RMAN retention policy is set to redundancy 2 using channel ORA_DISK_1 Segmentation fault What does it mean ? And the solution ? Many thanks. (0 Replies)
Discussion started by: big123456
0 Replies

10. UNIX for Dummies Questions & Answers

Segmentation Fault

hello all, I tried a program on an array to intialise array elements from the standard input device.it is an integer array of 5 elements.but after entering the 4th element it throws a message called "Segmentation Fault" and returns to the command prompt without asking for the 5th element. ... (3 Replies)
Discussion started by: compbug
3 Replies
Login or Register to Ask a Question