Skip to content

Commit eb5e413

Browse files
committed
Configure breakpad test to log synchronously
Otherwise at exit some log entries can be lost resulting in an intermittent test failure. 1/1 Test #4: memcached-breakpad-test-std_exception_via_std_thread ...***Failed 0.08 sec 2024-01-19T10:19:11 INFO Spawning memcached 2024-01-19T10:19:11 INFO Process exited with status -6 2024-01-19T10:19:11 ERROR FAIL - No exception what() message written to stderr on crash. === stderr begin === libc++abi: terminating due to uncaught exception of type std::runtime_error: crash_engine: This exception wasn't handled === stderr end === Change-Id: Iaa679d1bb7a4593715f5beab004fd612809cb7fa Reviewed-on: https://review.couchbase.org/c/kv_engine/+/204112 Tested-by: Pavlos Georgiou <[email protected]> Reviewed-by: Trond Norbye <[email protected]>
1 parent 660ec3c commit eb5e413

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

tests/breakpad_test.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,8 @@ def set_core_file_ulimit():
273273
"root" : os.path.abspath(args.source_root),
274274
"verbosity" : 2,
275275
"rbac_file" : os.path.abspath(rbac_file.name),
276-
"logger" : { "filename" : test_temp_dir + "/log"}}
276+
"logger" : { "filename" : test_temp_dir + "/log",
277+
"unit_test" : True }}
277278
config_json = json.dumps(config)
278279

279280
# Need a temporary file which can be opened (a second time) by memcached,

utilities/terminate_handler.cc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ static void log_handled_exception() {
3232
#endif
3333
// Attempt to get the exception's what() message.
3434
try {
35-
static int tried_throw = 0;
35+
static std::atomic_bool tried_throw = false;
3636
// try once to re-throw currently active exception (so we can print
3737
// its what() message).
38-
if (tried_throw++ == 0) {
38+
if (!tried_throw.exchange(true)) {
3939
throw;
4040
}
4141
} catch (const std::exception& e) {

0 commit comments

Comments
 (0)