Hacktoberfest 2026:メンテナが10月に向けて印を付けた、オープンで初心者向けの issue。 Hacktoberfest の issue を見る

Bug: Segmentation Fault During Periodic Read-Only Ladybug Database Reconnection

オープン
#1,007 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 1 日以内に返信

まだ誰も着手していません。

評価

難易度
5/5
見積もり時間
1週間以上
初心者へのやさしさ
25/100
issue の種類
バグ
明瞭さ
説明が足りない
活発さ
活発
技術スタック
cpp, python
領域
databases

調査の方向性

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 の本文から書いたものです。

説明

bug
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_database

    Call chain:

    follower_refresh_loop -> _refresh_follower_main_database -> _open_main_database -> Ladybug Database initialization

    This 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_generation increased from 1 to 19. Each refresh performed the following operations:

    1. Opened the same main_ontology.lbug database.
    2. Created 8 read connections.
    3. Switched the active connection pool.
    4. Closed the previous database instance.
  • Before the crash, the log showed database-file concurrency/state errors:

    • Cannot open database in read-only mode while checkpoint is in progress
    • Cannot 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 OOMKilled and 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

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

LadybugDB/ladybug のほかの issue

LadybugDB/ladybug の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。