Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.misc -> Re: "Bus Error" while running OCI programs
rohit_at_techapp.com wrote:
>
> Hi,
>
> I am facing a strange problem ..I'm trying to compile an OCI program using
> gcc. When I try to run it ..is executes all the calls (at least appears
> to ..) but exits with a 'Bus Error' message ..
>
> Has anybody else faced this problem before. I'd greatly appreciate any
> help..
>
> I'm attaching the src for the small program I'm trying to run..
> ====================================================================
> #include <stdio.h>
> #include <stdlib.h>
> #include <ctype.h>
> #include <string.h>
> #include "oratypes.h"
>
> /* LDA and CDA struct declarations */
> #include <ocidfn.h>
> #ifndef __STDC__
> #include <ociapr.h>
> #else
> #include <ocikpr.h>
> #endif
>
> /* demo constants and structs */
> #include "ocidem.h"
>
> /* oparse flags */
> #define DEFER_PARSE 1
> #define NATIVE 1
> #define VERSION_7 2
>
> char sql_statement[80] = "SELECT last_name, first_name, user_id FROM
> Customers";
> /* Define a LDA, a HDA, and a cursor */
>
> Lda_Def lda;
> ub4 hda[HDA_SIZE/4];
>
> main()
> {
> memset(hda,'\0',HDA_SIZE);
>
> /* Connect to ORACLE and open the cursor */
> printf("Starting program \n"); fflush(stdout);
>
> if (olog(&lda, hda, "IPAC", -1, "IPAC", -1,(text *) 0, -1, OCI_LM_DEF))
> { printf("\nError: Unable to connect to ORACLE\n"); fflush(stdout);
> exit(1); } printf("\nConnected to ORACLE \n"); fflush(stdout);
>
> if (ologof(&lda))
> {
> printf("\nError : Error on disconnect\n");
> exit(1);
> }
> printf("\nDisconnected from database\n");
> }
> =====================================================================
>
> Thanks a ton in advance
>
> - Rohit
>
> -------------------==== Posted via Deja News ====-----------------------
> http://www.dejanews.com/ Search, Read, Post to Usenet
Hi,
"bus-Error" means your program tries to read or write at an memory-location that isn't part of the programms workspace. This occures in cases where pointers aren't initialized so that they point to a valid adress in memory.
-- Regards M.Gresz :-)Received on Tue Nov 04 1997 - 00:00:00 CST
![]() |
![]() |