-
Type:
Improvement
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Component/s: None
-
Storage Engines
-
StorEng - Defined Pipeline
When WT aborts in diagnostic mode, we get a core dump and a C stack trace. If this is the result of a Python test, it's pretty difficult to figure out what the test is doing, like which line of Python is being executed, etc. It would be nice to have, right next to the C stack trace, a Python traceback.
It shouldn't be too hard. We could create a new WT_EVENT_TYPE (that is used by the general event handler). And just before __wt_abort is about to call abort(), it can call the general event handler. Meanwhile, our Python code already knows how to set up event handlers, we just need to add a general event handler.
There are ways to call back to Python from a C function (the event handler). I think this will create a new thread, so we've may lose the context of the error. But we can print all the python stacks via something like this:
https://stackoverflow.com/questions/1032813/dump-stacktraces-of-all-active-threads