GNOME Bugzilla – Bug 493360
gda_connection_commit_transaction () crash.
Last modified: 2007-11-07 07:45:58 UTC
Steps to reproduce: 1. open a connection to db. 2. create a transaction with gda_connection_begin_transaction (). 3. insert some data 4. gda_connection_commit_transaction () crash. Stack trace: ** Message: generating new query.... 16 ** Message: elapsed: 0.313483 for (9) [0.034831 per symbol] *** glibc detected *** /home/pescio/svnroot/svninstalled/usr/bin/anjuta: free(): invalid pointer: 0x08607a08 *** Program received signal SIGINT, Interrupt.
+ Trace 175098
Thread NaN (LWP 26311)
Other information: The code where the crash happens is here. gda_connection_begin_transaction (priv->db_connection, NULL, GDA_TRANSACTION_ISOLATION_READ_UNCOMMITTED, NULL); [..] gda_connection_commit_transaction (priv->db_connection, NULL, NULL); You can refer also to http://svn.gnome.org/viewvc/anjuta/trunk/plugins/symbol-db/symbol-db-engine.c?view=markup I had no problems with libgda 3.0.1.
Created attachment 98509 [details] [review] Fixing typo, but probably there's more. Also fixing the typo 'free()' -> 'g_free()' doesn't solve the problem.
It appears that the memory allocated by SQLite should be freed using sqlite3_free() and not free() or g_free(). Once that function is used, it works fine. It probably worked with libgda 3.0.1 because it did not embedd the same SQLite version and recent changes in SQLite have impacted the memory management so this may explain why the bug appreas now only. I'll commit the correction ASAP.
Correction committed, closing the bug.