<html><body><div style="font-family: arial, helvetica, sans-serif; font-size: 12pt; color: #000000"><div><span id="zwchr" data-marker="__DIVIDER__">----- On May 18, 2016, at 5:44 AM, songxin <songxin_1980@126.com> wrote:<br></span></div><div data-marker="__QUOTED_TEXT__"><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div>Hi,</div><div>Now I get a crash because receiving signal SIGSEGV as below.</div><br><div><span style="font-family: sans-serif; font-size: small;" data-mce-style="font-family: sans-serif; font-size: small;" size="2" face="sans-serif">#0  arena_alloc (arena=<optimized 
out>) at 
/usr/src/debug/liburcu/0.9.1+git5fd33b1e5003ca316bd314ec3fd1447f6199a282-r0/git/urcu-bp.c:432</span></div><span style="font-family: sans-serif; font-size: small;" data-mce-style="font-family: sans-serif; font-size: small;" size="2" face="sans-serif">#1  add_thread () at /usr/src/debug/liburcu/0.9.1+git5fd33b1e5003ca316bd314ec3fd1447f6199a282-r0/git/urcu-bp.c:462</span><br><div><span style="font-family: sans-serif; font-size: small;" data-mce-style="font-family: sans-serif; font-size: small;" size="2" face="sans-serif">#2  rcu_bp_register () at /usr/src/debug/liburcu/0.9.1+git5fd33b1e5003ca316bd314ec3fd1447f6199a282-r0/git/urcu-bp.c:541</span></div><div><span style="font-family: sans-serif; font-size: small;" data-mce-style="font-family: sans-serif; font-size: small;" size="2" face="sans-serif"><br></span></div><div>I read the code of urcu-bp.c and found  that  "if (chunk->data_len - chunk->used < len)" is in 432 line. So I guess that the chunk is a illegal pointer.</div><div>Below is the function rcu_bp_exit().</div><br><div><div>static</div><div>void rcu_bp_exit(void)</div><div>{</div><div>        mutex_lock(&init_lock);</div><div>        if (!--rcu_bp_refcount) {</div><div>                struct registry_chunk *chunk, *tmp;</div><div>                int ret;</div><br><div>                cds_list_for_each_entry_safe(chunk, tmp,</div><div>                                &registry_arena.chunk_list, node) {</div><div>                        munmap(chunk, chunk->data_len</div><div>                                        + sizeof(struct registry_chunk));</div><div>                }</div><div>                ret = pthread_key_delete(urcu_bp_key);</div><div>                if (ret)</div><div>                        abort();</div><div>        }</div><div>        mutex_unlock(&init_lock);</div><div>}</div></div><br><br><div>My question is below.</div><div>Why did not delete the chunk from <span style="line-height: 23.8px;">registry_arena.chunk_list before munmap a chunk?</span></div></div></blockquote><div><br></div><div>It is not expected that any thread would be created after the execution of<br data-mce-bogus="1"></div><div>rcu_bp_exit() as a library destructor. Does re-initializing the chunk_list after</div><div>iterating on it within rcu_bp_exit() fix your issue ?<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>I'm curious about your use-case for creating threads after the library destructor</div><div>has run.<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Thanks,<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><div>Mathieu<br data-mce-bogus="1"></div><div><br data-mce-bogus="1"></div><blockquote style="border-left:2px solid #1010FF;margin-left:5px;padding-left:5px;color:#000;font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt;"><div style="line-height:1.7;color:#000000;font-size:14px;font-family:Arial"><div><span style="line-height: 23.8px;"><br></span></div><div><span style="line-height: 23.8px;">Thanks,</span></div><div><span style="line-height: 23.8px;">xin</span></div><br></div><br><br><br>_______________________________________________<br>lttng-dev mailing list<br>lttng-dev@lists.lttng.org<br>https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev<br></blockquote></div><div><br></div><div data-marker="__SIG_POST__">-- <br></div><div>Mathieu Desnoyers<br>EfficiOS Inc.<br>http://www.efficios.com</div></div></body></html>