[SERVER-9869] C++ driver crash when mongodb is shutdowned Created: 06/Jun/13 Updated: 11/Jul/16 Resolved: 26/Jun/13 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Internal Client |
| Affects Version/s: | 2.2.3 |
| Fix Version/s: | None |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Daniel Stefan Tacalau | Assignee: | Andrew Morrow (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Environment: |
Linux 3.4.37-40.44.amzn1.x86_64 #1 SMP Thu Mar 21 01:17:08 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux |
||
| Operating System: | Linux |
| Participants: |
| Description |
|
One of our applications crashed with the following stacktrace from the C++ mongodb driver thread: Program terminated with signal 6, Aborted. It seems that the crash happened when mongodb was shutdowned. There is a lot of inactivity in mongodb log until the moment of the shutdown: ntoreturn:1 keyUpdates:0 reslen:135 85934181ms ntoreturn:1 keyUpdates:0 reslen:135 85812168ms Mongodb has only one node: ] |
| Comments |
| Comment by Andrew Morrow (Inactive) [ 26/Jun/13 ] |
|
Closing since the solution of using dbexit appears to be working. Feel free to re-open if the issue recurs. |
| Comment by Andrew Morrow (Inactive) [ 19/Jun/13 ] |
|
Hi Daniel - I've verified with another engineer that it is OK for you to call mongo::dbexit as you are doing. Since you aren't able to reproduce the crash right now, and since you have opened another ticket for the logging issue (thanks for doing that), I think it makes sense to close this ticket for now. If you experience the original crash now that you are using mongo::dbexit, you can re-open this ticket and we can investigate further. Thanks, |
| Comment by Daniel Stefan Tacalau [ 19/Jun/13 ] |
|
Andrew, Sorry for the confusing answer. Let me clarify: I'll open a separate ticket for the logging stuff. Thanks, |
| Comment by Andrew Morrow (Inactive) [ 19/Jun/13 ] |
|
Hi Daniel - A few questions and a suggestion:
For the C++ driver logging questions, I'd suggest either opening a separate ticket so we can track the issues independently. Thanks, |
| Comment by Daniel Stefan Tacalau [ 19/Jun/13 ] |
|
Andrew, I forgot to mention that I always get crashes on exit similar with the one above in most of our applications that are using the C++ mongo driver. After researching the matter I Is there any way I can enable in my app C++ driver logging on DEBUG level? I've tried using mongo::initLogging(<some-file>, true) but it does not write too much. It seems to write only messages logged by calls to "log()" and it does not write messages logged by "log(<some-level>)". Thanks, |
| Comment by Daniel Stefan Tacalau [ 19/Jun/13 ] |
|
Andrew, Here is what I get when I run the test program from https://jira.mongodb.org/browse/SERVER-8891 sh-4.1# gdb --args ./a.out Wed Jun 19 10:01:19 warning: No primary detected for set c2 Program received signal SIGSEGV, Segmentation fault. Daniel |
| Comment by Andrew Morrow (Inactive) [ 18/Jun/13 ] |
|
Hi Daniel - I wonder if you may be affected by As to your question about instrumentation, one possibility would be to use valgrind to see if there is a static destructor ordering problem, which would almost certainly show up as a use after free, or some other sort of similar memory error. Thanks, |
| Comment by Daniel Stefan Tacalau [ 18/Jun/13 ] |
|
Andrew, This hasn't reproduced so far. 1. We're using C++ driver 2.2.3 from CentOS 6.4 repo. Is there any kind of instrumentation that I can enable in the C++ driver so that when the crash occur again I'll have some reports? Thanks for looking into this, |
| Comment by Andrew Morrow (Inactive) [ 17/Jun/13 ] |
|
Hi Daniel - Just checking in to see if this is still an issue for you. Thanks, |
| Comment by Andrew Morrow (Inactive) [ 12/Jun/13 ] |
|
Hi Daniel - Could you provide some additional details to help us diagnose the issue?
Thanks, |