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

fetch_df_batches() segfaults with fetch_decimals=True and repeated NUMBER values across batches

オープン
#608 コメント 2 件 リアクション 0 件 担当者 0 名 GitHub で見る

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

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
python
領域
backend, databases

調査の方向性

The issue is in connection.py line 1686 within fetch_df_batches(). Look at the thin/thick implementation modules handling NUMBER type conversion when fetch_decimals=True. Reproduce the segfault with the provided script, then examine memory management for repeated values across batch boundaries. Check the C extension code in oracledb.arrow_impl or oracledb.thin_impl for decimal fetching logic.

索引モデルが issue の本文から書いたものです。

説明

bug
  1. What versions are you using?
oracle database version: 19.31.0.0.0
thin mode: True
platform.platform: Linux-6.18.33.2-microsoft-standard-WSL2-x86_64-with-glibc2.39
sys.maxsize > 2**32: True
platform.python_version: 3.12.0
python-oracledb: 26.0.0
  1. Is it an error or a hang or a crash?
    Crash - Fatal Python error: Segmentation fault, exit code 139

  2. What error(s) or behavior you are seeing?
    Method Connection.fetch_df_batches() terminates the Python process with segmentation fault when: its parameter fetch_decimals=True AND a NUMBER value is repeated AND fetching continues into a second batch.

  3. Does your application call init_oracle_client()?
    No.

  4. Include a runnable Python script that shows the problem.

import faulthandler
import oracledb

faulthandler.enable()

query = """
select cast(0 as number(10, 0)) as n
from dual
connect by level <= 4
"""

with oracledb.connect(
    user="<user>",
    password="<password>",
    dsn="<dsn>",
) as connection:
    for index, batch in enumerate(
        connection.fetch_df_batches(
            statement=query,
            size=2,
            fetch_decimals=True,
        )
    ):
        print(index, batch.num_rows())

Expected output - both batches are fetched:

0 2
1 2

Actual output - only the first batch is returned:

0 2
Fatal Python error: Segmentation fault

Current thread 0x00007a1998319740 (most recent call first):
  File "/<user_path>/.venv/lib/python3.12/site-packages/oracledb/connection.py", line 1686 in fetch_df_batches
  File "/<user_path>/segfault.py", line 28 in <module>

Extension modules: oracledb.arrow_impl, oracledb.base_impl, oracledb.thick_impl, _cffi_backend, oracledb.thin_impl (total: 5)
主要言語
Python
スター
451
フォーク
118
PR マージ指標
30日以内にマージされた PR はありません

環境構築

はじめの一歩

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

oracle/python-oracledb のほかの issue

oracle/python-oracledb の issue をすべて見る

似ている issue

Python の issue をもっと見る

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

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