[SERVER-43055] Prevent an exception from being thrown when gdb prints a BSONObj with datetimes beyond datetime.MAXYEAR Created: 27/Aug/19 Updated: 29/Oct/23 Resolved: 14/Jul/20 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Testing Infrastructure |
| Affects Version/s: | None |
| Fix Version/s: | 4.7.0 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Eric Milkie | Assignee: | Richard Samuels (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||
| Backwards Compatibility: | Fully Compatible | ||||||||
| Operating System: | ALL | ||||||||
| Sprint: | STM 2020-07-27 | ||||||||
| Participants: | |||||||||
| Story Points: | 2 | ||||||||
| Description |
|
The BSON Python package can throw exceptions; the GDB pretty printer allows these exceptions to escape up into gdb/lldb, which can cause them to crash (I'm not sure why). Here is an example where I managed to get gdb to print a python stack trace and not crash (this is difficult to achieve):
|
| Comments |
| Comment by Githook User [ 03/Oct/20 ] | |||||
|
Author: {'name': 'Ryan Egesdahl', 'email': 'ryan.egesdahl@mongodb.com', 'username': 'deriamis'}Message: The GDB and LLDB pretty-printers were updated to call bson.decode() in | |||||
| Comment by Githook User [ 23/Jul/20 ] | |||||
|
Author: {'name': 'Richard Samuels', 'email': 'richard.l.samuels@gmail.com', 'username': 'richardsamuels'}Message: | |||||
| Comment by Githook User [ 14/Jul/20 ] | |||||
|
Author: {'name': 'Richard Samuels', 'email': 'richard.samuels@mongodb.com', 'username': 'richardsamuels'}Message: | |||||
| Comment by Eric Milkie [ 10/Jul/20 ] | |||||
|
Thank you very much for this improvement! | |||||
| Comment by Eric Milkie [ 23/Jun/20 ] | |||||
|
I think the replicator you wrote is appropriate for this ticket. We shouldn't be allowing exceptions to leak up into gdb from the pretty printers, regardless of whether gdb crashes or not. | |||||
| Comment by Richard Samuels (Inactive) [ 23/Jun/20 ] | |||||
|
milkie Would you happen to have a small replicator in C++ that I can work with? I came up with the following:
p b after the SIGTRAP yields a similar traceback, but doesn't crash gdb (as supplied with the v3 toolchain). I'm guessing this has gone away since this ticket was originally filed. | |||||
| Comment by Brooke Miller [ 15/Jun/20 ] | |||||
|
robert.guo and I discussed this in Needs Triaging and this may be good for you to work on, richard.samuels. The next phase of the Undo Integration will require us to build the tooling to use gdb differently due to Undo's data tracing capabilities. It will be good to gain familiarity with gdb's Python API, which is identical to undodb's. |