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 154108 - Crash on startup with new read-only code
Crash on startup with new read-only code
Status: RESOLVED FIXED
Product: rhythmbox
Classification: Other
Component: general
HEAD
Other Linux
: High major
: ---
Assigned To: RhythmBox Maintainers
RhythmBox Maintainers
Depends on:
Blocks:
 
 
Reported: 2004-09-29 21:41 UTC by Bastien Nocera
Modified: 2005-06-12 18:11 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Patch from my playbin branch (19.25 KB, patch)
2005-06-08 07:46 UTC, Christophe Fergeau
none Details | Review

Description Bastien Nocera 2004-09-29 21:41:05 UTC
Crashes on a good song:
[0x8f058d8] [rhythmdb_process_events] rhythmdb.c:1250 (22:34:53): processing
RHYTHMDB_EVENT_STAT
[0x8f058d8] [rhythmdb_process_stat_event] rhythmdb.c:1127 (22:34:53): not
modified:
file:///home/data/Music/Albums/Franz%20Ferdinand%20-%20Franz%20Ferdinand/01.%20Franz%20Ferdinand%20-%20Jacqueline.mp3
                                                                                
RhythmDB-ERROR **: file rhythmdb.c: line 1715 (rhythmdb_entry_set): assertion
failed: (rhythmdb_get_readonly (db) == FALSE)
aborting...

Here's the bt:
  • #0 _dl_sysinfo_int80
    from /lib/ld-linux.so.2
  • #1 raise
    from /lib/tls/libc.so.6
  • #2 abort
    from /lib/tls/libc.so.6
  • #3 g_logv
    from /usr//lib/libglib-2.0.so.0
  • #4 g_log
    from /usr//lib/libglib-2.0.so.0
  • #5 rhythmdb_entry_set
    at rhythmdb.c line 1729
  • #6 rhythmdb_entry_set_mount_point
    at rhythmdb.c line 2656
  • #7 rhythmdb_process_stat_event
    at rhythmdb.c line 1134
  • #8 rhythmdb_process_events
    at rhythmdb.c line 1251
  • #9 rhythmdb_idle_poll_events
    at rhythmdb.c line 1313
  • #10 g_child_watch_add
    from /usr//lib/libglib-2.0.so.0
  • #11 g_main_depth
    from /usr//lib/libglib-2.0.so.0
  • #12 g_main_context_dispatch
    from /usr//lib/libglib-2.0.so.0
  • #13 g_main_context_dispatch
    from /usr//lib/libglib-2.0.so.0
  • #14 g_main_loop_run
    from /usr//lib/libglib-2.0.so.0
  • #15 bonobo_main
    from /usr//lib/libbonobo-2.so.0
  • #16 main
    at main.c line 267

Comment 1 Bastien Nocera 2004-09-29 21:54:57 UTC
It's trying to change the mount-point property during the initial load, and
actually crashing in the "rhythmdb_get_readonly (db) == FALSE" assert (not later
as gdb says).
Comment 2 Bastien Nocera 2005-06-07 23:14:17 UTC
Still occurs with current CVS HEAD, it's trying to update the "last seen" entry
this time:
  • #0 _dl_sysinfo_int80
    from /lib/ld-linux.so.2
  • #1 raise
    from /lib/tls/libc.so.6
  • #2 abort
    from /lib/tls/libc.so.6
  • #3 IA__g_logv
  • #4 IA__g_log
    at gmessages.c line 512
  • #5 IA__g_assert_warning
  • #6 rhythmdb_entry_set
    at rhythmdb.c line 1815
  • #7 rhythmdb_process_stat_event
    at rhythmdb.c line 1213
  • #8 rhythmdb_process_events
    at rhythmdb.c line 1351
  • #9 rhythmdb_idle_poll_events
    at rhythmdb.c line 1413
  • #10 g_idle_dispatch
    at gmain.c line 3821
  • #11 IA__g_main_context_dispatch
    at gmain.c line 1947
  • #12 g_main_context_iterate
    at gmain.c line 2578
  • #13 IA__g_main_loop_run
    at gmain.c line 2782
  • #14 bonobo_main
    from /usr//lib/libbonobo-2.so.0
  • #15 main
    at main.c line 267

Comment 3 Bastien Nocera 2005-06-07 23:19:12 UTC
More interesting is what the second thread is doing:
  • #0 _dl_sysinfo_int80
    from /lib/ld-linux.so.2
  • #1 __old__lxstat64
    from /lib/tls/libc.so.6
  • #2 get_stat_info
    at stat.h line 373
  • #3 do_get_file_info
    at file-method.c line 914
  • #4 gnome_vfs_get_file_info_uri_cancellable
    at gnome-vfs-cancellable-ops.c line 194
  • #5 gnome_vfs_get_file_info_uri
    at gnome-vfs-ops.c line 314
  • #6 gnome_vfs_get_file_info
    at gnome-vfs-ops.c line 290
  • #7 rb_uri_resolve_symlink
    at rb-file-helpers.c line 119
  • #8 rhythmdb_execute_stat
    at rhythmdb.c line 1496
  • #9 action_thread_main
    at rhythmdb.c line 1590
  • #10 g_thread_create_proxy
    at gthread.c line 561
  • #11 start_thread
    from /lib/tls/libpthread.so.0
  • #12 clone
    from /lib/tls/libc.so.6

Comment 4 Bastien Nocera 2005-06-07 23:44:15 UTC
From the original crashing thread:
(gdb) frame 6
  • #6 rhythmdb_entry_set
    at rhythmdb.c line 1815
$1 = (RhythmDBEntry *) 0x860e620
(gdb) p entry->location
$2 = 0x860f8a8
"file:///home/hadess/Desktop/data/Music/Albums/Gorillaz%20-%20G%20Sides/02.%20Gorillaz%20-%20Dracula.mp3"

We're not even processing the same file.

I've pushed a small fix that might do something:
        * rhythmdb/rhythmdb.c: (rhythmdb_save_thread_main):
        send a RHYTHMDB_EVENT_DB_SAVED event even if we don't have to save
        the database, otherwise the read counter doesn't get decreased
Comment 5 Christophe Fergeau 2005-06-08 06:54:38 UTC
I think there's a fix in my playbin branch which I haven't pushed anywhere else,
I'll have to check that.
Comment 6 Christophe Fergeau 2005-06-08 07:46:23 UTC
Created attachment 47414 [details] [review]
Patch from my playbin branch
Comment 7 Christophe Fergeau 2005-06-08 07:50:44 UTC
What this patch does is to make sure that the database is always modified from
the main thread, and it also makes sure the database isn't read-only before
modifying it. It queues database changes to be able to process them later if the
database is read-only. This patch fixes the startup crashes as far as I could
see, however I have seen a few big slowdowns at startup with it applied but I
didn't really dig further to try to figure out what was going on (from the
console trace, it seemed lots of stuff was being queued to be processed later,
but I dunno why it happened nor why it slowed things down).
Comment 8 Bastien Nocera 2005-06-12 18:11:12 UTC
2005-06-12  Christophe Fergeau  <teuf@gnome.org>

        * lib/rb-util.c: (rb_is_main_thread), (rb_threads_init):
        * lib/rb-util.h:
        * rhythmdb/rhythmdb.c: (rhythmdb_event_free), (rhythmdb_shutdown),
        (rhythmdb_read_enter), (rhythmdb_read_leave),
        (timeout_rhythmdb_commit), (set_metadata_string_default_unknown),
        (set_props_from_metadata), (rhythmdb_process_stat_event),
        (rhythmdb_process_metadata_load),
        (rhythmdb_process_queued_entry_set_event),
        (rhythmdb_process_events), (action_thread_main),
        (rhythmdb_entry_sync), (rhythmdb_entry_set_internal),
        (rhythmdb_entry_queue_set), (rhythmdb_entry_set),
        (rhythmdb_prop_get_type), (entry_volume_mounted_or_unmounted),
        (rhythmdb_entry_set_mount_point), (rhythmdb_entry_set_visibility):
        * rhythmdb/rhythmdb.h:
        * shell/main.c: (main):
        * sources/rb-source.c: (rb_source_update_play_statistics):
        * widgets/rb-entry-view.c: (rb_entry_view_rated_cb): reimplement
        rhythmdb_entry_queue_set, this should fix some crashes when doing
        a rhythmdb_entry_set while the db is read-only