[ https://issues.apache.org/jira/browse/MESOS-815?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13824616#comment-13824616 ]
Jie Yu commented on MESOS-815: ------------------------------ {noformat} #0 0x00007f60fe3f9265 in raise () from /lib64/libc.so.6#1 0x00007f60fe3fad10 in abort () from /lib64/libc.so.6#2 0x00007f60fdb78e99 in os::abort (dump_core=true) at /builddir/build/BUILD/java-1.7.0-openjdk7/openjdk7/hotspot/src/os/linux/vm/os_linux.cpp:1590 #3 0x00007f60fdcfc22c in VMError::report_and_die (this=0x7f60fef528e0) at /builddir/build/BUILD/java-1.7.0-openjdk7/openjdk7/hotspot/src/share/vm/utilities/vmError.cpp:1026 #4 0x00007f60fdb7f671 in JVM_handle_linux_signal (sig=11, info=0x7f60fef52ab0, ucVoid=0x7f60fef52980, abort_if_unrecognized=1) at /builddir/build/BUILD/java-1.7.0-openjdk7/openjdk7/hotspot/src/os_cpu/linux_x86/vm/os_linux_x86.cpp:531 #5 <signal handler called> #6 0x00007f60e52d3d24 in std::_Rb_tree_rotate_left(std::_Rb_tree_node_base*, std::_Rb_tree_node_base*&) () from /usr/lib64/libstdc++.so.6 #7 0x00007f60e52d3eb6 in std::_Rb_tree_insert_and_rebalance(bool, std::_Rb_tree_node_base*, std::_Rb_tree_node_base*, std::_Rb_tree_node_base&) () from /usr/lib64/libstdc++.so.6 #8 0x00007f60e72b959e in std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std:: char_traits<char>, std::allocator<char> > const, int>, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, int> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, int> > >::_M_insert (this=0x7f60e7a81bc0, __x=0x0, __p=0x7f60d0000e00, __v=...) at /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_tree.h:821 #9 0x00007f60e72b98c7 in std::_Rb_tree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::pair<std::basic_string<char, std:: char_traits<char>, std::allocator<char> > const, int>, std::_Select1st<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, int> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, st d::char_traits<char>, std::allocator<char> > const, int> > >::insert_unique (this=0x7f60e7a81bc0, __position=..., __v=...) at /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_tree.h:947 #10 0x00007f60e72b9c5f in std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, std::less<std::basic_string<char, std:: char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, int > > >::insert (this=0x7f60e7a81bc0, position=..., __x=...) at > > >/usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_map.h:420 #11 0x00007f60e72b9d06 in std::map<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, int, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, std::allocator<std::pair<std::basic_string<char, std::char_traits<char>, std::allocator<char> > const, int> > >::operator[] (this=0x7f60e7a81bc0, __k="log-replica") at /usr/lib/gcc/x86_64-redhat-linux/4.1.2/../../../../include/c++/4.1.2/bits/stl_map.h:348 #12 0x00007f60e7268469 in process::ID::generate (prefix="log-replica") at ../../../3rdparty/libprocess/src/process.cpp:140 #13 0x00007f60e722610a in mesos::internal::log::ReplicaProcess::ReplicaProcess (this=0x7f60d00058d0, path= "/home/jyu/angrybird/logs/AngryBird/tests/TestScheduler_test_submit_job_ExpireFollowingMasterZKSession_JobStatusInit/schedulers/3/db/mesos_log", _strict=true, __in_chrg=<value optimized out>, __vtt_parm=<value optimized out>) at ../../src/log/replica.cpp:587 #14 0x00007f60e7226497 in mesos::internal::log::Replica::Replica (this=0x7f60d0001ec0, path= "/home/jyu/angrybird/logs/AngryBird/tests/TestScheduler_test_submit_job_ExpireFollowingMasterZKSession_JobStatusInit/schedulers/3/db/mesos_log", strict=true) at ../../src/log/replica.cpp:1196 #15 0x00007f60e731b311 in mesos::internal::log::Log::Log (this=0x26eec40, _quorum=2, path= "/home/jyu/angrybird/logs/AngryBird/tests/TestScheduler_test_submit_job_ExpireFollowingMasterZKSession_JobStatusInit/schedulers/3/db/mesos_log", servers="localhost:46084", timeout=..., znode="/local/service/mesos-native-log", auth=..., strict=true) at ../../src/log/log.hpp:229 #16 0x00007f60e72f998f in Java_org_apache_mesos_Log_initialize__ILjava_lang_String_2Ljava_lang_String_2JLjava_util_concurrent_TimeUnit_2Ljava_lang_String_2Ljava_lang_String_2_3B (env=0x18e21e8, thiz=0x7f60fef53910, jquorum=2, jpath=0x7f60fef53900, jservers=0x7f60fef538f8, jtimeout=1, junit=0x7f60fef538e0, jznode=0x7f60fef538d8, jscheme=0x7f60fef538d0, jcredentials=0x7f60fef538c8) at ../../src/java/jni/org_apache_mesos_Log.cpp:585 {noformat} > Race condition in process::ID::generate(). > ------------------------------------------ > > Key: MESOS-815 > URL: https://issues.apache.org/jira/browse/MESOS-815 > Project: Mesos > Issue Type: Bug > Components: c++ api > Environment: Linux gcc-4.2.1 > Reporter: Jie Yu > Assignee: Jie Yu > > string generate(const string& prefix) > { > static map<string, int> prefixes; > stringstream out; > out << __sync_add_and_fetch(&prefixes[prefix], 1); > return prefix + "(" + out.str() + ")"; > } > This function could be called from multiple threads and the std::map > 'prefixes' is not protected by lock, leading to a race condition. This causes > framework to segfault. -- This message was sent by Atlassian JIRA (v6.1#6144)