apache / apache/arrow

[Python] Multiple warnings and asserts triggered in debug CPython 3.11

Offen
#33,765 9 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Component: Python Type: bug
Vorherrschende Sprache
C++
Sterne
17.1k
Forks
4.3k
Ø Merge
3 T. 23 Std.
Gemergte PRs (30 T.)
101

Beschreibung

### Describe the bug, including details regarding any error messages, version, and platform.

CPython [can be built in debug mode](https://docs.python.org/3/using/configure.html#python-debug-build) to catch some maybe-fatal-maybe-not errors. We have such python3.11 configured with `--with-pydebug` and pyarrow 10.0.1 installed, here is an example of gc warning
```
>>> import pyarrow as pa
>>> table = pa.table({'a': [1]})
gc:0: ResourceWarning: Object of type pyarrow.lib.Int64Array is not untracked before destruction
```
similar code sometimes triggers assertion
```
gc:0: ResourceWarning: Object of type pyarrow.lib.UInt16Array is not untracked before destruction
Modules/gcmodule.c:442: update_refs: Assertion "gc_get_refs(gc) != 0" failed
Enable tracemalloc to get the memory block allocation traceback

object address : 0x7f804e8762e0
object refcount : 0
object type : 0x7f80fcc3f5e0
object type name: pyarrow.lib.UInt16Array
object repr :

Fatal Python error: _PyObject_AssertFailed: _PyObject_AssertFailed
Python runtime state: initialized
```
Another crash
```
>>> import pyarrow as pa
>>> pa.table({0: []})
python: Objects/typeobject.c:1068: type_call: Assertion `!_PyErr_Occurred(tstate)' failed.
Aborted (core dumped)
```

### Component(s)

Python

Beitragsleitfaden

Beitragsleitfaden öffnen

Rechercherichtung

Reproduzieren Sie die Warnungen und Abstürze mit einem Debug-Build von CPython 3.11, pyarrow 10.0.1 und den Beispielen aus dem Issue. Untersuchen Sie die gemeldeten Pfade in Modules/gcmodule.c und Objects/typeobject.c und verfolgen Sie anschließend die beteiligten pyarrow-Objekte; abgeschlossen ist die Aufgabe, wenn die Beispiele keine Warnungen, Assertions oder fatalen Fehler mehr ausgeben.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
cpp, python
Bereich
backend, data
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Veraltet
Klarheit
Muss geklärt werden
Anfängerfreundlichkeit
25/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.