[SERVER-16496] override Boost's assert handler Created: 10/Dec/14  Updated: 22/Feb/16  Resolved: 22/Feb/16

Status: Closed
Project: Core Server
Component/s: Internal Code
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Major - P3
Reporter: Eric Milkie Assignee: DO NOT USE - Backlog - Platform Team
Resolution: Won't Fix Votes: 0
Labels: build-jbr
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Depends
Duplicate
is duplicated by SERVER-22536 Add Boost Assert Handlers Closed
Related
is related to SERVER-11020 Consistently use NDEBUG across all TU... Closed
is related to SERVER-17790 Build third_party libraries with NDEB... Closed
Backwards Compatibility: Fully Compatible
Participants:
Linked BF Score: 0

 Description   

Currently we are using the default handler, which prints a message to stderr and then calls abort(). This behavior makes this type of problem difficult to debug.

Instead, we can have our own function be called via BOOST_ENABLE_ASSERT_HANDLER, which can put the message into the server log and then shut down the server via fassert.

Boost assertions can be tripped by invalid use of shared_ptr and scoped_ptr, for example.



 Comments   
Comment by Githook User [ 17/Feb/16 ]

Author:

{u'username': u'markbenvenuto', u'name': u'Mark Benvenuto', u'email': u'mark.benvenuto@mongodb.com'}

Message: Revert "SERVER-16496 Define BOOST assert handler"

This reverts commit dad1e14a3d8ed6f17525f27ef823891a1836b8a6.
Branch: master
https://github.com/mongodb/mongo/commit/bd2c33b3c6000b92aa42bd285654d8e27bcd3af7

Comment by Eric Milkie [ 16/Feb/16 ]

It doesn't seem to have worked; now instead of printing the generic Assertion message in the log, we get nothing:
https://logkeeper.mongodb.org/build/56c377a09041300b2798a219/test/56c37d47be07c465a3d4d24d
But the exit status is still 0xC0000005.

Comment by Githook User [ 10/Feb/16 ]

Author:

{u'username': u'markbenvenuto', u'name': u'Mark Benvenuto', u'email': u'mark.benvenuto@mongodb.com'}

Message: SERVER-16496 Define BOOST assert handler
Branch: master
https://github.com/mongodb/mongo/commit/dad1e14a3d8ed6f17525f27ef823891a1836b8a6

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