[Gambas-user] signal SIGSEGV, Segmentation fault when using database example with ODDBC to a MSSQL Database

Benoît Minisini gambas at ...1...
Wed Dec 16 11:56:28 CET 2009


> Problem #11 when using ODBC to connect to a remote database running on MS
> SQL Server 2000.
> 
> 
> 
> I can connect to the database and run queries using tsql from a terminal
>  and isql from a root terminal and I can connect using odbc in Gambas2 if
>  the ide is started from a root terminal but not if started from the
>  programme shortcut.
> 
> 
> 
> I have a small utility to run queries on a SQL server, display the results
> and optionally export them as a csv file. As soon as the programme gets to
> the line where the query is assigned to a Result the programme crashes with
> a #11.  This behaviour is identical if running the Database Sample. The
> connection is opened. connection.opened is True when tested in debug mode.
> The line where the error occurs in the sample is:-
> 
> 
> 
>   rData = $hConn.Exec(txtRequest.Text)
> 
> 
> 
> which is the same as the one in my application where the programme crashes
> 
> 
> 
> PUBLIC SUB FillGrid(ctl AS Control, cnn AS Connection, sqlstr AS String)
> 
>   DIM datout AS Result, i AS Integer, j AS Integer
> 
> 
> 
>       datout = cnn.Exec(sqlstr)   The line the crash occurs
> 
> 
> 
> The version of gambas2 is 2.18.0
> 
> The kernel is Linux 2.6.31.5-127/fc12.x86_64
> 
> System is
> 
>       Memory 3.8 GiB
> 
>       Proc 0 AMD Athlon(tm) X2 Dual Core processor 5200+
> 
>       Proc 1 AMD Athlon(tm) X2 Dual Core processor 5200+
> 
> 
> 
> The query is executed as can be seen from the output from Wireshark
>  included after the debug output.
> 
> 
> 
> Thanks
> 
> 
> 
> Tony
> 
> 
> 
> Debug data and Wireshark output from running the Database Sample Programme.
> 
> 
> 
> [root at ...2341... Database]# cd /usr/share/gambas2/examples/Database/Database
> 
> [root at ...2341... Database]# gbc2 -agt
> 
> OK
> 
> [root at ...2341... Database]# gdb gbx2
> 
> GNU gdb (GDB) Fedora (7.0-8.fc12)
> 
> Copyright (C) 2009 Free Software Foundation, Inc.
> 
> License GPLv3+: GNU GPL version 3 or later
> <http://gnu.org/licenses/gpl.html>
> 
> This is free software: you are free to change and redistribute it.
> 
> There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
> 
> and "show warranty" for details.
> 
> This GDB was configured as "x86_64-redhat-linux-gnu".
> 
> For bug reporting instructions, please see:
> 
> <http://www.gnu.org/software/gdb/bugs/>...
> 
> Reading symbols from /usr/bin/gbx2...(no debugging symbols found)...done.
> 
> Missing separate debuginfos, use: debuginfo-install
> gambas2-runtime-2.18.0-1.fc12.x86_64
> 
> (gdb) set args -p
> 
> (gdb) run
> 
> Starting program: /usr/bin/gbx2 -p
> 
> [Thread debugging using libthread_db enabled]
> 
> 
> 
> Program received signal SIGSEGV, Segmentation fault.
> 
> 0x0000003b3a27978c in free () from /lib64/libc.so.6
> 
> (gdb) bt
> 
> #0  0x0000003b3a27978c in free () from /lib64/libc.so.6
> 
> #1  0x00000000004050f1 in sinh ()
> 
> #2  0x00007fffefe013aa in SQLDisconnect ()
> 
>    from /usr/lib64/gambas2/gb.db.odbc.so
> 
> #3  0x00007fffefe03a28 in ?? () from /usr/lib64/gambas2/gb.db.odbc.so
> 
> #4  0x00007ffff7408da2 in ?? () from /usr/lib64/gambas2/gb.db.so
> 
> #5  0x00007ffff740975f in ?? () from /usr/lib64/gambas2/gb.db.so
> 
> #6  0x00007ffff74063c7 in ?? () from /usr/lib64/gambas2/gb.db.so
> 
> #7  0x0000000000408b32 in sinh ()
> 
> #8  0x000000000040952f in sinh ()
> 
> #9  0x000000000042eea5 in sinh ()
> 
> #10 0x0000000000409cf5 in sinh ()
> 
> #11 0x0000000000409fac in sinh ()
> 
> #12 0x000000000041c4c9 in sinh ()
> 
> #13 0x000000000041ce79 in sinh ()
> 
> #14 0x00007ffff797edca in g_io_channel_unref ()
> 
>    from /usr/lib64/gambas2/gb.gtk.so
> 
> #15 0x000000324020ba8e in g_closure_invoke () from
> /lib64/libgobject-2.0.so.0
> 
> #16 0x0000003240220ec3 in ?? () from /lib64/libgobject-2.0.so.0
> 
> #17 0x0000003240222259 in g_signal_emit_valist ()
> 
>    from /lib64/libgobject-2.0.so.0
> 
> #18 0x00000032402227a3 in g_signal_emit () from /lib64/libgobject-2.0.so.0
> 
> #19 0x000000324468d615 in ?? () from /usr/lib64/libgtk-x11-2.0.so.0
> 
> ---Type <return> to continue, or q <return> to quit---
> 
> #20 0x000000324020ba8e in g_closure_invoke () from
> /lib64/libgobject-2.0.so.0
> 
> #21 0x00000032402207dc in ?? () from /lib64/libgobject-2.0.so.0
> 
> #22 0x0000003240222259 in g_signal_emit_valist ()
> 
>    from /lib64/libgobject-2.0.so.0
> 
> #23 0x00000032402227a3 in g_signal_emit () from /lib64/libgobject-2.0.so.0
> 
> #24 0x000000324468be77 in ?? () from /usr/lib64/libgtk-x11-2.0.so.0
> 
> #25 0x0000003244753903 in ?? () from /usr/lib64/libgtk-x11-2.0.so.0
> 
> #26 0x000000324020ba8e in g_closure_invoke () from
> /lib64/libgobject-2.0.so.0
> 
> #27 0x0000003240220b8d in ?? () from /lib64/libgobject-2.0.so.0
> 
> #28 0x00000032402220ec in g_signal_emit_valist ()
> 
>    from /lib64/libgobject-2.0.so.0
> 
> #29 0x00000032402227a3 in g_signal_emit () from /lib64/libgobject-2.0.so.0
> 
> #30 0x0000003244875a9f in ?? () from /usr/lib64/libgtk-x11-2.0.so.0
> 
> #31 0x000000324474a664 in gtk_propagate_event ()
> 
>    from /usr/lib64/libgtk-x11-2.0.so.0
> 
> #32 0x000000324474b7a3 in gtk_main_do_event ()
> 
>    from /usr/lib64/libgtk-x11-2.0.so.0
> 
> #33 0x00007ffff798c627 in ?? () from /usr/lib64/gambas2/gb.gtk.so
> 
> #34 0x000000324625f7fc in ?? () from /usr/lib64/libgdk-x11-2.0.so.0
> 
> #35 0x000000323fe3922e in g_main_context_dispatch ()
> 
>    from /lib64/libglib-2.0.so.0
> 
> #36 0x000000323fe3cc18 in ?? () from /lib64/libglib-2.0.so.0
> 
> #37 0x000000323fe3cd3a in g_main_context_iteration ()
> 
> ---Type <return> to continue, or q <return> to quit---
> 
>    from /lib64/libglib-2.0.so.0
> 
> #38 0x000000324474bb1d in gtk_main_iteration_do ()
> 
>    from /usr/lib64/libgtk-x11-2.0.so.0
> 
> #39 0x00007ffff798a85a in g_io_channel_unref ()
> 
>    from /usr/lib64/gambas2/gb.gtk.so
> 
> #40 0x00007ffff798aec9 in ?? () from /usr/lib64/gambas2/gb.gtk.so
> 
> #41 0x0000000000422274 in sinh ()
> 
> #42 0x0000003b3a21eb1d in __libc_start_main () from /lib64/libc.so.6
> 
> #43 0x0000000000403a99 in sinh ()
> 
> #44 0x00007fffffffe598 in ?? ()
> 
> #45 0x000000000000001c in ?? ()
> 
> #46 0x0000000000000002 in ?? ()
> 
> #47 0x00000000008548d8 in ?? ()
> 
> #48 0x00007fffffffe80f in ?? ()
> 
> #49 0x0000000000000000 in ?? ()
> 
> 
> 

Can you compile gambas 2 from sources with debugging information enabled? This 
way you will get a useful backtrace that will tell where exactly the program 
fails.

Thanks in advance.

Regards,

-- 
Benoît Minisini




More information about the User mailing list