Bug: Segmentation Fault During Periodic Read-Only Ladybug Database Reconnection
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 25/100
調査の方向性
Start with ladybug/database.py around init_pybind_database, then trace the follower_refresh_loop to _refresh_follower_main_database and _open_main_database. Review the static core dump and logs alongside the repeated read_pool_generation changes and checkpoint/WAL errors. Done means the native crash has a reproducible diagnosis and the reconnect behavior is validated under concurrent checkpoint/WAL activity.
索引モデルが issue の本文から書いたものです。
説明
Ladybug version
main
What operating system are you using?
ubuntu24.04
What happened?
Conclusion: This was not an OOM event. It was a SIGSEGV (segmentation fault) triggered by the LadybugDB native. The most likely cause is a concurrency or lifecycle race between repeatedly reopening the read-only database, closing old connection pools, and concurrent checkpoint/WAL operations.
Key evidence:
-
The log explicitly reports:
Fatal Python error: Segmentation fault -
The crashing thread was in:
ladybug/database.py -> init_pybind_databaseCall chain:
follower_refresh_loop -> _refresh_follower_main_database -> _open_main_database -> Ladybug Database initializationThis indicates that the crash occurred in Ladybug’s native/pybind layer, rather than in normal Python application code.
-
The database was repeatedly reconnected, approximately once every 15 seconds. The
read_pool_generationincreased from 1 to 19. Each refresh performed the following operations:- Opened the same
main_ontology.lbugdatabase. - Created 8 read connections.
- Switched the active connection pool.
- Closed the previous database instance.
- Opened the same
-
Before the crash, the log showed database-file concurrency/state errors:
Cannot open database in read-only mode while checkpoint is in progressCannot open file ... main_ontology.lbug.wal: No such file or directory
These errors indicate that the database was being opened for reading while its files may have been changing due to a checkpoint, WAL removal/rotation, or another process modifying the database.
-
Memory usage did not reach the container limit:
- cgroup memory limit: 16 GiB
- Last recorded cgroup usage: approximately 2.31 GiB
- Process RSS: approximately 1.97 GiB
- Memory monitor status:
normal
Therefore, this does not resemble a Kubernetes OOM kill. An OOM kill normally results in
OOMKilledand exit code 137, while a segmentation fault commonly results in exit code 139.
Most likely failure sequence:
Checkpoint/WAL state changes
↓
Read-only database opening fails and triggers retries
↓
Repeated open + connection-pool switch + close operations every 15 seconds
↓
A thread-safety or resource-lifecycle issue occurs in the Ladybug native layer
↓
SIGSEGV / core dump
Based on the current logs, it can be confirmed that the segmentation fault occurred during Ladybug native database initialization. The strongest suspected root cause is frequent read-database reconnection while checkpoint/WAL operations are changing the same database files, causing a thread-safety or resource-release issue in the native layer.
Are there known steps to reproduce?
I’m not sure how to go about fixing this issue. Every time I observe the problem, I only get a static core dump, and I cannot reproduce the failure reliably. As a result, it is unclear where exactly the root cause lies. Could you share some suggestions and troubleshooting ideas? @adsharma
- 主要言語
- C++
- スター
- 1.8k
- フォーク
- 148
- 平均マージ
- 14時間 57分
- マージ済み PR(30日)
- 124
環境構築
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
LadybugDB/ladybug のほかの issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 85/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
Bug: is_sorted assertion in scanCommittedInMem after a failed checkpoint with deleted in-memory relsオープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
メンテナーはふだん 1 日以内に返信
-
難易度 5/5 1週間以上 初心者へのやさしさ 25/100
メンテナーはふだん 1 日以内に返信
-
bug
難易度 4/5 3〜5日 初心者へのやさしさ 58/100
LadybugDB/ladybug#1117 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
LadybugDB/ladybug の issue をすべて見る
似ている issue
-
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
メンテナーはふだん 1 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 74/100
EsotericSoftware/spine-runtimes#3186 ·
-
An empty line splits a signature where an ordinary comment is right above an argument's Haddockオープン
難易度 2/5 1〜3時間 初心者へのやさしさ 68/100
メンテナーはふだん 1 日以内に返信