-
Notifications
You must be signed in to change notification settings - Fork 3.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
libevent 2.1.12 infinite loop in transaction_id_pick #1310
Comments
Hello! Have you enabled multi-thread support for libevent?
Or
If yes, can you please try one of the following to get more details?
And something less preferable but easier:
|
Not about multi-thread. It seems arc4_getbyte always returns 6c |
In another case, arc4_getbyte always returns 2c |
0x55b4e26eef20 : 0x2c2ceb3a 0x2c2c2c2c 0x2c2c2c2c 0x2c2c2c2c |
0x55a725955f20 : 0x6c6cd8a2 0x6c6c6c6c 0x6c6c6c6c 0x6c6c6c6c |
It should not look like this, seems that it has not been initialized, please verify this.
|
arc4random_buf(void *buf_, size_t n) arc4_stir_if_needed will initialize rs |
Hi Azat, I think you are right. We used multi-thread, but every thread will have its own event loop, so I think we do not need evthread_use_pthreads(). But rs in libevent is a global variable, if several threads write it at the same time, it will be corrupted. I will close this issue |
use eu-stack to check the stack:
TID 30798:
#0 0x0000556140baa1cf transaction_id_pick
#1 0x0000556140baea16 request_new
#2 0x0000556140bad4ac nameserver_send_probe
#3 0x0000556140ba700e nameserver_prod_callback
#4 0x0000556140b93c5d event_process_active_single_queue
#5 0x0000556140b94167 event_process_active
#6 0x0000556140b948ea event_base_loop
#7 0x0000556140b94203 event_base_dispatch
#8 0x00007f041a68c6df
#9 0x00007f041ad6b6db start_thread
#10 0x00007f0419d4971f __clone
TID 30798:
#0 0x0000556140ba6efb request_find_from_trans_id
#1 0x0000556140baa1ea transaction_id_pick
#2 0x0000556140baea16 request_new
#3 0x0000556140bad4ac nameserver_send_probe
#4 0x0000556140ba700e nameserver_prod_callback
#5 0x0000556140b93c5d event_process_active_single_queue
#6 0x0000556140b94167 event_process_active
#7 0x0000556140b948ea event_base_loop
#8 0x0000556140b94203 event_base_dispatch
#9 0x00007f041a68c6df
#10 0x00007f041ad6b6db start_thread
#11 0x00007f0419d4971f __clone
TID 30798:
#0 0x0000556140ba1f76 arc4_getbyte
#1 0x0000556140ba2095 arc4random_buf
#2 0x0000556140ba2297 ev_arc4random_buf
#3 0x0000556140ba22bd evutil_secure_rng_get_bytes
#4 0x0000556140baa1cb transaction_id_pick
#5 0x0000556140baea16 request_new
#6 0x0000556140bad4ac nameserver_send_probe
#7 0x0000556140ba700e nameserver_prod_callback
#8 0x0000556140b93c5d event_process_active_single_queue
#9 0x0000556140b94167 event_process_active
#10 0x0000556140b948ea event_base_loop
The text was updated successfully, but these errors were encountered: