Skip to content
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

segment in try_dequeue #261

Closed
Juno119 opened this issue Sep 24, 2021 · 3 comments
Closed

segment in try_dequeue #261

Juno119 opened this issue Sep 24, 2021 · 3 comments

Comments

@Juno119
Copy link

Juno119 commented Sep 24, 2021

hi, I have two threads, one is producer, and the other is consumer. segment in try_dequeue

(gdb) thread apply all bt

Thread 65 (Thread 0x7fbe8dffb700 (LWP 48270)):
#0 load (__m=std::memory_order_acquire, this=0x8) at /home/mmdev/gcc7/lib/gcc/x86_64-pc-linux-gnu/7.5.0/../../../../include/c++/7.5.0/bits/atomic_base.h:396
#1 get_block_index_index_for_index (localBlockIndex=, index=0, this=0x7fbf202e9208)
at demoe/xlabutil/inc/concurrentqueue.h:2938
#2 get_block_index_entry_for_index (index=0, this=0x7fbf202e9208) at demoe/xlabutil/inc/concurrentqueue.h:2927
#3 dequeue<std::pair<std::basic_string, std::basic_string > > (element=..., this=0x7fbf202e9208)
at demoe/xlabutil/inc/concurrentqueue.h:2550
#4 dequeue<std::pair<std::basic_string, std::basic_string > > (element=..., this=0x7fbf202e9208)
at demoe/xlabutil/inc/concurrentqueue.h:1700
#5 try_dequeue<std::pair<std::basic_string, std::basic_string > > (item=..., this=0x30d51c0 <video_marquee_ftp_queue>)
at demoe/xlabutil/inc/concurrentqueue.h:1125
#6 FtpUploadProcess () at demoe/demoserviceimpl_pb.cpp:119
#7 0x00000000016d1b3f in std::execute_native_thread_routine (__p=0x7fbf200aa6e0) at ../../../../../gcc-7.5.0/libstdc++-v3/src/c++11/thread.cc:83
#8 0x00007fbfb47b4dc5 in start_thread () from /lib64/libpthread.so.0
#9 0x00007fbfb39bc74d in clone () from /lib64/libc.so.6

@Juno119
Copy link
Author

Juno119 commented Sep 24, 2021

hi by the way , enqueue or try_enqueue, which one is the suggestion to use with try_dequeue?

@cameron314
Copy link
Owner

Please share your code that reproduces the segfault.

You can use either enqueue or try_dequeue, it depends entirely on what you're trying to accomplish.

@cameron314
Copy link
Owner

Closing for now, feel free to reopen if you can provide an example to reproduce the crash.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants