Skip to content

Instantly share code, notes, and snippets.

View pitrou's full-sized avatar

Antoine Pitrou pitrou

View GitHub Profile
import numpy as np
from numba import jit, typeof
from numba.compiler import compile_isolated, Flags
def run_func(func, args):
import time
clock = time.process_time
func(*args)
times = []
Program terminated with signal SIGSEGV, Segmentation fault.
#0 NpyIter_Deallocate (iter=0x7f4b5c18a4d0) at numpy/core/src/multiarray/nditer_constr.c:674
674 numpy/core/src/multiarray/nditer_constr.c: Aucun fichier ou dossier de ce type.
(gdb) bt
#0 NpyIter_Deallocate (iter=0x7f4b5c18a4d0) at numpy/core/src/multiarray/nditer_constr.c:674
#1 0x00007f4b68f939c0 in vm_engine_iter_parallel (errmsg=0x7f4b65f4fb40, pc_error=0x7f4b65f512b4, need_output_buffering=<optimized out>, params=...,
iter=0x7f4b580c6840) at numexpr/interpreter.cpp:777
#2 run_interpreter (self=<optimized out>, iter=0x7f4b580c6840, reduce_iter=0x0, reduction_outer_loop=<optimized out>, need_output_buffering=<optimized out>,
pc_error=0x7f4b65f512b4) at numexpr/interpreter.cpp:889
#3 0x00007f4b68f98b75 in NumExpr_run (self=0x7f4b66a3da80, args=0x7f4b00000000, kwds=<optimized out>) at numexpr/interpreter.cpp:1395
$ python -Xfaulthandler pdcrash.py
*** Error in `python': free(): invalid pointer: 0x00007f2980189df0 ***
Fatal Python error: Aborted
Thread 0x00007f297affd700 (most recent call first):
File "pdcrash.py", line 8 in let_crash
File "/home/antoine/35/lib/python3.5/threading.py", line 862 in run
File "/home/antoine/35/lib/python3.5/threading.py", line 914 in _bootstrap_inner
File "/home/antoine/35/lib/python3.5/threading.py", line 882 in _bootstrap
.LBB0_8:
movsd (%rsi), %xmm4
movsd (%rdx), %xmm6
andpd %xmm0, %xmm4
andpd %xmm0, %xmm6
movapd %xmm6, %xmm5
maxsd %xmm4, %xmm5
minsd %xmm6, %xmm4
movaps %xmm5, %xmm6
subsd %xmm6, %xmm6
@pitrou
pitrou / gist:9761f83421170ba38d74
Created December 22, 2015 13:29
Windows VM setup quick list
- disable automatic updates
- disable swapfile
- disable snapshots
- disable hibernation ("powercfg -h off")
- disable periodic defragmentation
Useful tools:
- dexpot
- firefox
- notepad++
======================================================================
ERROR: test_set_a (numba.cuda.tests.cudapy.test_record_dtype.TestRecordDtypeWithStructArrays)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/antoine/numba/numba/cuda/tests/cudapy/test_record_dtype.py", line 144, in test_set_a
self._test_set_equal(set_a, 3.1415, types.float64)
File "/home/antoine/numba/numba/cuda/tests/cudapy/test_record_dtype.py", line 138, in _test_set_equal
pyfunc(expect, i, value)
File "/home/antoine/numba/numba/cuda/tests/cudapy/test_record_dtype.py", line 12, in set_a
ary[i].a = v
======================================================================
ERROR: test_set_a (__main__.TestRecordDtypeWithStructArrays)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/antoine/numba/numba/cuda/tests/cudapy/test_record_dtype.py", line 144, in test_set_a
self._test_set_equal(set_a, 3.1415, types.float64)
File "/home/antoine/numba/numba/cuda/tests/cudapy/test_record_dtype.py", line 138, in _test_set_equal
pyfunc(expect, i, value)
File "/home/antoine/numba/numba/cuda/tests/cudapy/test_record_dtype.py", line 12, in set_a
ary[i].a = v
# tests for numba-0.21.0-np17py27_363 (this is a generated file)
from __future__ import absolute_import, division, print_function
import sys
import subprocess
from distutils.spawn import find_executable
import shlex
def call_args(string):
args = shlex.split(string)
$ nm --defined-only mode.cpython-34m.so
0000000000206b10 B __bss_start
0000000000003250 t closure_dealloc
0000000000002df0 t closure_traverse
0000000000206600 d ClosureType
0000000000206b40 b completed.7291
00000000000043d0 r .const.Fatal_error:_missing__dynfunc.Closure
0000000000004400 r .const.missing_Environment
0000000000004465 r .const.mode
0000000000205d18 d .const.picklebuf.140270556335688
diff --git a/numba/cuda/tests/cudapy/test_record_dtype.py b/numba/cuda/tests/cudapy/test_record_dtype.py
index cbe44c1..a457b04 100644
--- a/numba/cuda/tests/cudapy/test_record_dtype.py
+++ b/numba/cuda/tests/cudapy/test_record_dtype.py
@@ -127,8 +127,11 @@ class TestRecordDtype(unittest.TestCase):
for i in range(self.sample1d.size):
got = self.sample1d.copy()
- expect = np.recarray(got.shape, got.dtype)
- expect[:] = got