[CXX-445] SIGABRT on shutdown with SSL enabled Created: 10/Dec/14 Updated: 19/Dec/14 Resolved: 11/Dec/14 |
|
| Status: | Closed |
| Project: | C++ Driver |
| Component/s: | Documentation |
| Affects Version/s: | legacy-1.0.0-rc2 |
| Fix Version/s: | legacy-1.0.0-rc3 |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Pieter Jordaan | Assignee: | Andrew Morrow (Inactive) |
| Resolution: | Done | Votes: | 0 |
| Labels: | legacy-cxx | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Description |
|
Here is a stacktrace
Built with --sharedclient --ssl --c++11 Please let me know how I can assist in debugging this. |
| Comments |
| Comment by Pieter Willem Jordaan [ 11/Dec/14 ] | ||||||||||||||||||||
|
Thanks so much Andrew. I'm stoked about the support MongoDB provides | ||||||||||||||||||||
| Comment by Andrew Morrow (Inactive) [ 11/Dec/14 ] | ||||||||||||||||||||
|
Hi pieterwjordaanpc@gmail.com - I've updated the documentation on the wiki to include more prominent links to information on configuring the driver, and updated the configuration documentation to reflect the current state of the code. | ||||||||||||||||||||
| Comment by Andrew Morrow (Inactive) [ 10/Dec/14 ] | ||||||||||||||||||||
|
The documentation describing initialization and termination (https://github.com/mongodb/mongo-cxx-driver/wiki/Configuring-the-Legacy-Driver) is out of date and should be updated to reflect currently reality. | ||||||||||||||||||||
| Comment by Andrew Morrow (Inactive) [ 10/Dec/14 ] | ||||||||||||||||||||
|
There is https://github.com/mongodb/mongo-cxx-driver/wiki/Configuring-the-Legacy-Driver, but it does appear to be out of date. I've triaged this ticket to 1.0.0 and changed the component to 'Documentation'. | ||||||||||||||||||||
| Comment by Pieter Willem Jordaan [ 10/Dec/14 ] | ||||||||||||||||||||
|
Thanks Andrew I recommend a documentation addition for this, unless I've missed it | ||||||||||||||||||||
| Comment by Andrew Morrow (Inactive) [ 10/Dec/14 ] | ||||||||||||||||||||
|
Hi pieterwjordaanpc@gmail.com - With the code example you have provided, you are correct that you must explicitly invoke client::shutdown() to terminate driver background threads before exiting the process. You may also, however, request that the driver register an atexit handler to invoke client::shutdown for you, by passing an appropriately configured options structure to client::initialize:
We don't do this by default, and require you to explicitly terminate the driver because in our testing we found that relying on atexit behavior gave unpredictable results on some platforms. Additionally, you may be interested in the GlobalInstance class declared in mongo/client/init.h, which uses RAII to schedule the initialization and termination calls for you, without relying on atexit. If none of those work for you, then you must make an explicit call to 'shutdown'. | ||||||||||||||||||||
| Comment by Pieter Jordaan [ 10/Dec/14 ] | ||||||||||||||||||||
|
Hi Andrew The following code produces the abort. I assume an explicit shutdown must be called? Is there a way to automatically shutdown on exit? testabort.cpp:
Makefile:
| ||||||||||||||||||||
| Comment by Andrew Morrow (Inactive) [ 10/Dec/14 ] | ||||||||||||||||||||
|
Hi pieterwjordaanpc@gmail.com - Thank you for the detailed bug report. If you have a short compilable example which we could try to use to reproduce this crash, that would be ideal. Short of that, if you could provide details for how you are initializing and terminating the library (use of the functions and options defined in mongo/client/init.h and mongo/client/options.h) that too would be helpful. Looking briefly at the stack traces above, it looks as if static destructors are in progress, but the BackgroundJob (thread) that manages the ReplicaSetMonitorWatcher has not been terminated. Thanks, |