[SERVER-10919] logging in ~ReplicaSetMonitor() crashes Created: 26/Sep/13  Updated: 11/Jul/16  Resolved: 01/Oct/13

Status: Closed
Project: Core Server
Component/s: Internal Client
Affects Version/s: 2.4.6
Fix Version/s: 2.4.9, 2.5.3

Type: Bug Priority: Major - P3
Reporter: Ingo Schramm Assignee: Randolph Tan
Resolution: Done Votes: 0
Labels: replicaset
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Linux


Backwards Compatibility: Fully Compatible
Operating System: Linux
Steps To Reproduce:

probably like this:

use mongo::ScopedDbConnection and shutdown aplication

Participants:

 Description   

A server application with integrated MongoDB C++ Driver 2.4.6 crashes on shutdown.

The crash might be related to src/mongo/client/dbclient_rs.cpp:408.

We see: "Logstream::get called in uninitialized state". Calling "mongo::initLogging()" previously did not help and is also not an option because it seems to totally hijack stdout and stderr. We could not see this problem with 2.4.5.

Stacktrace:

#0 0x00007fe92870b88d in __libc_waitpid (pid=<optimized out>, stat_loc=<optimized out>, options=<optimized out>) at ../sysdeps/unix/sysv/linux/waitpid.c:41
#1 0x0000000001abd65c in print_gdb_stack_trace_and_die () at .../stacktrace.cpp:32
#2 0x0000000001abd67e in stack_trace_signal_handler (sig=<optimized out>) at .../stacktrace.cpp:51
#3 <signal handler called>
#4 0x00007fe9263f8425 in __GI_raise (sig=<optimized out>) at ../nptl/sysdeps/unix/sysv/linux/raise.c:64
#5 0x00007fe9263fbb8b in __GI_abort () at abort.c:91
#6 0x00007fe9263f10ee in __assert_fail_base (fmt=<optimized out>, assertion=0x1f81105 "!pthread_mutex_lock(&m)", file=0x1f69510 ".../include/boost-1.48.0/boost/thread/pthread/mutex.hpp", line=<optimized out>, function=<optimized out>) at assert.c:94
#7 0x00007fe9263f1192 in _GI__assert_fail (assertion=0x1f81105 "!pthread_mutex_lock(&m)", file=0x1f69510 ".../include/boost-1.48.0/boost/thread/pthread/mutex.hpp", line=137, function=0x1f89f20 "void boost::timed_mutex::lock()") at assert.c:103
#8 0x0000000001b664e7 in mongo::Logstream::flush(mongo::Tee*) ()
#9 0x0000000001b66a8e in mongo::Logstream::operator<<(std::ostream& (std::ostream&)) ()
#10 0x0000000001b2e6ff in mongo::ReplicaSetMonitor::~ReplicaSetMonitor() ()
#11 0x0000000001b3ca92 in boost::detail::sp_counted_impl_p<mongo::ReplicaSetMonitor>::dispose() ()
#12 0x0000000001b3b27c in std::_Rb_tree<std::string, std::pair<std::string const, boost::shared_ptr<mongo::ReplicaSetMonitor> >, std::_Select1st<std::pair<std::string const, boost::shared_ptr<mongo::ReplicaSetMonitor> > >, std::less<std::string>, std::allocator<std::pair<std::string const, boost::shared_ptr<mongo::ReplicaSetMonitor> > > >::_M_erase(std::_Rb_tree_node<std::pair<std::string const, boost::shared_ptr<mongo::ReplicaSetMonitor> > >*) ()
#13 0x00007fe9263fd901 in __run_exit_handlers (status=1, listp=0x7fe92677a688, run_list_atexit=true) at exit.c:78
#14 0x00007fe9263fd985 in __GI_exit (status=<optimized out>) at exit.c:100
#15 0x00007fe9263e3774 in __libc_start_main (main=0xf73db0 <main>, argc=3, ubp_av=0x7fff57ea54b8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fff57ea54a8) at libc-start.c:258
#16 0x0000000000f7a581 in _start ()



 Comments   
Comment by Githook User [ 20/Dec/13 ]

Author:

{u'username': u'renctan', u'name': u'Randolph Tan', u'email': u'randolph@10gen.com'}

Message: SERVER-10919 logging in ~ReplicaSetsMonitor crashes
Branch: v2.4
https://github.com/mongodb/mongo/commit/37f8eaa898b521863547f46560c6ff4e9029656e

Comment by auto [ 01/Oct/13 ]

Author:

{u'username': u'renctan', u'name': u'Randolph Tan', u'email': u'randolph@10gen.com'}

Message: SERVER-10919 logging in ~ReplicaSetsMonitor crashes
Branch: master
https://github.com/mongodb/mongo/commit/393194020e81707824b90622cf365333944133ef

Comment by Ingo Schramm [ 30/Sep/13 ]

I could fix the problem by commenting src/mongo/client/dbclient_rs.cpp:408 and recompiling the driver.

Generated at Thu Feb 08 03:24:24 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.