-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Environment
- Qiskit version: 1.1.0rc1 (but also in previous stable versions)
- Python version: 3.12.3
- Operating system: Arch Linux
What is happening?
Some unit tests fail due to symengine crashes. For example, the following five tests from test_circuit_load_from_qpy.py
crash on my system:
test_parameter_expression
test_evolutiongate_param_expr_time
test_parameter_expression_global_phase
test_parameter_vector_element_in_expression
test_symengine_full_path
From the first test, the exact line when the the test crashes is this:
qiskit/qiskit/qpy/binary_io/value.py
Line 58 in 6ff0eb5
expr_bytes = obj._symbol_expr.__reduce__()[1][0] |
Which produces a src/tcmalloc.cc:304] Attempt to free invalid pointer 0x6146ecca5b60
.
How can we reproduce the issue?
Here is a small self-contained script that can replicate the crash described above.
from qiskit.circuit.parameter import Parameter
from qiskit.circuit.parameterexpression import ParameterExpression
theta = Parameter("theta")
phi = Parameter("phi")
sum_param = theta + phi
sum_param._symbol_expr.__reduce__()
# src/tcmalloc.cc:304] Attempt to free invalid pointer 0x645c8e3eaa30
# [1] 987079 IOT instruction (core dumped) python
The following running on the same system works:
import symengine
theta = symengine.Symbol("theta")
phi = symengine.Symbol("phi")
sum_param = theta + phi
sum_param.__reduce__()
What should happen?
Ideally, all unit tests would pass in a clean chroot env on Arch Linux.
Any suggestions?
No response
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working