Segmentation fault in load_with_acquire

Segmentation fault in load_with_acquire


I am employing concurrent_hash_map in my code. When i tried to insert into it, my code crashed.

This is the snippet of my code : 

typedef concurrent_hash_map<string, struct jsock_s *> JSockTable;

...

JSockTable::accessor a;
(cur->clients).insert(a, jsock->client_id); // char * jsock::client_id
a->second = jsock;
a.release();

 

Here's the core dump

#0  load_with_acquire (location=@0x10: <error reading variable>)

    at /home/test/Vidhya/essentials/tbb_src/tbb-2019_U7/include/tbb/tbb_machine.h:607

#1  __TBB_load_with_acquire<tbb::interface5::internal::hash_map_node_base*> (

    location=@0x10: <error reading variable>)

    at /home/test/Vidhya/essentials/tbb_src/tbb-2019_U7/include/tbb/tbb_machine.h:710

#2  itt_load_word_with_acquire<tbb::interface5::internal::hash_map_node_base*> (

    src=@0x10: <error reading variable>)

    at /home/test/Vidhya/essentials/tbb_src/tbb-2019_U7/include/tbb/tbb_profiling.h:199

#3  acquire (writer=false, h=0, base=0x7f6698022e68, this=<synthetic pointer>)

    at /home/test/Vidhya/essentials/tbb_src/tbb-2019_U7/include/tbb/concurrent_hash_map.h:694

#4  bucket_accessor (writer=false, h=0, base=0x7f6698022e68, this=<synthetic pointer>)

    at /home/test/Vidhya/essentials/tbb_src/tbb-2019_U7/include/tbb/concurrent_hash_map.h:689

#5  tbb::interface5::concurrent_hash_map<std::string, jsock_s*, tbb::tbb_hash_compare<std::string>, tbb::tbb_allocator<std::pair<std::string const, jsock_s*> > >::lookup (this=0x7f6698022e68, 

    op_insert=op_insert@entry=true, key="54292000000046165", t=t@entry=0x0, 

    result=result@entry=0x7f66b826ce10, write=write@entry=true, 

    allocate_node=0x7f668b3665d0 <tbb::interface5::concurrent_hash_map<std::string, jsock_s*, tbb::tbb_hash_compare<std::string>, tbb::tbb_allocator<std::pair<std::string const, jsock_s*> > >::allocate_node_default_construct(tbb::tbb_allocator<tbb::interface5::concurrent_hash_map<std::string, jsock_s*, tbb::tbb_hash_compare<std::string>, tbb::tbb_allocator<std::pair<std::string const, jsock_s*> > >::node>&, std::string const&, jsock_s* const*)>, tmp_n=0x0)

    at /home/test/Vidhya/essentials/tbb_src/tbb-2019_U7/include/tbb/concurrent_hash_map.h:1256

#6  0x00007f668b35c60d in insert (key="54292000000046165", result=..., this=0x7f6698022e68)

    at /home/test/Vidhya/essentials/tbb_src/tbb-2019_U7/include/tbb/concurrent_hash_map.h:1031

#7  zcon_add_client (jsock=jsock@entry=0x7f66a4002ac8) at ws_conf.cpp:931

#8  0x00007f668b362dcc in create_new_conference (jsock=<optimized out>, params=0x7f669802d770, 

    jresponse=0x7f669802db00) at ws_conf.cpp:1328

#9  0x00007f668b34313f in is_authenticated_user (params=0x7f669802d770, jsock=0x7f66a4002ac8, 

    code=0x0, msg=0x7f66b826d260 "`\342\002\230f\177") at mod_ws.cpp:3607

#10 0x00007f668b34b7df in zcon_login_func (method=0x7f6698022e68 "", params=0x7f669802d770, 

    jsock=0x7f66a4002ac8, response=0x7f66b826d300) at mod_ws.cpp:8289

#11 0x00007f668b34113d in process_jrpc (jsock=0x7f66a4002ac8, json=0x7f669802e1d0) at mod_ws.cpp:1981

#12 0x00007f668b346439 in process_input (bytes=<optimized out>, data=<optimized out>, 

    jsock=<optimized out>) at mod_ws.cpp:2156

#13 client_run (jsock=0x7f66a4002ac8) at mod_ws.cpp:3061

#14 0x00007f668b347841 in client_thread (thread=0x7f6698022e68, obj=0x7f66a4002ac8) at mod_ws.cpp:3771

#15 0x00007f66c10ccc7d in switch_core_session_thread_pool_worker (thread=0x7f66a4015ef0, obj=0x0)

    at src/switch_core_session.c:1928

#16 0x00007f66c13d1f50 in dummy_worker (opaque=0x7f66a4015ef0) at threadproc/unix/thread.c:151

#17 0x00007f66c05e5064 in start_thread (arg=0x7f66b826e700) at pthread_create.c:309

#18 0x00007f66bfcbd62d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111

I'm wondering what is wrong. I tried it with 2019 and 2019_U7 versions. 

2 posts / 0 new

It is difficult to say what is going on. It looks like that some internal structure of the hash map is broken but the reason is unclear. Is it possible to share reproducer or provide more details about the use case?

Leave a Comment

Please sign in to add a comment. Not a member? Join today