Results 1 to 7 of 7
  1. #1
    Join Date
    Aug 2013
    Posts
    3

    Unanswered: Segmentation fault on db2 express c on linux

    Hi folks,

    We are trying to execute the stored procedure (SQC) on db2 express c edition (v10.1) installed on Ubuntu 13.04.
    But however we are facing segmentation fault (signal 11). We are quite sure about the working of stored procs as they were working fine on AIX operating system

    But after compiling them on linux, using gcc compiler and making them shared library, calling them results into segfault.

    Stack trace for the error is given below
    Code:
    0x00007FC3D5670D2A _Z25ossDumpStackTraceInternalmR11OSSTrapFileiP7siginfoPvmm + 0x020a
            (/home/db2inst2/sqllib/lib64/libdb2osse.so.1)
    	0x00007FC3D5670ABB ossDumpStackTraceV98 + 0x002b
            (/home/db2inst2/sqllib/lib64/libdb2osse.so.1)
    	0x00007FC3D566B9E3 _ZN11OSSTrapFile6dumpExEmiP7siginfoPvm + 0x0103
            (/home/db2inst2/sqllib/lib64/libdb2osse.so.1)
    	0x00007FC3D699A7A7 sqlo_trce + 0x0407
            (/home/db2inst2/sqllib/lib64/libdb2.so.1)
    	0x00007FC3D699B2CC sqlo_dari_trca + 0x00bc
            (/home/db2inst2/sqllib/lib64/libdb2.so.1)
    	0x00007FC3D521ECB0 address: 0x00007FC3D521ECB0 ; dladdress: 0x00007FC3D520F000 ; offset in lib: 0x000000000000FCB0 ;
            (/lib/x86_64-linux-gnu/libpthread.so.0)

    The stored procedure are compiled on AIX using the following command:

    Code:
    xlC_r7 -q64 -o <sqc-name> <sqc-name>.o -ldb2 -L<db2-dir>/lib64 -H512  -T512  –bE:<sqc-name>.exp  -e <sqc-name> -qinitauto=00
    Does anyone know an equivalent compilation for the above command on linux and gcc.

    (I am not sure if this question is relevant for this forum. But in case if anyone knows the answer please help me.)

    Thanks,
    ~Mandar

  2. #2
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    do not forget about the books : maybe this link can help
    Linux C routine compile and link options
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  3. #3
    Join Date
    Apr 2012
    Posts
    1,035
    Provided Answers: 18
    Also see the Linux build options in the IBM samples located on your DB2 server in
    (default)
    /opt/ibm/db2/V10.1/samples/c
    the file bldrdn and related files may help...

  4. #4
    Join Date
    Aug 2013
    Posts
    3
    Thanks prytula_guy and db2mor for your response

    I tried every compilation flags, but no luck. It still creates the same dump.

    Is it because I am using db2 express c edition? Coz I executed these SQC file on DB2 10.1 AIX.

    Thanks,
    ~mandy13

  5. #5
    Join Date
    Apr 2006
    Location
    Belgium
    Posts
    2,514
    Provided Answers: 11
    the answers are very confusing
    can you describe the complete scenario.. do not mix files from one environment with another.. keep them isolated..
    Best Regards, Guy Przytula
    Database Software Consultant
    Good DBAs are not formed in a week or a month. They are created little by little, day by day. Protracted and patient effort is needed to develop good DBAs.
    Spoon feeding : To treat (another) in a way that discourages independent thought or action, as by overindulgence.
    DB2 UDB LUW Certified V7-V8-V9-V9.7-V10.1-V10.5 DB Admin - Advanced DBA -Dprop..
    Information Server Datastage Certified
    http://www.infocura.be

  6. #6
    Join Date
    Aug 2013
    Posts
    3
    We have a SQC file which we compiled on AIX using xlc_r7 compiler and made a shared library out of it. The shared library worked fine on AIX.

    But when we compiled the same SQC file on linux using gcc, made a shared library of it and tried to call it, at that time it didn't work on linux, giving segmentation fault.

    In other words i am trying to migrate stored procedures (SQC files) from AIX to linux.

    Thanks,
    ~mandy13

  7. #7
    Join Date
    Apr 2012
    Posts
    1,035
    Provided Answers: 18
    You could try some eliimination, and failing that, then some debugging.


    Can you get IBM's own sample SQC files compiled and running on the Linux?
    (that is to say, if IBM's example code also gives sigsegv then the problem does not lie in your SQC file, but instead something in the environment maybe).

    If IBMs example SQC files compile and run properly, the next elimination is your code. So you need some debugging skils, although this is normally the job for a developer with 'c' skills.

    Find out how far your code (in the sqc file) actually runs. Use statement monitoring (or other tool) to watch which SQL runs, to narrow down the area of code that's causing the sigsegv. If the SQC file has any built-in debugging capabilities (such as writing a trace file), then activate those , to see once again if you can narrow down the problem to the line of code causing the sigsegv.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •