Skip to content

Run tests in debug mode in an additional CI job #1145

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 10 commits into from
Closed

Conversation

bdraco
Copy link
Member

@bdraco bdraco commented Apr 10, 2025

✅ What This Does

  • Adds additional CI runners to catch issues like #1143.
  • These new runners are designed to supplement the existing runners:
    • They do not track coverage.
    • They are intended for quick validation:
      • Ensure a debug build compiles.
      • Ensure the test suite passes.
      • Keep CI runtime impact minimal.

🔧 New Environment Variable

The MULTIDICT_DEBUG_BUILD environment variable is now available to enable a debug build.

Copy link

codspeed-hq bot commented Apr 10, 2025

CodSpeed Performance Report

Merging #1145 will not alter performance

Comparing debug_runners (91845a8) with master (57c09c0)

Summary

✅ 244 untouched benchmarks

@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Apr 10, 2025
@bdraco bdraco changed the title Run tests in debug mode Run tests in debug mode in an additional CI job Apr 10, 2025
@bdraco bdraco marked this pull request as ready for review April 10, 2025 08:57
@bdraco
Copy link
Member Author

bdraco commented Apr 10, 2025

@asvetlov Looks like a segfault when running 3.9/3.10 with debug turned on as well

bdraco and others added 3 commits April 9, 2025 23:06
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
Co-authored-by: 🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко) <[email protected]>
@asvetlov
Copy link
Member

I think we should test everything in both debug and release modes.
It means just adding debug: ['N', 'Y'] to build matrix in test job.
Sure, it doubles the CI time, but we can skip something easily otherwise.

Consider the following snippet:

#ifdef NDEBUG
#error release mode generic error
#endif
#ifndef NDEBUG
#error debug mode generic error
#endif

#ifdef _MSC_VER
#ifdef NDEBUG
#error release mode error, Windows build
#endif
#ifndef NDEBUG
#error debug mode error, Windows build
#endif
#endif

@asvetlov
Copy link
Member

asvetlov commented Apr 10, 2025

@asvetlov Looks like a segfault when running 3.9/3.10 with debug turned on as well

Sorry, I don't see a failed action run. Where is the segfault?

bdraco added a commit that referenced this pull request Apr 10, 2025
alternative to #1145 that uses
the existing matrix
@bdraco bdraco closed this Apr 10, 2025
@bdraco bdraco reopened this Apr 10, 2025
@bdraco
Copy link
Member Author

bdraco commented Apr 10, 2025

Looks like it come from multidict_keysview_sub

#5 0x00007f35c3b9aec2 in __GI___assert_fail (assertion=0x7f35c21cc0c0 "PyType_HasFeature(tp, Py_TPFLAGS_HEAPTYPE)", file=0x7f35c21cc095 "multidict/_multilib/state.h", line=51,

#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
        tid = <optimized out>
        ret = 0
        pd = <optimized out>
        old_mask = {__val = {28}}
        ret = <optimized out>
#1  0x00007f35c3bf0f4f in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
No locals.
#2  0x00007f35c3ba1fb2 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
        ret = <optimized out>
#3  0x00007f35c3b8c472 in __GI_abort () at ./stdlib/abort.c:79
        save_stage = 1
        act = {__sigaction_handler = {sa_handler = 0x20, sa_sigaction = 0x20}, sa_mask = {__val = {51, 94676347596224, 18, 7, 94676342474896, 3235748504, 0, 140727763463704, 
              15145290771156880640, 5, 18446744073709551488, 0, 139868866658453, 51, 139868866658496, 28}}, sa_flags = -1010831537, sa_restorer = 0x7f35c3cfd47c <_nl_C_name>}
#4  0x00007f35c3b8c395 in __assert_fail_base (fmt=0x7f35c3d00a90 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
    assertion=assertion@entry=0x7f35c21cc0c0 "PyType_HasFeature(tp, Py_TPFLAGS_HEAPTYPE)", file=file@entry=0x7f35c21cc095 "multidict/_multilib/state.h", line=line@entry=51, 
    function=function@entry=0x7f35c21cd140 <__PRETTY_FUNCTION__.18> "PyType_GetModuleByDef") at ./assert/assert.c:94
        str = 0x561b8e112dc0 "\262\240\253\357\036V"
        total = 4096
#5  0x00007f35c3b9aec2 in __GI___assert_fail (assertion=0x7f35c21cc0c0 "PyType_HasFeature(tp, Py_TPFLAGS_HEAPTYPE)", file=0x7f35c21cc095 "multidict/_multilib/state.h", line=51, 
    function=0x7f35c21cd140 <__PRETTY_FUNCTION__.18> "PyType_GetModuleByDef") at ./assert/assert.c:103
No locals.
#6  0x00007f35c21bfbf2 in PyType_GetModuleByDef (tp=0x7f35c4089e00 <PySet_Type>, def=0x7f35c21d1300 <multidict_module>) at multidict/_multilib/state.h:51
        mod_def = 0x7f35c225e840
        __PRETTY_FUNCTION__ = "PyType_GetModuleByDef"
        mod = <module at remote 0x7f35c225e840>
        mro = <unknown at remote 0x7ffdbc59ef20>
        n = 139868866607980
#7  0x00007f35c21bff20 in get_mod_state_by_def_checked (
    self={<multidict._multidict.istr at remote 0x7f35c0dff690>, <multidict._multidict.istr at remote 0x7f35c0dffe10>, <multidict._multidict.istr at remote 0x7f35c0dfe790>, <multidict._multidict.istr at remote 0x7f35c0dff270>, <multidict._multidict.istr at remote 0x7f35c0dfeeb0>, <multidict._multidict.istr at remote 0x7f35c0dff9f0>, <multidict._multidict.istr at remote 0x7f35c0dffed0>, <multidict._multidict.istr at remote 0x7f35c0dff330>, <multidict._multidict.istr at remote 0x7f35c0dff990>, <multidict._multidict.istr at remote 0x7f35c0dfe490>, <multidict._multidict.istr at remote 0x7f35c0dfe6d0>, <multidict._multidict.istr at remote 0x7f35c0dff5d0>, <multidict._multidict.istr at remote 0x7f35c0dfe970>, <multidict._multidict.istr at remote 0x7f35c0dff0f0>, <multidict._multidict.istr at remote 0x7f35c0dffc90>, <multidict._multidict.istr at remote 0x7f35c0dfe4f0>, <multidict._multidict.istr at remote 0x7f35c0dfec70>, <multidict._multidict.istr at remote 0x7f35c0dff810>, <multidict._multidict.istr at remote 0x7f35c0dffcf0...(truncated), ret=0x7ffdbc59ef70) at multidict/_multilib/state.h:102
        tp = 0x7f35c4089e00 <PySet_Type>
        mod = {<multidict._multidict.istr at remote 0x7f35c0dfd530>, <multidict._multidict.istr at remote 0x7f35c0dfcdb0>, <multidict._multidict.istr at remote 0x7f35c0dfdef0>, <multidict._multidict.istr at remote 0x7f35c0dfd830>, <multidict._multidict.istr at remote 0x7f35c0dfde90>, <multidict._multidict.istr at remote 0x7f35c0dfd290>, <multidict._multidict.istr at remote 0x7f35c0dfcc90>, <multidict._multidict.istr at remote 0x7f35c0dfce70>, <multidict._multidict.istr at remote 0x7f35c0dfd1d0>, <multidict._multidict.istr at remote 0x7f35c0dfd710>, <multidict._multidict.istr at remote 0x7f35c0dfde30>, <multidict._multidict.istr at remote 0x7f35c0dfd110>, <multidict._multidict.istr at remote 0x7f35c0dfdbf0>, <multidict._multidict.istr at remote 0x7f35c0dfdad0>, <multidict._multidict.istr at remote 0x7f35c0dfd9b0>, <multidict._multidict.istr at remote 0x7f35c0dfd0b0>, <multidict._multidict.istr at remote 0x7f35c0dfd770>, <multidict._multidict.istr at remote 0x7f35c0dfd410>, <multidict._multidict.istr at remote 0x7f35c0dfdb90...(truncated)
#8  0x00007f35c21c888c in multidict_keysview_sub (
    lft={<multidict._multidict.istr at remote 0x7f35c0dff690>, <multidict._multidict.istr at remote 0x7f35c0dffe10>, <multidict._multidict.istr at remote 0x7f35c0dfe790>, <multidict._multidict.istr at remote 0x7f35c0dff270>, <multidict._multidict.istr at remote 0x7f35c0dfeeb0>, <multidict._multidict.istr at remote 0x7f35c0dff9f0>, <multidict._multidict.istr at remote 0x7f35c0dffed0>, <multidict._multidict.istr at remote 0x7f35c0dff330>, <multidict._multidict.istr at remote 0x7f35c0dff990>, <multidict._multidict.istr at remote 0x7f35c0dfe490>, <multidict._multidict.istr at remote 0x7f35c0dfe6d0>, <multidict._multidict.istr at remote 0x7f35c0dff5d0>, <multidict._multidict.istr at remote 0x7f35c0dfe970>, <multidict._multidict.istr at remote 0x7f35c0dff0f0>, <multidict._multidict.istr at remote 0x7f35c0dffc90>, <multidict._multidict.istr at remote 0x7f35c0dfe4f0>, <multidict._multidict.istr at remote 0x7f35c0dfec70>, <multidict._multidict.istr at remote 0x7f35c0dff810>, <multidict._multidict.istr at remote 0x7f35c0dffcf0...(truncated), rht=<multidict._multidict._KeysView at remote 0x7f35c0daa1d0>) at multidict/_multilib/views.h:1440
        state = 0x7f35c224e2c0
        tmp = 32565
        __PRETTY_FUNCTION__ = "multidict_keysview_sub"
#9  0x00007f35c3e835d4 in binary_op1 (
--Type <RET> for more, q to quit, c to continue without paging--
    v=v@entry={<multidict._multidict.istr at remote 0x7f35c0dff690>, <multidict._multidict.istr at remote 0x7f35c0dffe10>, <multidict._multidict.istr at remote 0x7f35c0dfe790>, <multidict._multidict.istr at remote 0x7f35c0dff270>, <multidict._multidict.istr at remote 0x7f35c0dfeeb0>, <multidict._multidict.istr at remote 0x7f35c0dff9f0>, <multidict._multidict.istr at remote 0x7f35c0dffed0>, <multidict._multidict.istr at remote 0x7f35c0dff330>, <multidict._multidict.istr at remote 0x7f35c0dff990>, <multidict._multidict.istr at remote 0x7f35c0dfe490>, <multidict._multidict.istr at remote 0x7f35c0dfe6d0>, <multidict._multidict.istr at remote 0x7f35c0dff5d0>, <multidict._multidict.istr at remote 0x7f35c0dfe970>, <multidict._multidict.istr at remote 0x7f35c0dff0f0>, <multidict._multidict.istr at remote 0x7f35c0dffc90>, <multidict._multidict.istr at remote 0x7f35c0dfe4f0>, <multidict._multidict.istr at remote 0x7f35c0dfec70>, <multidict._multidict.istr at remote 0x7f35c0dff810>, <multidict._multidict.istr at remote 0x7f35c0dffcf0...(truncated), w=w@entry=<multidict._multidict._KeysView at remote 0x7f35c0daa1d0>, op_slot=op_slot@entry=8)
    at Objects/abstract.c:899
        x = <optimized out>
        slotv = <optimized out>
        slotw = <optimized out>
#10 0x00007f35c3eacdf6 in binary_op (op_name=0x7f35c3f67744 "-", op_slot=8, w=<multidict._multidict._KeysView at remote 0x7f35c0daa1d0>, 
    v={<multidict._multidict.istr at remote 0x7f35c0dff690>, <multidict._multidict.istr at remote 0x7f35c0dffe10>, <multidict._multidict.istr at remote 0x7f35c0dfe790>, <multidict._multidict.istr at remote 0x7f35c0dff270>, <multidict._multidict.istr at remote 0x7f35c0dfeeb0>, <multidict._multidict.istr at remote 0x7f35c0dff9f0>, <multidict._multidict.istr at remote 0x7f35c0dffed0>, <multidict._multidict.istr at remote 0x7f35c0dff330>, <multidict._multidict.istr at remote 0x7f35c0dff990>, <multidict._multidict.istr at remote 0x7f35c0dfe490>, <multidict._multidict.istr at remote 0x7f35c0dfe6d0>, <multidict._multidict.istr at remote 0x7f35c0dff5d0>, <multidict._multidict.istr at remote 0x7f35c0dfe970>, <multidict._multidict.istr at remote 0x7f35c0dff0f0>, <multidict._multidict.istr at remote 0x7f35c0dffc90>, <multidict._multidict.istr at remote 0x7f35c0dfe4f0>, <multidict._multidict.istr at remote 0x7f35c0dfec70>, <multidict._multidict.istr at remote 0x7f35c0dff810>, <multidict._multidict.istr at remote 0x7f35c0dffcf0...(truncated)) at Objects/abstract.c:930
        result = <optimized out>
        result = <optimized out>
#11 PyNumber_Subtract (
    v={<multidict._multidict.istr at remote 0x7f35c0dff690>, <multidict._multidict.istr at remote 0x7f35c0dffe10>, <multidict._multidict.istr at remote 0x7f35c0dfe790>, <multidict._multidict.istr at remote 0x7f35c0dff270>, <multidict._multidict.istr at remote 0x7f35c0dfeeb0>, <multidict._multidict.istr at remote 0x7f35c0dff9f0>, <multidict._multidict.istr at remote 0x7f35c0dffed0>, <multidict._multidict.istr at remote 0x7f35c0dff330>, <multidict._multidict.istr at remote 0x7f35c0dff990>, <multidict._multidict.istr at remote 0x7f35c0dfe490>, <multidict._multidict.istr at remote 0x7f35c0dfe6d0>, <multidict._multidict.istr at remote 0x7f35c0dff5d0>, <multidict._multidict.istr at remote 0x7f35c0dfe970>, <multidict._multidict.istr at remote 0x7f35c0dff0f0>, <multidict._multidict.istr at remote 0x7f35c0dffc90>, <multidict._multidict.istr at remote 0x7f35c0dfe4f0>, <multidict._multidict.istr at remote 0x7f35c0dfec70>, <multidict._multidict.istr at remote 0x7f35c0dff810>, <multidict._multidict.istr at remote 0x7f35c0dffcf0...(truncated), w=<multidict._multidict._KeysView at remote 0x7f35c0daa1d0>) at Objects/abstract.c:1065
No locals.
#12 0x00007f35c21c8b2d in multidict_keysview_xor (self=0x7f35c0daa1d0, other=<multidict._multidict._KeysView at remote 0x7f35c0daa200>) at multidict/_multilib/views.h:1500
        state = 0x7f35c224e2c0
        tmp = 1
        __PRETTY_FUNCTION__ = "multidict_keysview_xor"
        ret = 0x0
        tmp1 = {<multidict._multidict.istr at remote 0x7f35c0dfd530>, <multidict._multidict.istr at remote 0x7f35c0dfcdb0>, <multidict._multidict.istr at remote 0x7f35c0dfdef0>, <multidict._multidict.istr at remote 0x7f35c0dfd830>, <multidict._multidict.istr at remote 0x7f35c0dfde90>, <multidict._multidict.istr at remote 0x7f35c0dfd290>, <multidict._multidict.istr at remote 0x7f35c0dfcc90>, <multidict._multidict.istr at remote 0x7f35c0dfce70>, <multidict._multidict.istr at remote 0x7f35c0dfd1d0>, <multidict._multidict.istr at remote 0x7f35c0dfd710>, <multidict._multidict.istr at remote 0x7f35c0dfde30>, <multidict._multidict.istr at remote 0x7f35c0dfd110>, <multidict._multidict.istr at remote 0x7f35c0dfdbf0>, <multidict._multidict.istr at remote 0x7f35c0dfdad0>, <multidict._multidict.istr at remote 0x7f35c0dfd9b0>, <multidict._multidict.istr at remote 0x7f35c0dfd0b0>, <multidict._multidict.istr at remote 0x7f35c0dfd770>, <multidict._multidict.istr at remote 0x7f35c0dfd410>, <multidict._multidict.istr at remote 0x7f35c0dfdb90...(truncated)
        tmp2 = 0x0
        rht = {<multidict._multidict.istr at remote 0x7f35c0dff690>, <multidict._multidict.istr at remote 0x7f35c0dffe10>, <multidict._multidict.istr at remote 0x7f35c0dfe790>, <multidict._multidict.istr at remote 0x7f35c0dff270>, <multidict._multidict.istr at remote 0x7f35c0dfeeb0>, <multidict._multidict.istr at remote 0x7f35c0dff9f0>, <multidict._multidict.istr at remote 0x7f35c0dffed0>, <multidict._multidict.istr at remote 0x7f35c0dff330>, <multidict._multidict.istr at remote 0x7f35c0dff990>, <multidict._multidict.istr at remote 0x7f35c0dfe490>, <multidict._multidict.istr at remote 0x7f35c0dfe6d0>, <multidict._multidict.istr at remote 0x7f35c0dff5d0>, <multidict._multidict.istr at remote 0x7f35c0dfe970>, <multidict._multidict.istr at remote 0x7f35c0dff0f0>, <multidict._multidict.istr at remote 0x7f35c0dffc90>, <multidict._multidict.istr at remote 0x7f35c0dfe4f0>, <multidict._multidict.istr at remote 0x7f35c0dfec70>, <multidict._multidict.istr at remote 0x7f35c0dff810>, <multidict._multidict.istr at remote 0x7f35c0dffcf0...(truncated)
#13 0x00007f35c3e834eb in binary_op1 (v=v@entry=<multidict._multidict._KeysView at remote 0x7f35c0daa1d0>, w=w@entry=<multidict._multidict._KeysView at remote 0x7f35c0daa200>, 
    op_slot=op_slot@entry=112) at Objects/abstract.c:891
        x = <optimized out>
        slotv = <optimized out>
        slotw = 0x0
#14 0x00007f35c3eee969 in binary_op (v=<multidict._multidict._KeysView at remote 0x7f35c0daa1d0>, w=<multidict._multidict._KeysView at remote 0x7f35c0daa200>, op_slot=112, 
    op_name=0x7f35c3f66621 "^") at Objects/abstract.c:930
        result = <optimized out>

@bdraco
Copy link
Member Author

bdraco commented Apr 10, 2025

happens with python3 -I -m pytest -vvv tests/test_multidict.py 'tests/test_multidict.py::TestMultiDict::test_and2[c-extension-module-cls0]'

@bdraco
Copy link
Member Author

bdraco commented Apr 10, 2025

failed assert

assert(PyType_HasFeature(tp, Py_TPFLAGS_HEAPTYPE));

root@593c7edc889f:~/multidict# cat repro.py 
from multidict import MultiDict
d = MultiDict([("key", "value1")])
assert {"key"} == {"key", "key2"} & d.keys()
root@593c7edc889f:~/multidict# python3 -I repro.py 
python3: multidict/_multilib/state.h:51: PyType_GetModuleByDef: Assertion `PyType_HasFeature(tp, Py_TPFLAGS_HEAPTYPE)' failed.
Aborted (core dumped)
#0  __pthread_kill_implementation (threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0) at ./nptl/pthread_kill.c:44
#1  0x00007fc0149cbf4f in __pthread_kill_internal (signo=6, threadid=<optimized out>) at ./nptl/pthread_kill.c:78
#2  0x00007fc01497cfb2 in __GI_raise (sig=sig@entry=6) at ../sysdeps/posix/raise.c:26
#3  0x00007fc014967472 in __GI_abort () at ./stdlib/abort.c:79
#4  0x00007fc014967395 in __assert_fail_base (fmt=0x7fc014adba90 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", 
    assertion=assertion@entry=0x7fc0144b60c0 "PyType_HasFeature(tp, Py_TPFLAGS_HEAPTYPE)", file=file@entry=0x7fc0144b6095 "multidict/_multilib/state.h", line=line@entry=51, 
    function=function@entry=0x7fc0144b7140 <__PRETTY_FUNCTION__.18> "PyType_GetModuleByDef") at ./assert/assert.c:94
#5  0x00007fc014975ec2 in __GI___assert_fail (assertion=0x7fc0144b60c0 "PyType_HasFeature(tp, Py_TPFLAGS_HEAPTYPE)", file=0x7fc0144b6095 "multidict/_multilib/state.h", line=51, 
    function=0x7fc0144b7140 <__PRETTY_FUNCTION__.18> "PyType_GetModuleByDef") at ./assert/assert.c:103
#6  0x00007fc0144a9bf2 in PyType_GetModuleByDef (tp=0x7fc014e65e00 <PySet_Type>, def=0x7fc0144bb300 <multidict_module>) at multidict/_multilib/state.h:51
#7  0x00007fc0144a9f20 in get_mod_state_by_def_checked (self={'key', 'key2'}, ret=0x7fff51f845d0) at multidict/_multilib/state.h:102
#8  0x00007fc0144b1b9c in multidict_keysview_and (lft={'key', 'key2'}, rht=<multidict._multidict._KeysView at remote 0x7fc01470fc10>) at multidict/_multilib/views.h:1172
#9  0x00007fc014c5f5d4 in binary_op1 (v=v@entry={'key', 'key2'}, w=w@entry=<multidict._multidict._KeysView at remote 0x7fc01470fc10>, op_slot=op_slot@entry=104) at Objects/abstract.c:899
#10 0x00007fc014c45ff7 in binary_op (op_name=0x7fc014d3f36a "&", op_slot=104, w=<multidict._multidict._KeysView at remote 0x7fc01470fc10>, v={'key', 'key2'}) at Objects/abstract.c:930
#11 PyNumber_And (w=<multidict._multidict._KeysView at remote 0x7fc01470fc10>, v={'key', 'key2'}) at Objects/abstract.c:1062
#12 _PyEval_EvalFrameDefault (tstate=<optimized out>, f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:2145
#13 0x00007fc014c438b3 in _PyEval_EvalFrame (throwflag=0, f=Frame 0x7fc014731a40, for file /root/multidict/repro.py, line 3, in <module> (), tstate=0x561a661580d0)
    at ./Include/internal/pycore_ceval.h:46
#14 _PyEval_Vector (tstate=tstate@entry=0x561a661580d0, con=con@entry=0x7fff51f84860, 
    locals=locals@entry={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <SourceFileLoader(name='__main__', path='/root/multidict/repro.py') at remote 0x7fc014628a90>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7fc0147a0900>, '__file__': '/root/multidict/repro.py', '__cached__': None, 'MultiDict': <type at remote 0x561a6623b260>, 'd': <multidict._multidict.MultiDict at remote 0x561a6623cec0>}, args=args@entry=0x0, argcount=argcount@entry=0, kwnames=kwnames@entry=0x0) at Python/ceval.c:5067
#15 0x00007fc014cba6a0 in PyEval_EvalCode (co=<code at remote 0x7fc014643310>, 
    globals={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <SourceFileLoader(name='__main__', path='/root/multidict/repro.py') at remote 0x7fc014628a90>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7fc0147a0900>, '__file__': '/root/multidict/repro.py', '__cached__': None, 'MultiDict': <type at remote 0x561a6623b260>, 'd': <multidict._multidict.MultiDict at remote 0x561a6623cec0>}, 
    locals={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <SourceFileLoader(name='__main__', path='/root/multidict/repro.py') at remote 0x7fc014628a90>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7fc0147a0900>, '__file__': '/root/multidict/repro.py', '__cached__': None, 'MultiDict': <type at remote 0x561a6623b260>, 'd': <multidict._multidict.MultiDict at remote 0x561a6623cec0>}) at Python/ceval.c:1134
#16 0x00007fc014ccae63 in run_eval_code_obj (tstate=tstate@entry=0x561a661580d0, co=co@entry=0x7fc014643310, 
    globals=globals@entry={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <SourceFileLoader(name='__main__', path='/root/multidict/repro.py') at remote 0x7fc014628a90>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7fc0147a0900>, '__file__': '/root/multidict/repro.py', '__cached__': None, 'MultiDict': <type at remote 0x561a6623b260>, 'd': <multidict._multidict.MultiDict at remote 0x561a6623cec0>}, 
    locals=locals@entry={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <SourceFileLoader(name='__main__', path='/root/multidict/repro.py') at remote 0x7fc014628a90>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7fc0147a0900>, '__file__': '/root/multidict/repro.py', '__cached__': None, 'MultiDict': <type at remote 0x561a6623b260>, 'd': <multidict._multidict.MultiDict at remote 0x561a6623cec0>}) at Python/pythonrun.c:1291
#17 0x00007fc014cc671a in run_mod (mod=mod@entry=0x561a661cbfc8, filename=filename@entry='/root/multidict/repro.py', 
    globals=globals@entry={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <SourceFileLoader(name='__main__', path='/root/multidict/repro.py') at remote 0x7fc014628a90>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7fc0147a0900>, '__file__': '/root/multidict/repro.py', '__cached__': None, 'MultiDict': <type at remote 0x561a6623b260>, 'd': <multidict._multidict.MultiDict at remote 0x561a6623cec0>}, 
    locals=locals@entry={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <SourceFileLoader(name='__main__', path='/root/multidict/repro.py') at remote 0x7fc014628a90>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7fc0147a0900>, '__file__': '/root/multidict/repro.py', '__cached__': None, 'MultiDict': <type at remote 0x561a6623b260>, 'd': <multidict._multidict.MultiDict at remote 0x561a6623cec0>}, flags=flags@entry=0x7fff51f84a58, arena=arena@entry=0x7fc01470bb90) at Python/pythonrun.c:1312
#18 0x00007fc014bb7126 in pyrun_file (fp=fp@entry=0x561a6613b370, filename=filename@entry='/root/multidict/repro.py', start=start@entry=257, 
    globals=globals@entry={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <SourceFileLoader(name='__main__', path='/root/multidict/repro.py') at remote 0x7fc014628a90>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7fc0147a0900>, '__file__': '/root/multidict/repro.py', '__cached__': None, 'MultiDict': <type at remote 0x561a6623b260>, 'd': <multidict._multidict.MultiDict at remote 0x561a6623cec0>}, 
    locals=locals@entry={'__name__': '__main__', '__doc__': None, '__package__': None, '__loader__': <SourceFileLoader(name='__main__', path='/root/multidict/repro.py') at remote 0x7fc014628a90>, '__spec__': None, '__annotations__': {}, '__builtins__': <module at remote 0x7fc0147a0900>, '__file__': '/root/multidict/repro.py', '__cached__': None, 'MultiDict': <type at remote 0x561a6623b260>, 'd': <multidict._multidict.MultiDict at remote 0x561a6623cec0>}, closeit=closeit@entry=1, flags=0x7fff51f84a58) at Python/pythonrun.c:1208
#19 0x00007fc014bb6930 in _PyRun_SimpleFileObject (fp=0x561a6613b370, filename='/root/multidict/repro.py', closeit=1, flags=0x7fff51f84a58) at Python/pythonrun.c:456
#20 0x00007fc014bb8bd9 in _PyRun_AnyFileObject (fp=0x561a6613b370, filename='/root/multidict/repro.py', closeit=1, flags=0x7fff51f84a58) at Python/pythonrun.c:90
#21 0x00007fc014cd7c84 in pymain_run_file_obj (skip_source_first_line=0, filename='/root/multidict/repro.py', program_name='/usr/local/bin/python3') at Modules/main.c:353
--Type <RET> for more, q to quit, c to continue without paging-- 
#22 pymain_run_file (config=0x561a6613c620) at Modules/main.c:372
#23 pymain_run_python (exitcode=0x7fff51f84a54) at Modules/main.c:591
#24 Py_RunMain () at Modules/main.c:670
#25 0x00007fc014cac687 in Py_BytesMain (argc=<optimized out>, argv=<optimized out>) at Modules/main.c:724
#26 0x00007fc01496824a in __libc_start_call_main (main=main@entry=0x561a5c37a140 <main>, argc=argc@entry=3, argv=argv@entry=0x7fff51f84c88) at ../sysdeps/nptl/libc_start_call_main.h:58
#27 0x00007fc014968305 in __libc_start_main_impl (main=0x561a5c37a140 <main>, argc=3, argv=0x7fff51f84c88, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, 
    stack_end=0x7fff51f84c78) at ../csu/libc-start.c:360
#28 0x0000561a5c37a071 in _start ()

@bdraco
Copy link
Member Author

bdraco commented Apr 10, 2025

Python 3.10.17

@bdraco
Copy link
Member Author

bdraco commented Apr 10, 2025

called at

int tmp = get_mod_state_by_def_checked(lft, &state);

left side is a set in
{"key", "key2"} & d.keys() so assert fails

assert(PyType_HasFeature(tp, Py_TPFLAGS_HEAPTYPE));

@asvetlov
Copy link
Member

thanks, I'm looking

@bdraco
Copy link
Member Author

bdraco commented Apr 10, 2025

I used the below to create the env to test in:

docker pull python:3.10
docker run -it --name pydebug python:3.10 /bin/bash

@asvetlov
Copy link
Member

I use Ubuntu, and for me bug reproducing is easier :)

@bdraco
Copy link
Member Author

bdraco commented Apr 10, 2025

I think we should test everything in both debug and release modes. It means just adding debug: ['N', 'Y'] to build matrix in test job. Sure, it doubles the CI time, but we can skip something easily otherwise.

#1146

Alternate version that adjusts the matrix instead

@bdraco
Copy link
Member Author

bdraco commented Apr 10, 2025

00:30 here so I'm off to bed. Feel free to adjust debug mode PRs. Will check back when I get up and moving.

Cheers

@asvetlov
Copy link
Member

Fixed by #1147

Comment on lines +428 to +429
- name: >-
Self-install source
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, source is never installed. Only the contents of wheels are. I think, the following will better communicate what this does.

Suggested change
- name: >-
Self-install source
- name: Compile and install from source checkout


steps:
- name: Checkout project
uses: actions/checkout@v4
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you change this to checkout from sdist instead of Git? It'll mimic what both pip and downstreams do. And this is what we really want not to crash.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue was not about 'cannot build from sdist' but 'cannot build and run tests when debug mode is on'.

I don't think that the installation from sdist makes any difference here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Downstreams tend to additionally package debug symbols.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What symbols? Could you please elaborate how it does related?

path: requirements/pytest.txt
- name: >-
Self-install source
env:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you try setting PIP_CONSTRAINT? This is so the same build deps are used here and when publishing.

@bdraco
Copy link
Member Author

bdraco commented Apr 10, 2025

closing in favor of #1146

@bdraco bdraco closed this Apr 10, 2025
@bdraco bdraco deleted the debug_runners branch April 13, 2025 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot:chronographer:provided There is a change note present in this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants