fetch_df_batches() segfaults with fetch_decimals=True and repeated NUMBER values across batches
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
- 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
-
Is it an error or a hang or a crash?
Crash - Fatal Python error: Segmentation fault, exit code 139 -
What error(s) or behavior you are seeing?
MethodConnection.fetch_df_batches()terminates the Python process with segmentation fault when: its parameterfetch_decimals=TrueAND aNUMBERvalue is repeated AND fetching continues into a second batch. -
Does your application call init_oracle_client()?
No. -
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)
- Lingua principale
- Python
- Stelle
- 451
- Fork
- 118
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di oracle/python-oracledb
-
bug
Difficoltà 5/5 Più di una settimana Idoneità per principianti 20/100
oracle/python-oracledb#607 · 1 commento ·
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 48/100
oracle/python-oracledb#592 · 6 commenti · 1 reazione ·
-
enhancement
Difficoltà 4/5 3-5 giorni Idoneità per principianti 35/100
oracle/python-oracledb#564 ·
-
bug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
oracle/python-oracledb#502 · 5 commenti ·
-
bug Client Library or Database
Difficoltà 4/5 3-5 giorni Idoneità per principianti 45/100
oracle/python-oracledb#422 · 1 commento ·
Tutte le issue di oracle/python-oracledb
Issue simili
-
bug
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
stephrobert/dsoxlab#238 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 75/100
sublimehq/package_control#1780 ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 65/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 70/100
nwg-piotr/nwg-displays#145 ·