GNOME Bugzilla – Bug 545979
gda_connection_close() brings to a crash
Last modified: 2008-09-16 17:21:51 UTC
Steps to reproduce: reporting here the bug for a better handling. Gnome-db list was notified some days ago. revision 3186 Stack trace: I got a crash with revision 3186, after a gda connection is used and some prepared statements are compiled inside it: ** Message: SymbolDBPlugin: Dectivating SymbolDBPlugin plugin ... ** ** ERROR:(gda-connection.c:3691):statement_weak_notify_cb: assertion failed: (cnc->priv->prepared_stmts) Program received signal SIGABRT, Aborted.
+ Trace 204423
Thread 3067164352 (LWP 5743)
Other information:
further investigations brought me to think that the problem is in the g_object_unref () for the prepared statements. I think the problem is related to populations threads that mix the statements on a connection with another one. The bug is happening at a random statement unreffing point when an engine is disconnected and the other is still working.
Can you check the problem is still present with revision 3194?
Unfortunately it's still present. ** ERROR:(gda-connection.c:3688):statement_weak_notify_cb: assertion failed: (cnc->priv->prepared_stmts)
(In reply to comment #2) > Can you check the problem is still present with revision 3194? > still present with rev 3204
this bug happens either when I unref the statements before the gda_connection_close () or after. May it be that the statements of a connection are static? They could be overwritten by the ones of another connection. In Anjuta I have this: connection1 -> get connected connection1 -> generate prepared statements connection2 -> get connected connection2 -> generate prepared statements connection1 -> unref statements <-- crash happens -->
ok, I started putting g_message () everywhere on gda-connection.c. What I discovered till now is: while executing the prepared statements the gda_connection_add_prepared_statement () is called many times, but the associated hash_table reaches correctly the size of 41 elements. When I'm gonna unreffing the statements from my program I get correctly something like: prepared_stms_stmt_destroyed_cb () from 41 to 0. Then the strange thing: it does print 5 more statement_weak_notify_cb (): I removed the g_assert () replacing it with a debug_message which increase its counter. What may happen? Probably more objects than necessary are wrongly unreffed. Still don't know where it happen anyway.
Can you try with rev#3205 as I've corrected at least one problem which was that in a g_hash_table_foreach() I was removing items from the hash table which is not allowed (once I read the doc...)?
(In reply to comment #7) > Can you try with rev#3205 as I've corrected at least one problem which was that > in a g_hash_table_foreach() I was removing items from the hash table which is > not allowed (once I read the doc...)? > hey it works! it doesn't crash anymore and no warning messages are displayed. Yes you cannot touch hash_table elements while iterating it with foreach (). thanks, Massimo
Great, so I'm closing the bug!