After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 582962 - Sqlite3.vapi: Using the out errmsg parameter of get_table makes program crash
Sqlite3.vapi: Using the out errmsg parameter of get_table makes program crash
Status: RESOLVED DUPLICATE of bug 579364
Product: vala
Classification: Core
Component: Bindings
0.7.x
Other All
: Normal critical
: ---
Assigned To: Vala maintainers
Vala maintainers
Depends on:
Blocks:
 
 
Reported: 2009-05-17 17:48 UTC by Jens Georg
Modified: 2009-05-17 18:02 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
test program (603 bytes, text/x-vala)
2009-05-17 17:49 UTC, Jens Georg
Details

Description Jens Georg 2009-05-17 17:48:26 UTC
Please describe the problem:
If you use the out errmsg parameter of Database.get_table the compiled program crashes. It seems that the string needs to be freed with sqlite3_free instead of g_free

Steps to reproduce:
1. Compile attached program
2. Run it



Actual results:
*** glibc detected *** /home/jens/tc-09: free(): invalid pointer: 0x09e3cb40 ***
======= Backtrace: =========
/lib/tls/i686/cmov/libc.so.6[0xb7dab604]
/lib/tls/i686/cmov/libc.so.6(cfree+0x96)[0xb7dad5b6]
/opt/gnome2/lib/libglib-2.0.so.0(g_free+0x36)[0xb7f6ad46]
/home/jens/tc-09[0x8048c9a]
/home/jens/tc-09[0x8048cfd]
/lib/tls/i686/cmov/libc.so.6(__libc_start_main+0xe5)[0xb7d52775]
/home/jens/tc-09[0x8048ad1]


Expected results:
do not crash

Does this happen every time?
yes

Other information:
I have no idea it it's better to use a weak string in the binding and make the developer use the Sqlite's free function explicitly or have a seperate string class for this.
Comment 1 Jens Georg 2009-05-17 17:49:58 UTC
Created attachment 134823 [details]
test program
Comment 2 Jens Georg 2009-05-17 18:02:20 UTC

*** This bug has been marked as a duplicate of 579364 ***