Skip to content

Commit ea7b9ec

Browse files
committed
fix sigabrt in parfors tests
This fixes a test, where a non-thread safe container is written to during testing To reproduce on at least `linux-64` and `osx-arm64` (and probably others): ``` NUMBA_THREADING_LAYER=workqueue SUBPROC_TEST=1 ./runtests.py -m 32 numba.tests.test_parfors.TestPrangeSpecific.test_tuple_hoisting ``` On `linux-64`, this can be debugged with `gdb`: ``` (gdb) bt closure____locals______listcomp____v15____v2build__list__0=...) at <string>:4438 ``` On `osx-arm64` we can use `lldb`: ``` (lldb) run runtests.py -m 32 numba.tests.test_parfors.TestPrangeSpecific.test_tuple_hoisting Process 13575 launched: '/Users/esc/miniconda3-arm64/envs/numba_3.9/bin/python3' (arm64) Parallel: 0. Serial: 1 python3(13575,0x17025b000) malloc: Non-aligned pointer 0x600000256880 being freed (2) python3(13575,0x17025b000) malloc: *** set a breakpoint in malloc_error_break to debug Process 13575 stopped * thread numba#18, stop reason = signal SIGABRT frame #0: 0x000000019c35c704 libsystem_kernel.dylib`__pthread_kill + 8 libsystem_kernel.dylib`: -> 0x19c35c704 <+8>: b.lo 0x19c35c724 ; <+40> 0x19c35c708 <+12>: pacibsp 0x19c35c70c <+16>: stp x29, x30, [sp, #-0x10]! 0x19c35c710 <+20>: mov x29, sp Target 0: (python3) stopped. (lldb) bt * thread numba#18, stop reason = signal SIGABRT * frame #0: 0x000000019c35c704 libsystem_kernel.dylib`__pthread_kill + 8 frame #1: 0x000000019c393c28 libsystem_pthread.dylib`pthread_kill + 288 frame #2: 0x000000019c2a1ae8 libsystem_c.dylib`abort + 180 frame #3: 0x000000019c1c2e28 libsystem_malloc.dylib`malloc_vreport + 908 frame #4: 0x000000019c1d95d4 libsystem_malloc.dylib`malloc_zone_error + 104 frame #5: 0x000000019c1ca620 libsystem_malloc.dylib`_szone_free + 628 frame #6: 0x000000019c1b87f4 libsystem_malloc.dylib`nanov2_realloc + 356 frame #7: 0x000000019c1b85a4 libsystem_malloc.dylib`malloc_zone_realloc + 112 frame numba#8: 0x000000019c1b7110 libsystem_malloc.dylib`realloc + 388 frame numba#9: 0x000000013a9ff0f8 _nrt_python.cpython-39-darwin.so`NRT_MemInfo_varsize_realloc + 60 frame numba#10: 0x000000013d4f41e0 frame numba#11: 0x000000019c393fa8 libsystem_pthread.dylib`_pthread_start + 148 ```
1 parent 68c0f85 commit ea7b9ec

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎numba/tests/test_parfors.py‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4444,7 +4444,7 @@ def test_impl(inputs):
44444444
return outputs[0][1][0]
44454445

44464446
N = config.NUMBA_NUM_THREADS + 1
4447-
self.prange_tester(test_impl, [Dict.empty(key_type=types.int64, value_type=types.float64) for i in range(N)])
4447+
self.prange_tester(test_impl, [Dict.empty(key_type=types.int64, value_type=types.float64) for i in range(N)], patch_instance=[1])
44484448

44494449
def test_call_hoisting(self):
44504450
# issue9529
@@ -4458,7 +4458,7 @@ def test_impl(inputs):
44584458
return outputs[0][1][0]
44594459

44604460
N = config.NUMBA_NUM_THREADS + 1
4461-
self.prange_tester(test_impl, [Dict.empty(key_type=types.int64, value_type=types.float64) for i in range(N)])
4461+
self.prange_tester(test_impl, [Dict.empty(key_type=types.int64, value_type=types.float64) for i in range(N)], patch_instance=[1])
44624462

44634463
def test_record_array_setitem(self):
44644464
# issue6704

0 commit comments

Comments
 (0)