Re: Race condition in rygel-changelog.vala?



On 26 March 2014 10:57, Jussi Kukkonen <jussi kukkonen intel com> wrote:
Unfortunately, very often I get a fatal assert and SIGABORT in
Rygel-changelog.vala, apparently the hash table is incurring in a race
condition, can it be?

Without a backtrace, it's hard to tell.

So Dario sent me this error and backtrace:

ERROR:hashmap.c:2932:gee_hash_map_node_iterator_next: assertion
failed: (_stamp == _map._stamp)

#0  0xb7747424 in __kernel_vsyscall ()
#1  0xb71a7cc1 in raise () from /lib/libc.so.6
#2  0xb71ab0ee in abort () from /lib/libc.so.6
#3  0xb73ec5e6 in g_assertion_message () from /usr/lib/libglib-2.0.so.0
#4  0xb73ecb4e in g_assertion_message_expr () from /usr/lib/libglib-2.0.so.0
#5  0xb6f899cb in gee_hash_map_node_iterator_next () from
/usr/lib/libgee-0.8.so.2
#6  0xb6f91fd8 in gee_iterator_next () from /usr/lib/libgee-0.8.so.2
#7  0xb7334372 in rygel_change_log_finish (self=0x8a9c2a0) at
rygel-changelog.c:273
#8  0xb7334423 in rygel_change_log_timeout (self=0x8a9c2a0) at
rygel-changelog.c:129
#9  _rygel_change_log_timeout_gsource_func (self=0x8a9c2a0) at
rygel-changelog.c:146
#10 0xb73c78bd in g_timeout_dispatch () from /usr/lib/libglib-2.0.so.0
#11 0xb73c6b2b in g_main_context_dispatch () from /usr/lib/libglib-2.0.so.0
#12 0xb73c6eb8 in g_main_context_iterate.clone.5 () from
/usr/lib/libglib-2.0.so.0
#13 0xb73c73ab in g_main_loop_run () from /usr/lib/libglib-2.0.so.0
   ...

Assert happens in Changelog.finish() where the hash values are
iterated. It is making sure the hashmap has not been modified while
iterating.

I don't understand how that could happen. Changelog.finish() does not
modify the hash map and there does not seem to be any threading or
yielding going on in the iteration loop. How can the hash map get
modified while the iteration is going on?

Dario, is it possible in any way that ChangeLog.log() or
ChangeLog.log_with_channel() could get called from a thread that is
not the main loop thread? It seems like a remote possibility but I
can't think of anything else right now...



 - Jussi


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]