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 493360 - gda_connection_commit_transaction () crash.
gda_connection_commit_transaction () crash.
Status: RESOLVED FIXED
Product: libgda
Classification: Other
Component: SQLite provider
3.1.x
Other All
: Normal critical
: ---
Assigned To: malerba
gnome-db Maintainers
Depends on:
Blocks:
 
 
Reported: 2007-11-04 13:36 UTC by Massimo Cora'
Modified: 2007-11-07 07:45 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Fixing typo, but probably there's more. (480 bytes, patch)
2007-11-04 13:38 UTC, Massimo Cora'
none Details | Review

Description Massimo Cora' 2007-11-04 13:36:54 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.

Thread NaN (LWP 26311)

  • #0 __lll_mutex_lock_wait
    from /lib/libc.so.6
  • #1 _L_lock_14621
    from /lib/libc.so.6
  • #2 free
    from /lib/libc.so.6
  • #3 _dl_map_object_deps
    from /lib/ld-linux.so.2
  • #4 dl_open_worker
    from /lib/ld-linux.so.2
  • #5 _dl_catch_error
    from /lib/ld-linux.so.2
  • #6 _dl_open
    from /lib/ld-linux.so.2
  • #7 do_dlopen
    from /lib/libc.so.6
  • #8 _dl_catch_error
    from /lib/ld-linux.so.2
  • #9 __libc_dlopen_mode
    from /lib/libc.so.6
  • #10 init
    from /lib/libc.so.6
  • #11 pthread_once
    from /lib/libpthread.so.0
  • #12 backtrace
    from /lib/libc.so.6
  • #13 __libc_message
    from /lib/libc.so.6
  • #14 _int_free
    from /lib/libc.so.6
  • #15 free
    from /lib/libc.so.6
  • #16 g_free
    from /usr//lib/libglib-2.0.so.0
  • #17 gda_sqlite_provider_single_command
    at gda-sqlite-provider.c line 1464
  • #18 gda_sqlite_provider_commit_transaction
    at gda-sqlite-provider.c line 1403
  • #19 gda_server_provider_commit_transaction
  • #20 gda_connection_commit_transaction
    at gda-connection.c line 1438
  • #21 sdb_engine_populate_db_by_tags
    at symbol-db-engine.c line 756
  • #22 sdb_engine_ctags_output_callback_1
    at symbol-db-engine.c line 826
  • #23 anjuta_launcher_buffered_output
    at anjuta-launcher.c line 721
  • #24 anjuta_launcher_scan_output
    at anjuta-launcher.c line 745
  • #25 ??
    from /usr//lib/libglib-2.0.so.0
  • #26 ??
  • #27 ??
  • #28 ??
  • #29 ??
    from /usr//lib/libglib-2.0.so.0
  • #30 ??
    from /lib/libpthread.so.0
  • #31 ??
  • #32 ??
  • #33 g_main_context_dispatch
    from /usr//lib/libglib-2.0.so.0


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.
Comment 1 Massimo Cora' 2007-11-04 13:38:31 UTC
Created attachment 98509 [details] [review]
Fixing typo, but probably there's more.

Also fixing the typo 'free()' -> 'g_free()' doesn't solve the problem.
Comment 2 malerba 2007-11-06 10:59:36 UTC
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.
Comment 3 malerba 2007-11-07 07:45:58 UTC
Correction committed, closing the bug.