[comp.lang.c] Oracle and C code problem

news@cca.PUE.UDLAP.MX (12/05/90)

	Hi !

	I have this problem: I'm using SunOS 4.1 and its
/usr/5bin/cc compiler. I have an oracle xxx.pc program and
inside the program I have this code:

 printf("%s\n ",uid.arr);
      EXEC SQL WHENEVER SQLERROR GOTO errexit; 
        printf("%s\n","ya ya");
        EXEC SQL CONNECT :uid IDENTIFIED BY :pwd;
 
      printf("Lista: %d", sizeof(struct list));
        printf("Arbol: %d", sizeof(struct tree)); 

The problem is that when I compile the program in a SparcStation 1
the executable runs ok in a SparcServer390, but in the SparcStation
it does not !!! I get a message like "Illegal Instruction (core
dumped) ".

	Is there anybody with some insight for me?

	Any help will be appreciated ....
-----------------------------------------------------
Sergio Picazo
internet	tesis@cca.pue.udlap.mx
----------------------------------------------------

cdm@gem-hy.Berkeley.EDU (Dale Cook) (12/06/90)

In article <1990Dec5.153358.7720@cca.PUE.UDLAP.MX>,
news@cca.PUE.UDLAP.MX writes:
|> 
|> 	Hi !
|> 
|> 	I have this problem: I'm using SunOS 4.1 and its
|> /usr/5bin/cc compiler. I have an oracle xxx.pc program and
|> inside the program I have this code:
|> 
|>  printf("%s\n ",uid.arr);
|>       EXEC SQL WHENEVER SQLERROR GOTO errexit; 
|>         printf("%s\n","ya ya");
|>         EXEC SQL CONNECT :uid IDENTIFIED BY :pwd;
|>  
|>       printf("Lista: %d", sizeof(struct list));
|>         printf("Arbol: %d", sizeof(struct tree)); 
|> 
|> The problem is that when I compile the program in a SparcStation 1
|> the executable runs ok in a SparcServer390, but in the SparcStation
|> it does not !!! I get a message like "Illegal Instruction (core
|> dumped) ".
|> 
|> 	Is there anybody with some insight for me?
|> 
|> 	Any help will be appreciated ....
|> -----------------------------------------------------
|> Sergio Picazo
|> internet	tesis@cca.pue.udlap.mx
|> ----------------------------------------------------

This is probably better suited to comp.databases (note the followup-to).

We ran into a similar problem in our VAXstation/ULTRIX environment.  We
eventually isolated the problem to BIND.  Find out if the environment
where your code fails is also using BIND.  If so, I don't think it will
work there.

----------------------------------------------------------------------
--- Dale Cook     cdm@inel.gov
   
----------------------------------------------------------------------
 
========== long legal disclaimer follows, press n to skip ===========
^L
Neither the United States Government or the Idaho National Engineering
Laboratory or any of their employees, makes any warranty, whatsoever,
implied, or assumes any legal liability or responsibility regarding any
information, disclosed, or represents that its use would not infringe
privately owned rights.  No specific reference constitutes or implies
endorsement, recommendation, or favoring by the United States
Government or the Idaho National Engineering Laboratory.  The views and
opinions expressed herein do not necessarily reflect those of the
United States Government or the Idaho National Engineering Laboratory,
and shall not be used for advertising or product endorsement purposes.

gwyn@smoke.brl.mil (Doug Gwyn) (12/07/90)

In article <1990Dec5.153358.7720@cca.PUE.UDLAP.MX> news@cca.PUE.UDLAP.MX writes:
>	Is there anybody with some insight for me?

(1) Use the debugger; that's what it's there for.
(2) Perhaps sizeof() returns unsigned long int, not signed int as the
code assumes.