dinse commented on issue #46728:
URL: https://github.com/apache/arrow/issues/46728#issuecomment-2952846141
<details><summary>PyArrow relwithdebinfo</summary>
```
(pyarrow-dev) eric@Ubuntu:~/code2/arrow/python$ grep BUILD_TYPE
build/temp.linux-x86_64-cpython-312/CMakeCache.txt
CMAKE_BUILD_TYPE:STRING=relwithdebinfo
(pyarrow-dev) eric@Ubuntu:~/code2/arrow/python$ python -m pytest
pyarrow/tests/test_gdb.py
============================= test session starts
==============================
platform linux -- Python 3.12.3, pytest-8.3.5, pluggy-1.6.0
rootdir: /home/eric/code2/arrow/python
configfile: setup.cfg
plugins: hypothesis-6.132.0
collected 21 items
pyarrow/tests/test_gdb.py ....FF..F...F.FF.....
[100%]
=================================== FAILURES
===================================
_______________________________ test_buffer_heap
_______________________________
gdb_arrow = <pyarrow.tests.test_gdb.GdbSession object at 0x7c9693e23aa0>
def test_buffer_heap(gdb_arrow):
> check_heap_repr(gdb_arrow, "heap_buffer",
'arrow::Buffer of size 3, read-only, "abc"')
pyarrow/tests/test_gdb.py:283:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _
pyarrow/tests/test_gdb.py:245: in check_heap_repr
s = gdb.print_value(f"*{expr}")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _
self = <pyarrow.tests.test_gdb.GdbSession object at 0x7c9693e23aa0>
expr = '*heap_buffer'
def print_value(self, expr):
"""
Ask gdb to print the value of an expression and return the result.
"""
out = self.run_command(f"p {expr}")
out, n = re.subn(r"^\$\d+ = ", "", out)
> assert n == 1, out
E AssertionError:
E assert 0 == 1
pyarrow/tests/test_gdb.py:146: AssertionError
----------------------------- Captured stdout call
-----------------------------
p *heap_buffer
(gdb)
----------------------------- Captured stderr call
-----------------------------
Attempt to take address of value not located in memory.
________________________________ test_decimals
_________________________________
gdb_arrow = <pyarrow.tests.test_gdb.GdbSession object at 0x7c9693e23aa0>
def test_decimals(gdb_arrow):
v128 = "98765432109876543210987654321098765432"
> check_stack_repr(gdb_arrow, "decimal128_zero",
"arrow::Decimal128(0)")
pyarrow/tests/test_gdb.py:291:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _
gdb = <pyarrow.tests.test_gdb.GdbSession object at 0x7c9693e23aa0>
expr = 'decimal128_zero', expected = 'arrow::Decimal128(0)'
def check_stack_repr(gdb, expr, expected):
"""
Check printing a stack-located value.
"""
s = gdb.print_value(expr)
if isinstance(expected, re.Pattern):
assert expected.match(s), s
else:
> assert s == expected
E AssertionError: assert '<optimized out>' ==
'arrow::Decimal128(0)'
E
E - arrow::Decimal128(0)
E + <optimized out>
pyarrow/tests/test_gdb.py:238: AssertionError
----------------------------- Captured stdout call
-----------------------------
p decimal128_zero
$12 = <optimized out>
(gdb)
_______________________________ test_types_heap
________________________________
gdb_arrow = <pyarrow.tests.test_gdb.GdbSession object at 0x7c9693e23aa0>
def test_types_heap(gdb_arrow):
> check_heap_repr(gdb_arrow, "heap_null_type", "arrow::null()")
pyarrow/tests/test_gdb.py:420:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _
pyarrow/tests/test_gdb.py:245: in check_heap_repr
s = gdb.print_value(f"*{expr}")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _
self = <pyarrow.tests.test_gdb.GdbSession object at 0x7c9693e23aa0>
expr = '*heap_null_type'
def print_value(self, expr):
"""
Ask gdb to print the value of an expression and return the result.
"""
out = self.run_command(f"p {expr}")
out, n = re.subn(r"^\$\d+ = ", "", out)
> assert n == 1, out
E AssertionError:
E assert 0 == 1
pyarrow/tests/test_gdb.py:146: AssertionError
----------------------------- Captured stdout call
-----------------------------
p *heap_null_type
(gdb)
----------------------------- Captured stderr call
-----------------------------
Attempt to take address of value not located in memory.
______________________________ test_scalars_heap
_______________________________
gdb_arrow = <pyarrow.tests.test_gdb.GdbSession object at 0x7c9693e23aa0>
def test_scalars_heap(gdb_arrow):
check_heap_repr(gdb_arrow, "heap_null_scalar", "arrow::NullScalar")
> check_heap_repr(gdb_arrow, "heap_bool_scalar",
"arrow::BooleanScalar of value true")
pyarrow/tests/test_gdb.py:732:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _
pyarrow/tests/test_gdb.py:245: in check_heap_repr
s = gdb.print_value(f"*{expr}")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _
self = <pyarrow.tests.test_gdb.GdbSession object at 0x7c9693e23aa0>
expr = '*heap_bool_scalar'
def print_value(self, expr):
"""
Ask gdb to print the value of an expression and return the result.
"""
out = self.run_command(f"p {expr}")
out, n = re.subn(r"^\$\d+ = ", "", out)
> assert n == 1, out
E AssertionError:
E assert 0 == 1
pyarrow/tests/test_gdb.py:146: AssertionError
----------------------------- Captured stdout call
-----------------------------
p *heap_null_scalar
$134 = arrow::NullScalar
(gdb) p *heap_bool_scalar
(gdb)
----------------------------- Captured stderr call
-----------------------------
Attempt to take address of value not located in memory.
______________________________ test_arrays_stack
_______________________________
gdb_arrow = <pyarrow.tests.test_gdb.GdbSession object at 0x7c9693e23aa0>
def test_arrays_stack(gdb_arrow):
> check_stack_repr(
gdb_arrow, "int32_array",
("arrow::Int32Array of length 4, offset 0, null count 1 = "
"{[0] = -5, [1] = 6, [2] = null, [3] = 42}"))
pyarrow/tests/test_gdb.py:761:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _
gdb = <pyarrow.tests.test_gdb.GdbSession object at 0x7c9693e23aa0>
expr = 'int32_array'
expected = 'arrow::Int32Array of length 4, offset 0, null count 1 = {[0] =
-5, [1] = 6, [2] = null, [3] = 42}'
def check_stack_repr(gdb, expr, expected):
"""
Check printing a stack-located value.
"""
s = gdb.print_value(expr)
if isinstance(expected, re.Pattern):
assert expected.match(s), s
else:
> assert s == expected
E AssertionError: assert '<optimized out>' == 'arrow::Int32...ll,
[3] = 42}'
E
E - arrow::Int32Array of length 4, offset 0, null count 1 = {[0]
= -5, [1] = 6, [2] = null, [3] = 42}
E + <optimized out>
pyarrow/tests/test_gdb.py:238: AssertionError
----------------------------- Captured stdout call
-----------------------------
p int32_array
$136 = <optimized out>
(gdb)
_______________________________ test_arrays_heap
_______________________________
gdb_arrow = <pyarrow.tests.test_gdb.GdbSession object at 0x7c9693e23aa0>
def test_arrays_heap(gdb_arrow):
# Null
check_heap_repr(
gdb_arrow, "heap_null_array",
"arrow::NullArray of length 2, offset 0, null count 2")
# Primitive
check_heap_repr(
gdb_arrow, "heap_int32_array",
("arrow::Int32Array of length 4, offset 0, null count 1 = {"
"[0] = -5, [1] = 6, [2] = null, [3] = 42}"))
check_heap_repr(
gdb_arrow, "heap_int32_array_no_nulls",
("arrow::Int32Array of length 4, offset 0, null count 0 = {"
"[0] = -5, [1] = 6, [2] = 3, [3] = 42}"))
check_heap_repr(
gdb_arrow, "heap_int32_array_sliced_1_9",
("arrow::Int32Array of length 9, offset 1, unknown null count =
{"
"[0] = 2, [1] = -3, [2] = 4, [3] = null, [4] = -5, [5] = 6, "
"[6] = -7, [7] = 8, [8] = null}"))
check_heap_repr(
gdb_arrow, "heap_int32_array_sliced_2_6",
("arrow::Int32Array of length 6, offset 2, unknown null count =
{"
"[0] = -3, [1] = 4, [2] = null, [3] = -5, [4] = 6, [5] = -7}"))
check_heap_repr(
gdb_arrow, "heap_int32_array_sliced_8_4",
("arrow::Int32Array of length 4, offset 8, unknown null count =
{"
"[0] = 8, [1] = null, [2] = -9, [3] = -10}"))
check_heap_repr(
gdb_arrow, "heap_int32_array_sliced_empty",
"arrow::Int32Array of length 0, offset 6, unknown null count")
check_heap_repr(
gdb_arrow, "heap_double_array",
("arrow::DoubleArray of length 2, offset 0, null count 1 = {"
"[0] = -1.5, [1] = null}"))
> check_heap_repr(
gdb_arrow, "heap_float16_array",
("arrow::HalfFloatArray of length 2, offset 0, null count 0 = {"
"[0] = 0.0, [1] = -1.5}"))
pyarrow/tests/test_gdb.py:807:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _
pyarrow/tests/test_gdb.py:245: in check_heap_repr
s = gdb.print_value(f"*{expr}")
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
_ _
self = <pyarrow.tests.test_gdb.GdbSession object at 0x7c9693e23aa0>
expr = '*heap_float16_array'
def print_value(self, expr):
"""
Ask gdb to print the value of an expression and return the result.
"""
out = self.run_command(f"p {expr}")
out, n = re.subn(r"^\$\d+ = ", "", out)
> assert n == 1, out
E AssertionError:
E assert 0 == 1
pyarrow/tests/test_gdb.py:146: AssertionError
----------------------------- Captured stdout call
-----------------------------
p *heap_null_array
$137 = arrow::NullArray of length 2, offset 0, null count 2
(gdb) p *heap_int32_array
$138 = arrow::Int32Array of length 4, offset 0, null count 1 = {[0] = -5,
[1] = 6, [2] = null, [3] = 42}
(gdb) p *heap_int32_array_no_nulls
$139 = arrow::Int32Array of length 4, offset 0, null count 0 = {[0] = -5,
[1] = 6, [2] = 3, [3] = 42}
(gdb) p *heap_int32_array_sliced_1_9
$140 = arrow::Int32Array of length 9, offset 1, unknown null count = {[0] =
2, [1] = -3, [2] = 4, [3] = null, [4] = -5, [5] = 6, [6] = -7, [7] = 8, [8] =
null}
(gdb) p *heap_int32_array_sliced_2_6
$141 = arrow::Int32Array of length 6, offset 2, unknown null count = {[0] =
-3, [1] = 4, [2] = null, [3] = -5, [4] = 6, [5] = -7}
(gdb) p *heap_int32_array_sliced_8_4
$142 = arrow::Int32Array of length 4, offset 8, unknown null count = {[0] =
8, [1] = null, [2] = -9, [3] = -10}
(gdb) p *heap_int32_array_sliced_empty
$143 = arrow::Int32Array of length 0, offset 6, unknown null count
(gdb) p *heap_double_array
$144 = arrow::DoubleArray of length 2, offset 0, null count 1 = {[0] = -1.5,
[1] = null}
(gdb) p *heap_float16_array
(gdb)
----------------------------- Captured stderr call
-----------------------------
Attempt to take address of value not located in memory.
=========================== short test summary info
============================
FAILED pyarrow/tests/test_gdb.py::test_buffer_heap - AssertionError:
FAILED pyarrow/tests/test_gdb.py::test_decimals - AssertionError: assert
'<optimized out>' == 'arrow::Decimal128(0)'
FAILED pyarrow/tests/test_gdb.py::test_types_heap - AssertionError:
FAILED pyarrow/tests/test_gdb.py::test_scalars_heap - AssertionError:
FAILED pyarrow/tests/test_gdb.py::test_arrays_stack - AssertionError: assert
'<optimized out>' == 'arrow::Int32...ll, [3] = 42}'
FAILED pyarrow/tests/test_gdb.py::test_arrays_heap - AssertionError:
======================== 6 failed, 15 passed in 48.64s
=========================
```
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]