pybind / pybind11

Seamless operability between C++11 and Python
https://pybind11.readthedocs.io/
Other
15.11k stars 2.05k forks source link

[MAINT] CI / 🐍 3.9-dbg (deadsnakes) β€’ Valgrind β€’ x64: invalid file descriptor # in syscall close() #4889

Open rwgk opened 8 months ago

rwgk commented 8 months ago

Help is needed to diagnose and fix leak diagnostics that suddenly appeared due to unknown changes in the environment ("bit rot").

The log files are permanently archived here: https://github.com/rwgk/issues/tree/master/pybind11/issue_4889

Idea just in case nobody gets to this for a while: Simply try again, just in case the root cause is fixed upstream.

Problem:

============================= test session starts ==============================
platform linux -- Python 3.9.18, pytest-7.2.0, pluggy-1.3.0
C++ Info: 9.4.0 C++17 __pybind11_internals_v4_gcc_libstdcpp_cxxabi1013__ PYBIND11_SIMPLE_GIL_MANAGEMENT=False
rootdir: /home/runner/work/pybind11/pybind11/tests, configfile: pytest.ini
plugins: timeout-2.2.0
timeout: 300.0s
timeout method: signal
timeout func_only: False
collected [85](https://github.com/pybind/pybind11/actions/runs/6526472350/job/17720263281#step:13:86)7 items

--[87](https://github.com/pybind/pybind11/actions/runs/6526472350/job/17720263281#step:13:88)78-- warning: evaluate_Dwarf3_Expr: unhandled DW_OP_ 0xf3
...
../../tests/test_factory_constructors.py ...............                 [ 44%]
==[92](https://github.com/pybind/pybind11/actions/runs/6526472350/job/17720263281#step:13:93)18== Warning: invalid file descriptor 65524 in syscall close()
==9218== Warning: invalid file descriptor 65525 in syscall close()
==9218== Warning: invalid file descriptor 65526 in syscall close()
==9218== Warning: invalid file descriptor 65527 in syscall close()
==9218==    Use --log-fd=<number> to select an alternative log fd.
==9218== Warning: invalid file descriptor 65528 in syscall close()
==9218== Warning: invalid file descriptor 65529 in syscall close()
==9219== Warning: invalid file descriptor 65524 in syscall close()
==9219== Warning: invalid file descriptor 65525 in syscall close()
==9219== Warning: invalid file descriptor 65526 in syscall close()
==9219== Warning: invalid file descriptor 65527 in syscall close()
==9219==    Use --log-fd=<number> to select an alternative log fd.
==9219== Warning: invalid file descriptor 65528 in syscall close()
==9219== Warning: invalid file descriptor 65529 in syscall close()
...
=========================== short test summary info ============================
SKIPPED [1] ../../tests/test_callbacks.py:213: Current PYBIND11_INTERNALS_VERSION too low
SKIPPED [1] ../../tests/test_stl.py:147: no <experimental/optional>
SKIPPED [1] ../../tests/test_stl.py:179: no <boost/optional>
================== 854 passed, 3 skipped in 470.23s (0:07:50) ==================
==8778== 
==8778== HEAP SUMMARY:
==8778==     in use at exit: 5,462,456 bytes in 33,183 blocks
==8778==   total heap usage: 3,241,517 allocs, 3,208,334 frees, 322,998,060 bytes allocated
==8778== 
==8778== 64 bytes in 1 blocks are indirectly lost in loss record 6,168 of 10,745
==8778==    at 0x483B7FB: malloc (vg_replace_malloc.c:307)
==8778==    by 0x46FC97: _PyMem_RawMalloc (obmalloc.c:99)
==8778==    by 0x471298: PyObject_Malloc (obmalloc.c:685)
==8778==    by 0x54A083: _PyObject_GC_Alloc (gcmodule.c:2267)
==8778==    by 0x54AE87: _PyObject_GC_Malloc (gcmodule.c:2294)
==8778==    by 0x54AF42: _PyObject_GC_NewVar (gcmodule.c:2323)
==8778==    by 0x47D87A: tuple_alloc (tupleobject.c:92)
==8778==    by 0x47E5D6: PyTuple_New (tupleobject.c:110)
==8778==    by 0x4E7B2F: _PyEval_EvalFrameDefault (ceval.c:2743)
==8778==    by 0x4EE1A7: _PyEval_EvalFrame (pycore_ceval.h:40)
==8778==    by 0x4EE1A7: _PyEval_EvalCode (ceval.c:4329)
==8778==    by 0x4334B0: _PyFunction_Vectorcall (call.c:396)
==8778==    by 0x4EB835: _PyObject_VectorcallTstate (abstract.h:118)
==8778==    by 0x4EB835: PyObject_Vectorcall (abstract.h:127)
==8778==    by 0x4EB835: call_function (ceval.c:5077)
==8778==    by 0x4EB835: _PyEval_EvalFrameDefault (ceval.c:3506)
==8778== 
{
   <insert_a_suppression_name_here>
   Memcheck:Leak
   match-leak-kinds: indirect
   fun:malloc
   fun:_PyMem_RawMalloc
   fun:PyObject_Malloc
   fun:_PyObject_GC_Alloc
   fun:_PyObject_GC_Malloc
   fun:_PyObject_GC_NewVar
   fun:tuple_alloc
   fun:PyTuple_New
   fun:_PyEval_EvalFrameDefault
   fun:_PyEval_EvalFrame
   fun:_PyEval_EvalCode
   fun:_PyFunction_Vectorcall
   fun:_PyObject_VectorcallTstate
   fun:PyObject_Vectorcall
   fun:call_function
   fun:_PyEval_EvalFrameDefault
}
==8778== LEAK SUMMARY:
==8778==    definitely lost: 0 bytes in 0 blocks
==8778==    indirectly lost: 64 bytes in 1 blocks
==8778==      possibly lost: 4,563,363 bytes in 27,266 blocks
==8778==    still reachable: 745,477 bytes in 3,667 blocks
==8778==         suppressed: 153,552 bytes in 2,249 blocks
==8778== Reachable blocks (those to which a pointer was found) are not shown.
==8778== To see them, rerun with: --leak-check=full --show-leak-kinds=all
==8778== 
==8778== For lists of detected and suppressed errors, rerun with: -s
==8778== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 28 from 27)