{"action":"opened","issue":{"url":"https://api.github.com/repos/numpy/numpy/issues/12031","repository_url":"https://api.github.com/repos/numpy/numpy","labels_url":"https://api.github.com/repos/numpy/numpy/issues/12031/labels{/name}","comments_url":"https://api.github.com/repos/numpy/numpy/issues/12031/comments","events_url":"https://api.github.com/repos/numpy/numpy/issues/12031/events","html_url":"https://github.com/numpy/numpy/issues/12031","id":363452188,"node_id":"MDU6SXNzdWUzNjM0NTIxODg=","number":12031,"title":"Segmentation fault PyArray_ConvertToCommonType.(NULL pointer derference)","user":{"login":"xcainiao","id":18696108,"node_id":"MDQ6VXNlcjE4Njk2MTA4","avatar_url":"https://avatars0.githubusercontent.com/u/18696108?v=4","gravatar_id":"","url":"https://api.github.com/users/xcainiao","html_url":"https://github.com/xcainiao","followers_url":"https://api.github.com/users/xcainiao/followers","following_url":"https://api.github.com/users/xcainiao/following{/other_user}","gists_url":"https://api.github.com/users/xcainiao/gists{/gist_id}","starred_url":"https://api.github.com/users/xcainiao/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/xcainiao/subscriptions","organizations_url":"https://api.github.com/users/xcainiao/orgs","repos_url":"https://api.github.com/users/xcainiao/repos","events_url":"https://api.github.com/users/xcainiao/events{/privacy}","received_events_url":"https://api.github.com/users/xcainiao/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-09-25T07:51:18Z","updated_at":"2018-09-25T07:51:18Z","closed_at":null,"author_association":"NONE","body":"NULL pointer derference in PyArray_ConvertToCommonType\r\n```\r\nimport numpy\r\nnumpy.half(-1).choose(numpy.void(1), numpy.broadcast_arrays((1,)))\r\n```\r\ngdb info\r\n```\r\n[----------------------------------registers-----------------------------------]\r\nRAX: 0xc0400001756 --> 0x0 \r\nRBX: 0x0 \r\nRCX: 0x0 \r\nRDX: 0xffffdad7614 --> 0x0 \r\nRSI: 0x2 \r\nRDI: 0xc03700 --> 0x24c3 \r\nRBP: 0x7fffed6bb0a0 --> 0x3 \r\nRSP: 0x7fffffffcf30 --> 0xffffffff9ec --> 0x0 \r\nRIP: 0x7ffff2803769 (<PyArray_ConvertToCommonType+1865>:\tadd    QWORD PTR [rbx],0x1)\r\nR8 : 0x501 \r\nR9 : 0x7ffff3ac653d --> 0xfff7eafeb000006e \r\nR10: 0x5 \r\nR11: 0x7fffffffce30 --> 0xbe90a0 --> 0xb ('\\x0b')\r\nR12: 0x0 \r\nR13: 0x60200000bab0 --> 0x0 \r\nR14: 0x0 \r\nR15: 0x0\r\nEFLAGS: 0x10246 (carry PARITY adjust ZERO sign trap INTERRUPT direction overflow)\r\n[-------------------------------------code-------------------------------------]\r\n   0x7ffff2803755 <PyArray_ConvertToCommonType+1845>:\tje     0x7ffff28039f0 <PyArray_ConvertToCommonType+2512>\r\n   0x7ffff280375b <PyArray_ConvertToCommonType+1851>:\tcmp    BYTE PTR [r15+0x7fff8000],0x0\r\n   0x7ffff2803763 <PyArray_ConvertToCommonType+1859>:\tjne    0x7ffff2804188 <PyArray_ConvertToCommonType+4456>\r\n=> 0x7ffff2803769 <PyArray_ConvertToCommonType+1865>:\tadd    QWORD PTR [rbx],0x1\r\n   0x7ffff280376d <PyArray_ConvertToCommonType+1869>:\txor    ecx,ecx\r\n   0x7ffff280376f <PyArray_ConvertToCommonType+1871>:\txor    r9d,r9d\r\n   0x7ffff2803772 <PyArray_ConvertToCommonType+1874>:\txor    edx,edx\r\n   0x7ffff2803774 <PyArray_ConvertToCommonType+1876>:\tmov    rsi,rbx\r\n[------------------------------------stack-------------------------------------]\r\n0000| 0x7fffffffcf30 --> 0xffffffff9ec --> 0x0 \r\n0008| 0x7fffffffcf38 --> 0x7fffffffd040 --> 0x7fff00000002 \r\n0016| 0x7fffffffcf40 --> 0x7ffff3ace0b0 --> 0x1 \r\n0024| 0x7fffffffcf48 --> 0x7fff00000005 \r\n0032| 0x7fffffffcf50 --> 0x60200000bab0 --> 0x0 \r\n0040| 0x7fffffffcf58 --> 0x0 \r\n0048| 0x7fffffffcf60 --> 0x100000002 --> 0x0 \r\n0056| 0x7fffffffcf68 --> 0x7fffed70f210 --> 0x2 \r\n[------------------------------------------------------------------------------]\r\nLegend: code, data, rodata, value\r\nStopped reason: SIGSEGV\r\n0x00007ffff2803769 in PyArray_ConvertToCommonType (op=op@entry=0x7ffff3ace0b0, retn=retn@entry=0x7fffffffd040) at numpy/core/src/multiarray/convert_datatype.c:2135\r\n2135\tnumpy/core/src/multiarray/convert_datatype.c: No such file or directory.\r\ngdb-peda$ bt\r\n#0  0x00007ffff2803769 in PyArray_ConvertToCommonType (op=op@entry=0x7ffff3ace0b0, retn=retn@entry=0x7fffffffd040) at numpy/core/src/multiarray/convert_datatype.c:2135\r\n#1  0x00007ffff28d3ed3 in PyArray_Choose (ip=ip@entry=0x7fffedb85c10, op=0x7ffff3ace0b0, out=0x0, clipmode=<optimized out>) at numpy/core/src/multiarray/item_selection.c:671\r\n#2  0x00007ffff294f51d in array_choose (self=<optimized out>, args=0x7ffff3ace0b0, kwds=0x0) at numpy/core/src/multiarray/methods.c:1124\r\n#3  0x000000000046da0e in cfunction_call_varargs (kwargs=<optimized out>, args=<optimized out>, func=0x7fffedb90380) at Objects/call.c:753\r\n#4  PyCFunction_Call (func=0x7fffedb90380, args=<optimized out>, kwargs=<optimized out>) at Objects/call.c:784\r\n#5  0x00007ffff29c333b in gentype_generic_method (self=<optimized out>, args=0x7ffff3ace0b0, kwds=0x0, str=<optimized out>) at numpy/core/src/multiarray/scalartypes.c.src:187\r\n#6  0x000000000046b310 in _PyMethodDef_RawFastCallKeywords (method=0x7ffff2cffde0 <gentype_methods+832>, self=self@entry=0x7ffff00cec78, args=args@entry=0x7ffff7eb11b8, nargs=nargs@entry=0x2, \r\n    kwnames=kwnames@entry=0x0) at Objects/call.c:690\r\n#7  0x000000000081403d in _PyMethodDescr_FastCallKeywords (descrobj=descrobj@entry=0x7ffff3a452c0, args=args@entry=0x7ffff7eb11b0, nargs=nargs@entry=0x3, kwnames=kwnames@entry=0x0)\r\n    at Objects/descrobject.c:288\r\n#8  0x00000000004416b2 in call_function (kwnames=0x0, oparg=0x3, pp_stack=<synthetic pointer>) at Python/ceval.c:4600\r\n#9  _PyEval_EvalFrameDefault (f=<optimized out>, throwflag=<optimized out>) at Python/ceval.c:3186\r\n#10 0x00000000005ecfbc in PyEval_EvalFrameEx (throwflag=0x0, f=0x7ffff7eb1040) at Python/ceval.c:536\r\n#11 _PyEval_EvalCodeWithName (_co=_co@entry=0x7ffff7eb7b70, globals=globals@entry=0x7ffff7eb11a8, locals=locals@entry=0x7ffff7eb7bc8, args=args@entry=0x0, argcount=argcount@entry=0x0, \r\n    kwnames=kwnames@entry=0x0, kwargs=0x0, kwcount=0x0, kwstep=0x2, defs=0x0, defcount=0x0, kwdefs=0x0, closure=0x0, name=0x0, qualname=0x0) at Python/ceval.c:3951\r\n#12 0x00000000005ed4d3 in PyEval_EvalCodeEx (closure=0x0, kwdefs=0x0, defcount=0x0, defs=0x0, kwcount=0x0, kws=0x0, argcount=0x0, args=0x0, locals=locals@entry=0x7ffff7eb7bc8, \r\n    globals=globals@entry=0x7ffff7eb11a8, _co=_co@entry=0x7ffff7eb7b70) at Python/ceval.c:3980\r\n#13 PyEval_EvalCode (co=co@entry=0x7ffff7eb7b70, globals=globals@entry=0x7ffff7ef6080, locals=locals@entry=0x7ffff7ef6080) at Python/ceval.c:513\r\n#14 0x0000000000687cdd in run_mod (arena=0x7ffff7f72078, flags=0x7fffffffda60, locals=0x7ffff7ef6080, globals=0x7ffff7ef6080, filename=0x7ffff7e6cb90, mod=0x625000020ce0) at Python/pythonrun.c:1031\r\n#15 PyRun_FileExFlags (fp=<optimized out>, filename_str=<optimized out>, start=<optimized out>, globals=<optimized out>, locals=<optimized out>, closeit=<optimized out>, flags=0x7fffffffda60)\r\n    at Python/pythonrun.c:984\r\n#16 0x000000000068817b in PyRun_SimpleFileExFlags (fp=<optimized out>, filename=0x7ffff7e88f50 \"poc2.py\", closeit=0x1, flags=<optimized out>) at Python/pythonrun.c:425\r\n#17 0x000000000044d9a4 in pymain_run_file (config=0x61e00000f108, cf=0x7fffffffda60, pymain=0x7fffffffdc60) at Modules/main.c:1159\r\n#18 pymain_run_python (interp=0x61e00000f080, pymain=0x7fffffffdc60) at Modules/main.c:1607\r\n#19 pymain_main (pymain=pymain@entry=0x7fffffffdc60) at Modules/main.c:1755\r\n#20 0x000000000044e39c in _Py_UnixMain (argc=0x2, argv=0x7fffffffdde8) at Modules/main.c:1792\r\n#21 0x00007ffff6193830 in __libc_start_main (main=0x424060 <main>, argc=0x2, argv=0x7fffffffdde8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7fffffffddd8)\r\n    at ../csu/libc-start.c:291\r\n#22 0x0000000000446229 in _start ()\r\n```\r\n\r\nnumpy.version.version\r\n'1.15.2'\r\n\r\nPython 3.8.0a0 (heads/master:f6c8007, Sep 25 2018, 12:42:29) \r\n[GCC 5.4.0 20160609] on linux"}}
{"actor":{"display_login":"xcainiao"}}