RocksDB public-header asserts are compiled live into release builds
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 38/100
Research direction
Read the addon's Release configuration and the #1113 fix in src/binding, then inspect the assert usage under deps/rocksdb/include/rocksdb. Compare the two proposed options against the build behavior and the stated ABI concern; done means deciding and documenting whether release builds keep these header asserts live or disable them under the specified condition.
Written by the indexing model from the issue text.
Description
Problem
Found while fixing #1113 (Release builds abort the process when an internal native assert fails). The addon's Release configuration defines no NDEBUG, so the assert() calls inside RocksDB's public headers are live too: every inline header function our translation units instantiate carries its assert into the published .node. The fix for #1113 only covers asserts we own in src/binding; it cannot reach these.
Evidence from a macOS arm64 release build of main (043141a1), via strings/nm on build/Release/rocksdb-js.node:
nm -ulists__assert_rtn(the libc assert failure handler), still imported after #1113's fix.- Assert strings from RocksDB headers are present, for example
slice.h/data_ != nullptr && b.data_ != nullptr,db.h/value != nullptr,write_buffer_manager.h/new_size > 0, andcompaction_filter.h.
29 headers under deps/rocksdb/include/rocksdb use assert. None of them use NDEBUG to change a struct layout, so defining it would not create an ABI mismatch with the prebuilt librocksdb (which is itself built with NDEBUG).
Impact
Each of these guards misuse of the RocksDB API by our code, so a violation is a bug of ours, not of a caller. No trigger is known: the one I checked (WriteBufferManager::SetBufferSize(0)) is already guarded in db_settings.cpp. If one fires, the host process gets SIGABRT with no JS error, the same failure class as #1113.
Options
- Define
NDEBUGin the addon'sReleaseconfiguration only whenROCKSDB_JS_FATAL_ASSERTSis unset (so CI builds keep RocksDB's header asserts live and the published prebuilds match how RocksDB compiles its own library). Trade-off: in the published build, a misuse would then continue into whatever the assert was guarding, which forSliceaccessors is undefined behaviour rather than an abort. - Leave them live and document it: an abort is arguably safer than undefined behaviour at those particular sites.
🤖 Generated by Claude Code (Claude Opus 5.5); posted via @cb1kenobi.
- Dominant language
- C++
- Stars
- 24
- Forks
- 3
- Avg merge
- 1d 17h
- Merged PRs (30d)
- 94
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from HarperFast/rocksdb-js
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
HarperFast/rocksdb-js#1118 ·
Maintainers usually reply within 1 day
-
CLI crashes with ENOTCONN instead of exiting 0 when stdout closes on macOSPossibly taken @cb1kenobi claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 83/100
HarperFast/rocksdb-js#1112 ·
Maintainers usually reply within 1 day
-
A durable commit is reported as failed when aftercommit hits a database closed after the commitOpen
Difficulty 4/5 3-5 days Newbie friendliness 48/100
HarperFast/rocksdb-js#1117 ·
Maintainers usually reply within 1 day
-
Release builds abort the process when an internal native assert failsPossibly taken @cb1kenobi claimed this today. Openbug
HarperFast/rocksdb-js#1113 · 1 assignee ·
Maintainers usually reply within 1 day
-
enhancement
Difficulty 5/5 Over a week Newbie friendliness 30/100
HarperFast/rocksdb-js#1111 ·
Maintainers usually reply within 1 day
All issues in HarperFast/rocksdb-js
Similar issues
-
bug triage
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Maintainers usually reply within 1 day
-
26.04 bug dark-mode Easy Hack impress symptom: visual
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
CollaboraOnline/online#16421 · 1 comment ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 63/100
telegramdesktop/tdesktop#31653 ·
Maintainers usually reply within 1 day
-
area/cs bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
ydb-platform/ydb#59881 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 1 day