Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.misc -> core dump with program compiled with pro*c

core dump with program compiled with pro*c

From: Leon T <lstjr_at_concentric.net>
Date: 1998/02/13
Message-ID: <34E46F61.A405B93B@concentric.net>

I'm running oracle 7.3.3 on a sun solaris platform. I get a core dump when attempting to execute a simple program to connect to and disconnect

from the oracle database. When looking at the generated c-code, it appears that I crash during the connect statement. ( sqlcxt((void **)0, &sqlctx, &sqlstm, &sqlfpn); )

I also tried using the proc.mk makefile to compile my program but I still core dump. I'm also core dump when trying to compile and run the sample programs. The following source code, makefile, and output follows.

Thanks,
Leon T.
lstjr_at_concentric.net

/* lttest.pc */

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sqlca.h>

void sqlerror(void)
{
  printf("oracle error...\n");
  exit (-1);
}

int main(void)
{
  exec sql begin declare section;
    char db_conn[30];
  exec sql end declare section;

  printf("\nbegin program\n");
  strcpy(db_conn, "tempuser/tiger");

  printf("setting up sql whenever\n");
  exec sql whenever sqlerror do sqlerror();

  printf("connecting with string: %s\n", db_conn);   exec sql connect :db_conn;

  printf("closing connection\n");
  exec sql commit work release;

  return 0;
}
/* end lttest.pc */

/* proc.mk */
include $(ORACLE_HOME)/precomp/env_precomp.mk

.SUFFIXES: .pc .c .o

LDSTRING=
PRODUCT_LIBHOME=
MAKEFILE=proc.mk
PROCPLSFLAGS= sqlcheck=full userid=$(USERID) dbms=v6_char PROCPPFLAGS= code=cpp $(CCPSYSINCLUDE)
USERID=t21609/pmdev
INCLUDE=$(I_SYM). $(PRECOMPPUBLIC) SAMPLES=sample1 sample2 sample3 sample4 sample6 sample7 sample8 \

        sample9 sample10 sample11 sample12 oraca sqlvcp cv_demo \  lttest

CPPSAMPLES=cppdemo1 cppdemo2 cppdemo3

# Rule to compile any program (specify EXE= and OBJS= on command line)

build: $(OBJS)

$(CC) -o $(EXE) $(OBJS) -L$(LIBHOME) $(PROLDLIBS)

cppbuild:

$(PROC) $(PROCPPFLAGS) iname=$(EXE)
$(CCP) -c $(INCLUDE) $(EXE).c
$(CCP) -o $(EXE) $(OBJS) -L$(LIBHOME) $(PROLDLIBS)

samples: $(SAMPLES)
cppsamples: $(CPPSAMPLES)

$(SAMPLES):
$(MAKE) -f $(MAKEFILE) build OBJS=$@.o EXE=$@

$(CPPSAMPLES):
$(MAKE) -f $(MAKEFILE) cppbuild OBJS=$@.o EXE=$@

sample5:

        @echo 'sample5 is a user-exit demo; use a forms makefile to build it.'

.pc.c:

        @echo procflags 1  -  $(PROCFLAGS)

$(PROC) $(PROCFLAGS) iname=$*.pc
.pc.o: @echo procplsflags 2 - $(PROCPLSFLAGS)
$(PROC) $(PROCPLSFLAGS) iname=$*.pc
$(CC) $(CFLAGS) -c $*.c
.c.o:
$(CC) $(CFLAGS) -c $*.c
sample6.o: sample6.pc
$(PROC) dbms=v6_char iname=$*.pc
$(CC) $(CFLAGS) $(PRECOMPPUBLIC) -c $*.c
sample9.o: sample9.pc calldemo-sql
$(PROC) $(PROCPLSFLAGS) iname=$*.pc
$(CC) $(CFLAGS) $(PRECOMPPUBLIC) -c $*.c
cv_demo.o: cv_demo.pc cv_demo-sql
$(PROC) $(PROCPLSFLAGS) iname=$*.pc
$(CC) $(CFLAGS) $(PRECOMPPUBLIC) -c $*.c
sample11.o: sample11.pc sample11-sql
$(PROC) $(PROCPLSFLAGS) iname=$*.pc dbms=v6
$(CC) $(CFLAGS) $(PRECOMPPUBLIC) -c $*.c
calldemo-sql: sqlplus scott/tiger @../sql/calldemo </dev/null sample11-sql: sqlplus scott/tiger @../sql/sample11 </dev/null cv_demo-sql: sqlplus scott/tiger @../sql/cv_demo </dev/null

/* end proc.mk */

/* output */
dev_at_t51779=> lttest

begin program
setting up sql whenever
connecting with string: tempuser/tiger
Segmentation Fault(coredump)

/* end output */

--
Received on Fri Feb 13 1998 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US