OCI Q

From: Howard Ship <hship_at_sw.stratus.com>
Date: 7 Jul 1993 18:27:19 GMT
Message-ID: <21f4i7$o6d_at_transfer.stratus.com>


Having found the pre-processor too limiting, I've moved onto the OCI. I'm on a sun 4, running Oracle 6.

Here's some code ...

typedef struct {

  short			v2rc;		/* v2 return code */
  unsigned char		fill1[10];
  unsigned short 	rc;		/* return code */
  unsigned char		fill2[19];
  unsigned char		ose[4];		/* OS dependent error code */
  unsigned char		chk;		/* check byte */
  unsigned char		sysparm[26];	/* private, system parameters */
} Ldadef;

typedef char Hdadef[256];

int
orlon (Ldadef *, char *, char *, int, char *, int, int);

#define sqlLogon(lda, hda, userId) \

  orlon (lda, hda, userId, -1, (char *) -1, -1, 0)

/* idbConnect

   Connects to the Oracle database. Where should be a string    specifying the connection (user name, password and network info). */

void
idbConnect (char *userId)
{
  static Hdadef hda;

  if (sqlLogon (&lda, hda, userId)) {
    cssNote ("Unable to connect to Oracle (%s).", userId);     return;
  } /* if */

  if (cssDebugMode)
    cssNote ("Connected to ORACLE as: %s", userId);

/* Create a buffer used to hold text atoms. */

  textAtomBuffer = cssBufferCreate (DEFAULT_BUFFER_SIZE);

} /* idbConnect */

... and here's a stack trace:

Program received signal 10, Bus error
0x263d0 in osncon ()
(gdb) bt
#0 0x263d0 in osncon ()
#1 0x24260 in upiini ()
#2 0x2024c in upiahs ()
#3 0x1fa3c in upilam ()
#4 0x1f994 in upilon ()
#5 0x1d7d8 in ocirlo ()
#6 0xa190 in idbConnect (userId=0x99a0 "hship/hship_at_t:krusty:issue") at issuedbc.c:108
#7 0x9a50 in iConnect (argc=1, argv=0xf7fff808) at mothraIssue.c:23
#8 0x4ce0 in snakeProcess (buffer=0xf7fff920 "connect") at snake.c:942
#9 0x3360 in main (argc=2, argv=0xf7fffac4) at mothra.c:447

Any clues or tips here? Did anyone notice how evil Oracle is (trying to put a 32-bit integer on an odd byte boundary in the ldadef? "every byte is sacred ..."

-- 
"Rice Chex!! Wheat Chex!! Rice Chex!! Wheat Chex!!"
Howard_Ship_at_vos.stratus.com
Received on Wed Jul 07 1993 - 20:27:19 CEST

Original text of this message