IC5Notice: We have upgraded developerWorks Community to the latest version of IBM Connections. For more information, read our upgrade FAQ.
Topic
  • 10 replies
  • Latest Post - ‏2013-12-30T18:27:12Z by v2ksweet
v2ksweet
v2ksweet
6 Posts

Pinned topic Getting Bus error while connecting to DB via embedded C

‏2013-12-19T19:22:58Z |

Team,

I'm compiled my embedded C programs after upgrading to 1150FC4 version. Compilation looks good.  But when executing the exe. It is throwing bus error.. 

Running: cwoprofmenu
(process id 11019)
signal BUS (invalid address alignment) in elf_rtbndr at 0xffffffff7f2055f8
0xffffffff7f2055f8: elf_rtbndr+0x002c:  jmp      %g1
Current function is main
   62           $database heldord;
 

heldord is my database name. Below is the trace log using dbx,

 

(dbx) where
  [1] elf_rtbndr(0x4e5, 0xffffffff7fffdfa8, 0x402, 0xffffffff7e013f20, 0x2, 0xffffffff7fffd9e8), at 0xffffffff7f2055f8
  [2] getcwd(0xffffffff7fffdfa8, 0x402, 0x0, 0xffffffff7e41e028, 0x73, 0xffffffff7fffdfa8), at 0xffffffff7ea00444
  [3] ggetcwd(0xffffffff7fffdfa8, 0x101, 0x0, 0x100, 0x2, 0x100), at 0xffffffff7e013f20
  [4] getPInfo(0x10016f4e0, 0xffffffff7e54dc38, 0xfffffffffffffe6a, 0xffff9c00, 0x0, 0xffffffff7d5c3d98), at 0xffffffff7e41e028
  [5] cmInit(0xffffffff7fffe948, 0xffffffff7fffe8a8, 0x0, 0x131ca8, 0xffff9c00, 0x10016f410), at 0xffffffff7e41bdd4
  [6] asfInit(0xffffffff7fffe948, 0x0, 0xffffffff7fffe8a0, 0x0, 0xffffffff7fffe8a8, 0xffffffff7e54da18), at 0xffffffff7e410ba0
  [7] ASF_Call(0xffffffff7fffe948, 0xffffffff7fffe8a0, 0x6000, 0x0, 0xffffffff7e54da18, 0x6030), at 0xffffffff7e4130e8
  [8] asf_init(0x10014e290, 0x0, 0x275a, 0x100149fb8, 0x10014c712, 0xffffffffffffffff), at 0x10000c478
  [9] sqli_connect_open(0xfffffffffffffe6a, 0x4, 0x0, 0x0, 0x0, 0x0), at 0x10000d7ec
  [10] _sqs_(0x0, 0x10014e290, 0x13a74c, 0x81, 0x0, 0x10014e290), at 0x10000f90c
  [11] sqli_db_open(0x1000495f8, 0x0, 0x10014e290, 0x117f3c, 0x0, 0x0), at 0x1000320f0
=>[12] main(), line 62 in "cwotsmenu.ec"
(dbx) frame 12
Current function is main
   62           $database heldord;
(dbx) frame 11
0x00000001000320f0: sqli_db_open+0x0078:        call     _sqs_  ! 0x10000f848
(dbx)
 

Kindly help on this.

 

  • MaryMuraski
    MaryMuraski
    7 Posts

    Re: Getting Bus error while connecting to DB via embedded C

    ‏2013-12-20T17:51:48Z  

    What version of Client SDK are you using.  I noticed that the version you upgraded to is 11.50.FC4.  Make sure the version of ESQL is also 64 bit version or is installed in a separate directory.

  • v2ksweet
    v2ksweet
    6 Posts

    Re: Getting Bus error while connecting to DB via embedded C

    ‏2013-12-24T14:42:35Z  

    What version of Client SDK are you using.  I noticed that the version you upgraded to is 11.50.FC4.  Make sure the version of ESQL is also 64 bit version or is installed in a separate directory.

    Mary,

     

    $ /dbase/informix/1150FC4.SUNOS10/bin/esql -V
    IBM Informix CSDK Version 3.50, IBM Informix-ESQL Version 3.50.FC4
    Software Serial Number AAA#B000000
    $
     
  • MaryMuraski
    MaryMuraski
    7 Posts

    Re: Getting Bus error while connecting to DB via embedded C

    ‏2013-12-24T15:59:12Z  
    • v2ksweet
    • ‏2013-12-24T14:42:35Z

    Mary,

     

    $ /dbase/informix/1150FC4.SUNOS10/bin/esql -V
    IBM Informix CSDK Version 3.50, IBM Informix-ESQL Version 3.50.FC4
    Software Serial Number AAA#B000000
    $
     

    Can you provide the compilation that was used.  I did find several issues when compiling under Sun Sparc 5.10.  Also is this an actual install and not a virtual image. 

     

    Lets first look at the links used when compiling.

     

    What version of CSDK did you upgrade from, there may be a change there.

     

    If the code is not massive can you provide it here.

  • v2ksweet
    v2ksweet
    6 Posts

    Re: Getting Bus error while connecting to DB via embedded C

    ‏2013-12-24T16:06:11Z  

    Can you provide the compilation that was used.  I did find several issues when compiling under Sun Sparc 5.10.  Also is this an actual install and not a virtual image. 

     

    Lets first look at the links used when compiling.

     

    What version of CSDK did you upgrade from, there may be a change there.

     

    If the code is not massive can you provide it here.

    Mary,

    Below is my make file..

     

    $ cat Makefile2
    CFLAGS =        -I/appl/shots/src/include -I/appl/cwots/source/RDC1/include -I/appl/shots/source/include
    LIBS =  $(SHOTS)/src/lib64/libs/libTools.a /appl/shots/src/lib64/libs/libp2000.a /dbase/informix/1150FC4.SUNOS10/lib/esql/libsql.a
     
    LIB2    =       /appl/shots/src/lib64/libs/libUtil.a
     
    DEFINE =        -DUNIX_PROMPT_USER
     
    DEST = /tmp
     
    ESQL = -I$(INFORMIXDIR)/incl/tools
     
    OBJ = $(CWOTS)/xqt/xqt/obj
     
    DOTC = $(CWOTS)/dotc
     
    all:            trainmenu cwoprofmenu
     
    trainmenu:      $(OBJ)/cwotsmenu.o
                    /export/home/vm157f/esql -g  $(ESQL) $(CFLAGS) -o $(DEST)/trainmenu $(OBJ)/cwotsmenu.o $(LIBS) $(LIB2) -lcurses $(DEFINE)
     
    cwoprofmenu:    $(OBJ)/cwotsmenu.o
                    /export/home/vm157f/esql -g $(ESQL) $(CFLAGS) -o $(DEST)/cwoprofmenu $(OBJ)/cwotsmenu.o $(LIBS) $(LIB2) -lcurses $(DEFINE)
     
    $(OBJ)/cwotsmenu.o:     cwotsmenu.ec
                    /export/home/vm157f/esql -g -c$(ESQL) $(CFLAGS) $(LIBS) $(LIB2) cwotsmenu.ec
                    mv cwotsmenu.o $(OBJ)
    #               mv cwotsmenu.c $(DOTC)
    $
     

     

  • MaryMuraski
    MaryMuraski
    7 Posts

    Re: Getting Bus error while connecting to DB via embedded C

    ‏2013-12-24T17:14:03Z  
    • v2ksweet
    • ‏2013-12-24T16:06:11Z

    Mary,

    Below is my make file..

     

    $ cat Makefile2
    CFLAGS =        -I/appl/shots/src/include -I/appl/cwots/source/RDC1/include -I/appl/shots/source/include
    LIBS =  $(SHOTS)/src/lib64/libs/libTools.a /appl/shots/src/lib64/libs/libp2000.a /dbase/informix/1150FC4.SUNOS10/lib/esql/libsql.a
     
    LIB2    =       /appl/shots/src/lib64/libs/libUtil.a
     
    DEFINE =        -DUNIX_PROMPT_USER
     
    DEST = /tmp
     
    ESQL = -I$(INFORMIXDIR)/incl/tools
     
    OBJ = $(CWOTS)/xqt/xqt/obj
     
    DOTC = $(CWOTS)/dotc
     
    all:            trainmenu cwoprofmenu
     
    trainmenu:      $(OBJ)/cwotsmenu.o
                    /export/home/vm157f/esql -g  $(ESQL) $(CFLAGS) -o $(DEST)/trainmenu $(OBJ)/cwotsmenu.o $(LIBS) $(LIB2) -lcurses $(DEFINE)
     
    cwoprofmenu:    $(OBJ)/cwotsmenu.o
                    /export/home/vm157f/esql -g $(ESQL) $(CFLAGS) -o $(DEST)/cwoprofmenu $(OBJ)/cwotsmenu.o $(LIBS) $(LIB2) -lcurses $(DEFINE)
     
    $(OBJ)/cwotsmenu.o:     cwotsmenu.ec
                    /export/home/vm157f/esql -g -c$(ESQL) $(CFLAGS) $(LIBS) $(LIB2) cwotsmenu.ec
                    mv cwotsmenu.o $(OBJ)
    #               mv cwotsmenu.c $(DOTC)
    $
     

     

    Can you look In the directory where the SDK is installed.  Is there an esql directory under the lib directory. 

     

    From time to time Informix will move the Libraries around.

     

     

  • v2ksweet
    v2ksweet
    6 Posts

    Re: Getting Bus error while connecting to DB via embedded C

    ‏2013-12-24T17:20:06Z  

    Can you look In the directory where the SDK is installed.  Is there an esql directory under the lib directory. 

     

    From time to time Informix will move the Libraries around.

     

     

    Yes. Below are the list files..

     

    -rwxr-xr-x   1 informix informix 2029800 Feb 17  2011 esqlc
    -rw-r--r--   1 informix informix  991320 Feb 17  2011 libthgen.a
    -rwxr-xr-x   3 informix informix  665496 Feb 17  2011 libixgen.so
    -rwxr-xr-x   3 informix informix  665496 Feb 17  2011 libifgen.so
    -rw-r--r--   2 informix informix  944064 Feb 17  2011 libifgen.a
    -rw-r--r--   2 informix informix  944064 Feb 17  2011 libgen.a
    -rwxr-xr-x   3 informix informix  665496 Feb 17  2011 igens09a.so
    -rwxr-xr-x   3 informix informix  712232 Feb 17  2011 libthgen.so
    -rwxr-xr-x   3 informix informix  712232 Feb 17  2011 libtgen.so
    -rwxr-xr-x   3 informix informix  712232 Feb 17  2011 igent09a.so
    -rwxr-xr-x   1 informix informix 1974256 Feb 17  2011 esqlcdb2
    -rw-r--r--   2 informix informix  942192 Feb 17  2011 libdb2ifgen.a
    -rw-r--r--   2 informix informix  942192 Feb 17  2011 libdb2gen.a
    -rw-r--r--   1 informix informix  989376 Feb 17  2011 libdb2thgen.a
    -rwxr-xr-x   3 informix informix  663752 Feb 17  2011 libdb2ixgen.so
    -rwxr-xr-x   3 informix informix  663752 Feb 17  2011 libdb2ifgen.so
    -rwxr-xr-x   3 informix informix  663752 Feb 17  2011 db2igens09a.so
    -rwxr-xr-x   3 informix informix  710480 Feb 17  2011 libdb2thgen.so
    -rwxr-xr-x   3 informix informix  710480 Feb 17  2011 libdb2tgen.so
    -rwxr-xr-x   3 informix informix  710480 Feb 17  2011 db2igent09a.so
    $ pwd
    /dbase/informix/1150FC4.SUNOS10/lib/esql
    $
     
  • MaryMuraski
    MaryMuraski
    7 Posts

    Re: Getting Bus error while connecting to DB via embedded C

    ‏2013-12-24T17:58:42Z  
    • v2ksweet
    • ‏2013-12-24T16:06:11Z

    Mary,

    Below is my make file..

     

    $ cat Makefile2
    CFLAGS =        -I/appl/shots/src/include -I/appl/cwots/source/RDC1/include -I/appl/shots/source/include
    LIBS =  $(SHOTS)/src/lib64/libs/libTools.a /appl/shots/src/lib64/libs/libp2000.a /dbase/informix/1150FC4.SUNOS10/lib/esql/libsql.a
     
    LIB2    =       /appl/shots/src/lib64/libs/libUtil.a
     
    DEFINE =        -DUNIX_PROMPT_USER
     
    DEST = /tmp
     
    ESQL = -I$(INFORMIXDIR)/incl/tools
     
    OBJ = $(CWOTS)/xqt/xqt/obj
     
    DOTC = $(CWOTS)/dotc
     
    all:            trainmenu cwoprofmenu
     
    trainmenu:      $(OBJ)/cwotsmenu.o
                    /export/home/vm157f/esql -g  $(ESQL) $(CFLAGS) -o $(DEST)/trainmenu $(OBJ)/cwotsmenu.o $(LIBS) $(LIB2) -lcurses $(DEFINE)
     
    cwoprofmenu:    $(OBJ)/cwotsmenu.o
                    /export/home/vm157f/esql -g $(ESQL) $(CFLAGS) -o $(DEST)/cwoprofmenu $(OBJ)/cwotsmenu.o $(LIBS) $(LIB2) -lcurses $(DEFINE)
     
    $(OBJ)/cwotsmenu.o:     cwotsmenu.ec
                    /export/home/vm157f/esql -g -c$(ESQL) $(CFLAGS) $(LIBS) $(LIB2) cwotsmenu.ec
                    mv cwotsmenu.o $(OBJ)
    #               mv cwotsmenu.c $(DOTC)
    $
     

     

    Try libifsql.a instead of libsql.a.  I could not find the libsql.a under Informix.

  • v2ksweet
    v2ksweet
    6 Posts

    Re: Getting Bus error while connecting to DB via embedded C

    ‏2013-12-24T18:05:50Z  

    Try libifsql.a instead of libsql.a.  I could not find the libsql.a under Informix.

    Nope. Even after including. It is throwing same error..

     

    $ make -f Makefile2
    /export/home/vm157f/esql -g  -I/dbase/informix/1150FC4.SUNOS10/incl/tools -I/appl/shots/src/include -I/appl/cwots/source/RDC1/include -I/appl/shots/source/include -o /tmp/trainmenu /appl/cwots/xqt/xqt/obj/cwotsmenu.o /appl/shots/src/lib64/libs/libTools.a /appl/shots/src/lib64/libs/libp2000.a /dbase/informix/1150FC4.SUNOS10/lib/esql/libsql.a /dbase/informix/1150FC4.SUNOS10/lib/esql/libifsql.a /appl/shots/src/lib64/libs/libUtil.a -lcurses -DUNIX_PROMPT_USER
    /export/home/vm157f/esql -g -I/dbase/informix/1150FC4.SUNOS10/incl/tools -I/appl/shots/src/include -I/appl/cwots/source/RDC1/include -I/appl/shots/source/include -o /tmp/cwoprofmenu /appl/cwots/xqt/xqt/obj/cwotsmenu.o /appl/shots/src/lib64/libs/libTools.a /appl/shots/src/lib64/libs/libp2000.a /dbase/informix/1150FC4.SUNOS10/lib/esql/libsql.a /dbase/informix/1150FC4.SUNOS10/lib/esql/libifsql.a /appl/shots/src/lib64/libs/libUtil.a -lcurses -DUNIX_PROMPT_USER
    $ rm /appl/cwots/xqt/xqt/obj/cwotsmenu.o
    $ make -f Makefile2
    /export/home/vm157f/esql -g -c-I/dbase/informix/1150FC4.SUNOS10/incl/tools -I/appl/shots/src/include -I/appl/cwots/source/RDC1/include -I/appl/shots/source/include /appl/shots/src/lib64/libs/libTools.a /appl/shots/src/lib64/libs/libp2000.a /dbase/informix/1150FC4.SUNOS10/lib/esql/libsql.a /dbase/informix/1150FC4.SUNOS10/lib/esql/libifsql.a /appl/shots/src/lib64/libs/libUtil.a cwotsmenu.ec
    cc: Warning: option -- passed to ld
    "cwotsmenu.ec", line 77: warning: implicit function declaration: logmsg
    "cwotsmenu.ec", line 119: warning: implicit function declaration: show_msg
    "cwotsmenu.ec", line 175: warning: implicit function declaration: setup_menu
    "cwotsmenu.ec", line 268: warning: implicit function declaration: return_code
    "cwotsmenu.ec", line 488: warning: old-style declaration or incorrect type for: display_sys_util_menu
    "cwotsmenu.ec", line 583: warning: old-style declaration or incorrect type for: setup_menu
    "cwotsmenu.ec", line 588: warning: implicit function declaration: clean_menu
    "cwotsmenu.ec", line 608: warning: old-style declaration or incorrect type for: clean_menu
    "cwotsmenu.ec", line 621: warning: old-style declaration or incorrect type for: show_msg
    "cwotsmenu.ec", line 639: warning: old-style declaration or incorrect type for: return_code
    mv cwotsmenu.o /appl/cwots/xqt/xqt/obj
    /export/home/vm157f/esql -g  -I/dbase/informix/1150FC4.SUNOS10/incl/tools -I/appl/shots/src/include -I/appl/cwots/source/RDC1/include -I/appl/shots/source/include -o /tmp/trainmenu /appl/cwots/xqt/xqt/obj/cwotsmenu.o /appl/shots/src/lib64/libs/libTools.a /appl/shots/src/lib64/libs/libp2000.a /dbase/informix/1150FC4.SUNOS10/lib/esql/libsql.a /dbase/informix/1150FC4.SUNOS10/lib/esql/libifsql.a /appl/shots/src/lib64/libs/libUtil.a -lcurses -DUNIX_PROMPT_USER
    /export/home/vm157f/esql -g -I/dbase/informix/1150FC4.SUNOS10/incl/tools -I/appl/shots/src/include -I/appl/cwots/source/RDC1/include -I/appl/shots/source/include -o /tmp/cwoprofmenu /appl/cwots/xqt/xqt/obj/cwotsmenu.o /appl/shots/src/lib64/libs/libTools.a /appl/shots/src/lib64/libs/libp2000.a /dbase/informix/1150FC4.SUNOS10/lib/esql/libsql.a /dbase/informix/1150FC4.SUNOS10/lib/esql/libifsql.a /appl/shots/src/lib64/libs/libUtil.a -lcurses -DUNIX_PROMPT_USER
     
  • MaryMuraski
    MaryMuraski
    7 Posts

    Re: Getting Bus error while connecting to DB via embedded C

    ‏2013-12-26T13:41:24Z  
    • v2ksweet
    • ‏2013-12-24T18:05:50Z

    Nope. Even after including. It is throwing same error..

     

    $ make -f Makefile2
    /export/home/vm157f/esql -g  -I/dbase/informix/1150FC4.SUNOS10/incl/tools -I/appl/shots/src/include -I/appl/cwots/source/RDC1/include -I/appl/shots/source/include -o /tmp/trainmenu /appl/cwots/xqt/xqt/obj/cwotsmenu.o /appl/shots/src/lib64/libs/libTools.a /appl/shots/src/lib64/libs/libp2000.a /dbase/informix/1150FC4.SUNOS10/lib/esql/libsql.a /dbase/informix/1150FC4.SUNOS10/lib/esql/libifsql.a /appl/shots/src/lib64/libs/libUtil.a -lcurses -DUNIX_PROMPT_USER
    /export/home/vm157f/esql -g -I/dbase/informix/1150FC4.SUNOS10/incl/tools -I/appl/shots/src/include -I/appl/cwots/source/RDC1/include -I/appl/shots/source/include -o /tmp/cwoprofmenu /appl/cwots/xqt/xqt/obj/cwotsmenu.o /appl/shots/src/lib64/libs/libTools.a /appl/shots/src/lib64/libs/libp2000.a /dbase/informix/1150FC4.SUNOS10/lib/esql/libsql.a /dbase/informix/1150FC4.SUNOS10/lib/esql/libifsql.a /appl/shots/src/lib64/libs/libUtil.a -lcurses -DUNIX_PROMPT_USER
    $ rm /appl/cwots/xqt/xqt/obj/cwotsmenu.o
    $ make -f Makefile2
    /export/home/vm157f/esql -g -c-I/dbase/informix/1150FC4.SUNOS10/incl/tools -I/appl/shots/src/include -I/appl/cwots/source/RDC1/include -I/appl/shots/source/include /appl/shots/src/lib64/libs/libTools.a /appl/shots/src/lib64/libs/libp2000.a /dbase/informix/1150FC4.SUNOS10/lib/esql/libsql.a /dbase/informix/1150FC4.SUNOS10/lib/esql/libifsql.a /appl/shots/src/lib64/libs/libUtil.a cwotsmenu.ec
    cc: Warning: option -- passed to ld
    "cwotsmenu.ec", line 77: warning: implicit function declaration: logmsg
    "cwotsmenu.ec", line 119: warning: implicit function declaration: show_msg
    "cwotsmenu.ec", line 175: warning: implicit function declaration: setup_menu
    "cwotsmenu.ec", line 268: warning: implicit function declaration: return_code
    "cwotsmenu.ec", line 488: warning: old-style declaration or incorrect type for: display_sys_util_menu
    "cwotsmenu.ec", line 583: warning: old-style declaration or incorrect type for: setup_menu
    "cwotsmenu.ec", line 588: warning: implicit function declaration: clean_menu
    "cwotsmenu.ec", line 608: warning: old-style declaration or incorrect type for: clean_menu
    "cwotsmenu.ec", line 621: warning: old-style declaration or incorrect type for: show_msg
    "cwotsmenu.ec", line 639: warning: old-style declaration or incorrect type for: return_code
    mv cwotsmenu.o /appl/cwots/xqt/xqt/obj
    /export/home/vm157f/esql -g  -I/dbase/informix/1150FC4.SUNOS10/incl/tools -I/appl/shots/src/include -I/appl/cwots/source/RDC1/include -I/appl/shots/source/include -o /tmp/trainmenu /appl/cwots/xqt/xqt/obj/cwotsmenu.o /appl/shots/src/lib64/libs/libTools.a /appl/shots/src/lib64/libs/libp2000.a /dbase/informix/1150FC4.SUNOS10/lib/esql/libsql.a /dbase/informix/1150FC4.SUNOS10/lib/esql/libifsql.a /appl/shots/src/lib64/libs/libUtil.a -lcurses -DUNIX_PROMPT_USER
    /export/home/vm157f/esql -g -I/dbase/informix/1150FC4.SUNOS10/incl/tools -I/appl/shots/src/include -I/appl/cwots/source/RDC1/include -I/appl/shots/source/include -o /tmp/cwoprofmenu /appl/cwots/xqt/xqt/obj/cwotsmenu.o /appl/shots/src/lib64/libs/libTools.a /appl/shots/src/lib64/libs/libp2000.a /dbase/informix/1150FC4.SUNOS10/lib/esql/libsql.a /dbase/informix/1150FC4.SUNOS10/lib/esql/libifsql.a /appl/shots/src/lib64/libs/libUtil.a -lcurses -DUNIX_PROMPT_USER
     

    Do you have 4GL or SQL installed with the new products.  Also are the 32 bit versions.  Please keep in mind that all version need to be the same, either 32 bit or 64 bit.

  • v2ksweet
    v2ksweet
    6 Posts

    Re: Getting Bus error while connecting to DB via embedded C

    ‏2013-12-30T18:27:12Z  

    Do you have 4GL or SQL installed with the new products.  Also are the 32 bit versions.  Please keep in mind that all version need to be the same, either 32 bit or 64 bit.

    I compiled other set of codes. And it is working fine. Only this code is giving problems..