[Gambas-user] Gambas3: error with ODBC

Benoît Minisini gambas at ...1...
Sun May 30 13:25:17 CEST 2010


> Il giorno lun, 24/05/2010 alle 15.20 +0200, Benoît Minisini ha scritto:
> > > Il giorno ven, 21/05/2010 alle 13.23 +0200, Benoît Minisini ha scritto:
> > > > > Il giorno sab, 15/05/2010 alle 23.13 +0200, Benoît Minisini ha 
scritto:
> > > > > > > Gambas 3, 64 bit version.
> > > > > > > During the connection setup with an ODBC database everything
> > > > > > > goes right, but when I try to exec a query with
> > > > > > > Connectin.Exec, Gambas crashes with #11 error.
> > > > > > 
> > > > > > Can you get a backtrace with gdb? And better get an output of
> > > > > > running your project inside valgrind?
> > > > > 
> > > > > Program received signal SIGSEGV, Segmentation fault.
> > > > > 0x00007ffff722cdfd in free () from /lib/libc.so.6
> > > > 
> > > > That is not very useful!
> > > > 
> > > > Read the "Reporting a problem" page on the web site to see how to get
> > > > a backtrage.
> > > > 
> > > > Regards,
> > > 
> > > Sorry but I'm an intermediate.... I am not the person who has the
> > > error. I'm making the report so I write what I receive ;-)
> > > 
> > > Here is the complete (I hope...) report:
> > > GNU gdb (GDB) 7.1-ubuntu
> > > Copyright (C) 2010 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-linux-gnu".
> > > For bug reporting instructions, please see:
> > > <http://www.gnu.org/software/gdb/bugs/>...
> > > Reading symbols from /usr/local/bin/gbx3...done.
> > > (gdb) set args -p
> > > (gdb) run
> > > Starting program: /usr/local/bin/gbx3 -p
> > > [Thread debugging using libthread_db enabled]
> > > QInotifyFileSystemWatcherEngine::addPaths: inotify_add_watch failed:
> > > Nessun file o directory
> > > [New Thread 0x7fffe9c98710 (LWP 1859)]
> > > QFileSystemWatcher: failed to add paths: /home/paolo/.config/ibus/bus
> > > Bus::open: Can not get ibus-daemon's address.
> > > IBusInputContext::createInputContext: no connection to ibus-daemon
> > > 
> > > Program received signal SIGSEGV, Segmentation fault.
> > > 0x00007ffff722cdfd in free () from /lib/libc.so.6
> > > (gdb) bt
> > > #0  0x00007ffff722cdfd in free () from /lib/libc.so.6
> > > #1  0x0000000000419187 in GB_Free (addr=0x7fffffffc4ec) at
> > > gbx_api.c:1444
> > > #2  0x00007ffff12cefba in my_free (desc=0x9a4510, db=0x9a44c8) at
> > > main.c:117
> > > #3  open_database (desc=0x9a4510, db=0x9a44c8) at main.c:532
> > > #4  0x00007ffff14d75bc in DB_Open (desc=0x9a4510, driver=0x9a44c0,
> > > db=0x9a44c8)
> > > 
> > >     at main.c:209
> > > 
> > > #5  0x00007ffff14d7b45 in open_connection (_object=0x9a44b0)
> > > 
> > >     at CConnection.c:81
> > > 
> > > #6  check_opened (_object=0x9a44b0) at CConnection.c:89
> > > #7  0x00007ffff14d826d in CCONNECTION_exec (_object=0x9a44b0,
> > > _param=0x651db0)
> > > 
> > >     at CConnection.c:432
> > > 
> > > #8  0x0000000000407d7d in EXEC_call_native (exec=0xa56370,
> > > 
> > >     object=0x9a451000a08230, type=140737239627200, param=0x422f0)
> > >     at gbx_exec.c:979
> > > 
> > > #9  0x00000000004089cd in EXEC_native () at gbx_exec.c:1185
> > > #10 0x0000000000429fc1 in EXEC_loop () at gbx_exec_loop.c:982
> > > #11 0x0000000000409521 in EXEC_function_loop () at gbx_exec.c:795
> > > #12 0x00000000004098db in EXEC_function_real () at gbx_exec.c:782
> > > #13 0x0000000000419839 in raise_event (observer=<value optimized out>,
> > > 
> > >     object=<value optimized out>, func_id=<value optimized out>,
> > > 
> > > nparam=271088)
> > > 
> > >     at gbx_api.c:483
> > > 
> > > #14 0x0000000000419fc2 in GB_Raise (object=0x96c9b0,
> > > 
> > >     event_id=<value optimized out>, nparam=0) at gbx_api.c:585
> > > 
> > > #15 0x00007ffff6d4400d in CButton::clicked (this=<value optimized out>)
> > > 
> > >     at CButton.cpp:692
> > > 
> > > #16 0x00007ffff6d43cf2 in CButton::qt_metacall (this=0x7ffff6fa5910,
> > > 
> > >     _c=QMetaObject::InvokeMetaMethod, _id=0, _a=<value optimized out>)
> > >     at CButton_moc.cpp:173
> > > 
> > > #17 0x00007ffff5082e3f in QMetaObject::activate(QObject*, QMetaObject
> > > const*, int, void**) () from /usr/lib/libQtCore.so.4
> > > #18 0x00007ffff5bde5f2 in QAbstractButton::clicked(bool) ()
> > > 
> > >    from /usr/lib/libQtGui.so.4
> > > 
> > > ---Type <return> to continue, or q <return> to quit---
> > > #19 0x00007ffff58f886b in ?? () from /usr/lib/libQtGui.so.4
> > > #20 0x00007ffff58f970b in ?? () from /usr/lib/libQtGui.so.4
> > > #21 0x00007ffff58f997c in
> > > QAbstractButton::mouseReleaseEvent(QMouseEvent*) ()
> > > 
> > >    from /usr/lib/libQtGui.so.4
> > > 
> > > #22 0x00007ffff5599582 in QWidget::event(QEvent*) ()
> > > 
> > >    from /usr/lib/libQtGui.so.4
> > > 
> > > #23 0x00007ffff554322c in QApplicationPrivate::notify_helper(QObject*,
> > > QEvent*)
> > > 
> > >     () from /usr/lib/libQtGui.so.4
> > > 
> > > #24 0x00007ffff5549ecb in QApplication::notify(QObject*, QEvent*) ()
> > > 
> > >    from /usr/lib/libQtGui.so.4
> > > 
> > > #25 0x00007ffff507006c in QCoreApplication::notifyInternal(QObject*,
> > > QEvent*)
> > > 
> > >     () from /usr/lib/libQtCore.so.4
> > > 
> > > #26 0x00007ffff55490ae in QApplicationPrivate::sendMouseEvent(QWidget*,
> > > QMouseEvent*, QWidget*, QWidget*, QWidget**, QPointer<QWidget>&, bool)
> > > ()
> > > 
> > >    from /usr/lib/libQtGui.so.4
> > > 
> > > #27 0x00007ffff55c8f65 in ?? () from /usr/lib/libQtGui.so.4
> > > #28 0x00007ffff55c78ac in QApplication::x11ProcessEvent(_XEvent*) ()
> > > 
> > >    from /usr/lib/libQtGui.so.4
> > > 
> > > #29 0x00007ffff55f4199 in ?? () from /usr/lib/libQtGui.so.4
> > > #30 0x00007ffff506e992 in
> > > QEventLoop::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
> > > from /usr/lib/libQtCore.so.4
> > > #31 0x00007ffff506ed6c in
> > > QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
> > > from /usr/lib/libQtCore.so.4
> > > #32 0x00007ffff5072aab in QCoreApplication::exec() ()
> > > 
> > >    from /usr/lib/libQtCore.so.4
> > > 
> > > #33 0x00007ffff6d3a1cc in hook_loop () at main.cpp:673
> > > #34 0x000000000041ee78 in main (argc=1, argv=<value optimized out>)
> > > 
> > >     at gbx.c:356
> > > 
> > > (gdb)
> > 
> > The database could not be opened, and the crash actually occurs while
> > releasing an ODBC handle before returning the error.
> > 
> > At the moment, I don't know why releasing the handle crashes: I don't
> > know ODBC and didn't write that code.
> > 
> > I need the full project source code: I need to know what database code is
> > executed, in order, to see what has been executed because the offended
> > Exec() call.
> > 
> > Regards,
> 
> My contact said me that it is a little big difficult....
> The code itself is very simple:
> 
> With Connection
>   .Type = "odbc"
>   .Host = "odbc connection name"
>   .User
>   .Password
> End With
> 
> Connectio.Exec("my query") '<-- here is the point where the error is
> raised'
> 
> But using ODBC he should also post a DB (any of the DBs that uses ODBC
> driver) and the configuration files (odbc.ini & odbcinst.ini)... and he
> said me that it is not so easy...
> 
> Does anyone else has tried to connect to a MS-SQL database with Gambas?
> If yes, how does he have resolved such problem?

Can he run his program with valgrind and send me the output?

That way:

$ cd /my/gambas/project
$ valgrind --tool=memcheck --num-callers=50 gbx3
...

He can redirect the valgrind output to a file if needed.

Thanks in advance.

Regards,


-- 
Benoît Minisini




More information about the User mailing list