[pypy-issue] Issue #2084: PyPy crash on (probably) negative index access (pypy/pypy)

Tobias Pape issues-reply at bitbucket.org
Fri Jul 17 13:58:57 CEST 2015


New issue 2084: PyPy crash on (probably) negative index access
https://bitbucket.org/pypy/pypy/issues/2084/pypy-crash-on-probably-negative-index

Tobias Pape:

Assertion Hit in CPython:

```
Exception: 
Traceback (most recent call last):
  File "targetrsqueak.py", line 320, in <module>
    sys.exit(f(sys.argv))
  File "targetrsqueak.py", line 92, in safe_entry_point
    return entry_point(argv)
  File "targetrsqueak.py", line 232, in entry_point
    w_result = execute_context(interp, context)
  File "targetrsqueak.py", line 304, in execute_context
    return interp.interpret_toplevel(s_frame.w_self())
  File "/Users/tobias/dev/pypy/lang-smalltalk/spyvm/interpreter.py", line 282, in interpret_toplevel
    self.loop(w_frame)
  File "/Users/tobias/dev/pypy/lang-smalltalk/spyvm/interpreter.py", line 125, in loop
    self.stack_frame(s_context, None)
  File "/Users/tobias/dev/pypy/lang-smalltalk/spyvm/interpreter.py", line 150, in stack_frame
    self.loop_bytecodes(s_frame, may_context_switch)
  File "/Users/tobias/dev/pypy/lang-smalltalk/spyvm/interpreter.py", line 189, in loop_bytecodes
    self.step(s_context)
  File "/Users/tobias/dev/pypy/lang-smalltalk/spyvm/interpreter.py", line 223, in step
    return getattr(context, methname)(self, bytecode)
  File "/Users/tobias/dev/pypy/lang-smalltalk/spyvm/interpreter_bytecodes.py", line 35, in bytecode_implementation_wrapper
    return actual_implementation_method(self, interp, current_bytecode, *parameters)
  File "/Users/tobias/dev/pypy/lang-smalltalk/spyvm/interpreter_bytecodes.py", line 457, in returnTopFromMethodBytecode
    return self._return(self.pop(), interp)
  File "/Users/tobias/dev/pypy/lang-smalltalk/spyvm/storage_contexts.py", line 409, in pop
    ret = self.stack_get(ptr)   # you get OverflowError if the stack is empty
  File "/Users/tobias/dev/pypy/lang-smalltalk/spyvm/storage_contexts.py", line 394, in stack_get
    assert index0 >= 0
AssertionError
[12] > /Users/tobias/dev/pypy/lang-smalltalk/spyvm/storage_contexts.py(394)stack_get()
-> assert index0 >= 0
(Pdb++) index0
-1
```

LLDB backtrace for Segfault with pypy (__32bit build OSX__, but also happens on Win32)
(
Python 2.7.9 (9c4588d731b7fe0b08669bd732c2b676cb0a8233, Apr 22 2015, 12:13:28)
[PyPy 2.5.1 with GCC 4.2.1 Compatible Apple LLVM 5.1 (clang-503.0.40)]
)

````
* thread #1: tid = 0x4f719c, 0x0032e2b7 libpypy-c.dylib`pypy_g__flat_pycall__AccessDirect_None + 7, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0xbf7fffec)
    frame #0: 0x0032e2b7 libpypy-c.dylib`pypy_g__flat_pycall__AccessDirect_None + 7
libpypy-c.dylib`pypy_g__flat_pycall__AccessDirect_None + 7:
-> 0x32e2b7:  calll  0x32e2bc                  ; pypy_g__flat_pycall__AccessDirect_None + 12
   0x32e2bc:  popl   %edi
   0x32e2bd:  movl   0x40(%esp), %eax
   0x32e2c1:  movl   0x24(%eax), %ecx
(lldb) bt
* thread #1: tid = 0x4f719c, 0x0032e2b7 libpypy-c.dylib`pypy_g__flat_pycall__AccessDirect_None + 7, queue = 'com.apple.main-thread', stop reason = EXC_BAD_ACCESS (code=2, address=0xbf7fffec)
  * frame #0: 0x0032e2b7 libpypy-c.dylib`pypy_g__flat_pycall__AccessDirect_None + 7
    frame #1: 0x0032d84e libpypy-c.dylib`pypy_g_funccall_valuestack__AccessDirect_None + 350
    frame #2: 0x0030ec38 libpypy-c.dylib`pypy_g_call_valuestack__AccessDirect_None + 552
    frame #3: 0x00863f8d libpypy-c.dylib`pypy_g_CALL_METHOD__AccessDirect_star_1 + 237
    frame #4: 0x00358d54 libpypy-c.dylib`pypy_g_dispatch_bytecode__AccessDirect_None + 13668
    frame #5: 0x00355408 libpypy-c.dylib`pypy_g_handle_bytecode__AccessDirect_None + 72
    frame #6: 0x008004f6 libpypy-c.dylib`pypy_g_portal_3 + 118
    frame #7: 0x00c735a9 libpypy-c.dylib`pypy_g_ll_portal_runner__Unsigned_Bool_pypy_interpreter + 569
    frame #8: 0x0080046f libpypy-c.dylib`pypy_g_PyFrame_dispatch + 47
    frame #9: 0x00349724 libpypy-c.dylib`pypy_g_PyFrame_execute_frame + 1348
    frame #10: 0x00348f3a libpypy-c.dylib`pypy_g_PyFrame_run + 218
    frame #11: 0x0032e564 libpypy-c.dylib`pypy_g__flat_pycall__AccessDirect_None + 692
    frame #12: 0x0032d84e libpypy-c.dylib`pypy_g_funccall_valuestack__AccessDirect_None + 350
    frame #13: 0x0030ec38 libpypy-c.dylib`pypy_g_call_valuestack__AccessDirect_None + 552
    frame #14: 0x00863f8d libpypy-c.dylib`pypy_g_CALL_METHOD__AccessDirect_star_1 + 237
    frame #15: 0x00358d54 libpypy-c.dylib`pypy_g_dispatch_bytecode__AccessDirect_None + 13668
    frame #16: 0x00355408 libpypy-c.dylib`pypy_g_handle_bytecode__AccessDirect_None + 72
    frame #17: 0x008004f6 libpypy-c.dylib`pypy_g_portal_3 + 118
    frame #18: 0x00c735a9 libpypy-c.dylib`pypy_g_ll_portal_runner__Unsigned_Bool_pypy_interpreter + 569
    frame #19: 0x0080046f libpypy-c.dylib`pypy_g_PyFrame_dispatch + 47
    frame #20: 0x00349724 libpypy-c.dylib`pypy_g_PyFrame_execute_frame + 1348
    frame #21: 0x00348f3a libpypy-c.dylib`pypy_g_PyFrame_run + 218
    frame #22: 0x0032e564 libpypy-c.dylib`pypy_g__flat_pycall__AccessDirect_None + 692
    frame #23: 0x0032d84e libpypy-c.dylib`pypy_g_funccall_valuestack__AccessDirect_None + 350
    frame #24: 0x0030ec38 libpypy-c.dylib`pypy_g_call_valuestack__AccessDirect_None + 552
    frame #25: 0x00863f8d libpypy-c.dylib`pypy_g_CALL_METHOD__AccessDirect_star_1 + 237
    frame #26: 0x00358d54 libpypy-c.dylib`pypy_g_dispatch_bytecode__AccessDirect_None + 13668
    frame #27: 0x00355408 libpypy-c.dylib`pypy_g_handle_bytecode__AccessDirect_None + 72
    frame #28: 0x008004f6 libpypy-c.dylib`pypy_g_portal_3 + 118
    frame #29: 0x00c735a9 libpypy-c.dylib`pypy_g_ll_portal_runner__Unsigned_Bool_pypy_interpreter + 569
    frame #30: 0x0080046f libpypy-c.dylib`pypy_g_PyFrame_dispatch + 47
    frame #31: 0x00349724 libpypy-c.dylib`pypy_g_PyFrame_execute_frame + 1348
    frame #32: 0x00348f3a libpypy-c.dylib`pypy_g_PyFrame_run + 218
    frame #33: 0x0032e564 libpypy-c.dylib`pypy_g__flat_pycall__AccessDirect_None + 692
    frame #34: 0x0032d84e libpypy-c.dylib`pypy_g_funccall_valuestack__AccessDirect_None + 350
    frame #35: 0x0030ec38 libpypy-c.dylib`pypy_g_call_valuestack__AccessDirect_None + 552
    frame #36: 0x0035de8c libpypy-c.dylib`pypy_g_CALL_FUNCTION__AccessDirect_None + 124
    frame #37: 0x0035887a libpypy-c.dylib`pypy_g_dispatch_bytecode__AccessDirect_None + 12426
    frame #38: 0x00355408 libpypy-c.dylib`pypy_g_handle_bytecode__AccessDirect_None + 72
    frame #39: 0x008004f6 libpypy-c.dylib`pypy_g_portal_3 + 118
    frame #40: 0x00c735a9 libpypy-c.dylib`pypy_g_ll_portal_runner__Unsigned_Bool_pypy_interpreter + 569
    frame #41: 0x0080046f libpypy-c.dylib`pypy_g_PyFrame_dispatch + 47
    frame #42: 0x00349724 libpypy-c.dylib`pypy_g_PyFrame_execute_frame + 1348
    frame #43: 0x00348f3a libpypy-c.dylib`pypy_g_PyFrame_run + 218
    frame #44: 0x0032e564 libpypy-c.dylib`pypy_g__flat_pycall__AccessDirect_None + 692
    frame #45: 0x0032d84e libpypy-c.dylib`pypy_g_funccall_valuestack__AccessDirect_None + 350
    frame #46: 0x0030ec38 libpypy-c.dylib`pypy_g_call_valuestack__AccessDirect_None + 552
    frame #47: 0x00863f8d libpypy-c.dylib`pypy_g_CALL_METHOD__AccessDirect_star_1 + 237
    frame #48: 0x00358d54 libpypy-c.dylib`pypy_g_dispatch_bytecode__AccessDirect_None + 13668
    frame #49: 0x00355408 libpypy-c.dylib`pypy_g_handle_bytecode__AccessDirect_None + 72
    frame #50: 0x008004f6 libpypy-c.dylib`pypy_g_portal_3 + 118
    frame #51: 0x00c735a9 libpypy-c.dylib`pypy_g_ll_portal_runner__Unsigned_Bool_pypy_interpreter + 569
    frame #52: 0x0080046f libpypy-c.dylib`pypy_g_PyFrame_dispatch + 47
    frame #53: 0x00349724 libpypy-c.dylib`pypy_g_PyFrame_execute_frame + 1348
    frame #54: 0x00348f3a libpypy-c.dylib`pypy_g_PyFrame_run + 218
    frame #55: 0x0034175e libpypy-c.dylib`pypy_g_PyCode_funcrun + 670
    frame #56: 0x00326984 libpypy-c.dylib`pypy_g_Function_call_args + 68
    frame #57: 0x008645ee libpypy-c.dylib`pypy_g_CALL_METHOD__AccessDirect_star_1 + 1870
    frame #58: 0x00358d54 libpypy-c.dylib`pypy_g_dispatch_bytecode__AccessDirect_None + 13668
    frame #59: 0x00355408 libpypy-c.dylib`pypy_g_handle_bytecode__AccessDirect_None + 72
    frame #60: 0x008004f6 libpypy-c.dylib`pypy_g_portal_3 + 118
    frame #61: 0x00c735a9 libpypy-c.dylib`pypy_g_ll_portal_runner__Unsigned_Bool_pypy_interpreter + 569
    frame #62: 0x0080046f libpypy-c.dylib`pypy_g_PyFrame_dispatch + 47
    frame #63: 0x00349724 libpypy-c.dylib`pypy_g_PyFrame_execute_frame + 1348
    frame #64: 0x00348f3a libpypy-c.dylib`pypy_g_PyFrame_run + 218
    frame #65: 0x0032e564 libpypy-c.dylib`pypy_g__flat_pycall__AccessDirect_None + 692
    frame #66: 0x0032d84e libpypy-c.dylib`pypy_g_funccall_valuestack__AccessDirect_None + 350
    frame #67: 0x0030ec38 libpypy-c.dylib`pypy_g_call_valuestack__AccessDirect_None + 552
    frame #68: 0x00863f8d libpypy-c.dylib`pypy_g_CALL_METHOD__AccessDirect_star_1 + 237
    frame #69: 0x00358d54 libpypy-c.dylib`pypy_g_dispatch_bytecode__AccessDirect_None + 13668
    frame #70: 0x00355408 libpypy-c.dylib`pypy_g_handle_bytecode__AccessDirect_None + 72
    frame #71: 0x008004f6 libpypy-c.dylib`pypy_g_portal_3 + 118
    frame #72: 0x00c735a9 libpypy-c.dylib`pypy_g_ll_portal_runner__Unsigned_Bool_pypy_interpreter + 569
    frame #73: 0x0080046f libpypy-c.dylib`pypy_g_PyFrame_dispatch + 47
    frame #74: 0x00349724 libpypy-c.dylib`pypy_g_PyFrame_execute_frame + 1348
    frame #75: 0x00348f3a libpypy-c.dylib`pypy_g_PyFrame_run + 218
    frame #76: 0x0032e564 libpypy-c.dylib`pypy_g__flat_pycall__AccessDirect_None + 692
    frame #77: 0x0032d84e libpypy-c.dylib`pypy_g_funccall_valuestack__AccessDirect_None + 350
    frame #78: 0x0030ec38 libpypy-c.dylib`pypy_g_call_valuestack__AccessDirect_None + 552
    frame #79: 0x00863f8d libpypy-c.dylib`pypy_g_CALL_METHOD__AccessDirect_star_1 + 237
    frame #80: 0x00358d54 libpypy-c.dylib`pypy_g_dispatch_bytecode__AccessDirect_None + 13668
    frame #81: 0x00355408 libpypy-c.dylib`pypy_g_handle_bytecode__AccessDirect_None + 72
    frame #82: 0x008004f6 libpypy-c.dylib`pypy_g_portal_3 + 118
    frame #83: 0x00c735a9 libpypy-c.dylib`pypy_g_ll_portal_runner__Unsigned_Bool_pypy_interpreter + 569
    frame #84: 0x0080046f libpypy-c.dylib`pypy_g_PyFrame_dispatch + 47
    frame #85: 0x00349724 libpypy-c.dylib`pypy_g_PyFrame_execute_frame + 1348
    frame #86: 0x00348f3a libpypy-c.dylib`pypy_g_PyFrame_run + 218
    frame #87: 0x0032e564 libpypy-c.dylib`pypy_g__flat_pycall__AccessDirect_None + 692
    frame #88: 0x0032d84e libpypy-c.dylib`pypy_g_funccall_valuestack__AccessDirect_None + 350
    frame #89: 0x0030ec38 libpypy-c.dylib`pypy_g_call_valuestack__AccessDirect_None + 552
    frame #90: 0x00863f8d libpypy-c.dylib`pypy_g_CALL_METHOD__AccessDirect_star_1 + 237
    frame #91: 0x00358d54 libpypy-c.dylib`pypy_g_dispatch_bytecode__AccessDirect_None + 13668
    frame #92: 0x00355408 libpypy-c.dylib`pypy_g_handle_bytecode__AccessDirect_None + 72
    frame #93: 0x008004f6 libpypy-c.dylib`pypy_g_portal_3 + 118
    frame #94: 0x00c735a9 libpypy-c.dylib`pypy_g_ll_portal_runner__Unsigned_Bool_pypy_interpreter + 569
    frame #95: 0x0080046f libpypy-c.dylib`pypy_g_PyFrame_dispatch + 47
    frame #96: 0x00349724 libpypy-c.dylib`pypy_g_PyFrame_execute_frame + 1348
    frame #97: 0x00348f3a libpypy-c.dylib`pypy_g_PyFrame_run + 218
    frame #98: 0x0032e564 libpypy-c.dylib`pypy_g__flat_pycall__AccessDirect_None + 692
    frame #99: 0x0032d84e libpypy-c.dylib`pypy_g_funccall_valuestack__AccessDirect_None + 350
    frame #100: 0x0030ec38 libpypy-c.dylib`pypy_g_call_valuestack__AccessDirect_None + 552
    frame #101: 0x00863f8d libpypy-c.dylib`pypy_g_CALL_METHOD__AccessDirect_star_1 + 237
    frame #102: 0x00358d54 libpypy-c.dylib`pypy_g_dispatch_bytecode__AccessDirect_None + 13668
    frame #103: 0x00355408 libpypy-c.dylib`pypy_g_handle_bytecode__AccessDirect_None + 72
    frame #104: 0x008004f6 libpypy-c.dylib`pypy_g_portal_3 + 118
    frame #105: 0x00c735a9 libpypy-c.dylib`pypy_g_ll_portal_runner__Unsigned_Bool_pypy_interpreter + 569
    frame #106: 0x0080046f libpypy-c.dylib`pypy_g_PyFrame_dispatch + 47
    frame #107: 0x00349724 libpypy-c.dylib`pypy_g_PyFrame_execute_frame + 1348
    frame #108: 0x00348f3a libpypy-c.dylib`pypy_g_PyFrame_run + 218
    frame #109: 0x0032e564 libpypy-c.dylib`pypy_g__flat_pycall__AccessDirect_None + 692
    frame #110: 0x0032d84e libpypy-c.dylib`pypy_g_funccall_valuestack__AccessDirect_None + 350
    frame #111: 0x0030ec38 libpypy-c.dylib`pypy_g_call_valuestack__AccessDirect_None + 552
    frame #112: 0x00863f8d libpypy-c.dylib`pypy_g_CALL_METHOD__AccessDirect_star_1 + 237
    frame #113: 0x00358d54 libpypy-c.dylib`pypy_g_dispatch_bytecode__AccessDirect_None + 13668
    frame #114: 0x00355408 libpypy-c.dylib`pypy_g_handle_bytecode__AccessDirect_None + 72
    frame #115: 0x008004f6 libpypy-c.dylib`pypy_g_portal_3 + 118
    frame #116: 0x00c735a9 libpypy-c.dylib`pypy_g_ll_portal_runner__Unsigned_Bool_pypy_interpreter + 569
    frame #117: 0x0080046f libpypy-c.dylib`pypy_g_PyFrame_dispatch + 47
    frame #118: 0x00349724 libpypy-c.dylib`pypy_g_PyFrame_execute_frame + 1348
    frame #119: 0x00348f3a libpypy-c.dylib`pypy_g_PyFrame_run + 218
    frame #120: 0x0032e564 libpypy-c.dylib`pypy_g__flat_pycall__AccessDirect_None + 692
    frame #121: 0x0032d84e libpypy-c.dylib`pypy_g_funccall_valuestack__AccessDirect_None + 350
    frame #122: 0x0030ec38 libpypy-c.dylib`pypy_g_call_valuestack__AccessDirect_None + 552
    frame #123: 0x00863f8d libpypy-c.dylib`pypy_g_CALL_METHOD__AccessDirect_star_1 + 237
    frame #124: 0x00358d54 libpypy-c.dylib`pypy_g_dispatch_bytecode__AccessDirect_None + 13668
    frame #125: 0x00355408 libpypy-c.dylib`pypy_g_handle_bytecode__AccessDirect_None + 72
    frame #126: 0x008004f6 libpypy-c.dylib`pypy_g_portal_3 + 118
    frame #127: 0x00c735a9 libpypy-c.dylib`pypy_g_ll_portal_runner__Unsigned_Bool_pypy_interpreter + 569
    frame #128: 0x0080046f libpypy-c.dylib`pypy_g_PyFrame_dispatch + 47
    frame #129: 0x00349724 libpypy-c.dylib`pypy_g_PyFrame_execute_frame + 1348
    frame #130: 0x00348f3a libpypy-c.dylib`pypy_g_PyFrame_run + 218
    frame #131: 0x0032e564 libpypy-c.dylib`pypy_g__flat_pycall__AccessDirect_None + 692
    frame #132: 0x0032d84e libpypy-c.dylib`pypy_g_funccall_valuestack__AccessDirect_None + 350
    frame #133: 0x0030ec38 libpypy-c.dylib`pypy_g_call_valuestack__AccessDirect_None + 552
    frame #134: 0x00863f8d libpypy-c.dylib`pypy_g_CALL_METHOD__AccessDirect_star_1 + 237
    frame #135: 0x00358d54 libpypy-c.dylib`pypy_g_dispatch_bytecode__AccessDirect_None + 13668
    frame #136: 0x00355408 libpypy-c.dylib`pypy_g_handle_bytecode__AccessDirect_None + 72
    frame #137: 0x008004f6 libpypy-c.dylib`pypy_g_portal_3 + 118
    frame #138: 0x00c735a9 libpypy-c.dylib`pypy_g_ll_portal_runner__Unsigned_Bool_pypy_interpreter + 569
    frame #139: 0x0080046f libpypy-c.dylib`pypy_g_PyFrame_dispatch + 47
    frame #140: 0x00349724 libpypy-c.dylib`pypy_g_PyFrame_execute_frame + 1348
    frame #141: 0x00348f3a libpypy-c.dylib`pypy_g_PyFrame_run + 218
    frame #142: 0x0034175e libpypy-c.dylib`pypy_g_PyCode_funcrun + 670
    frame #143: 0x000a5fc6 libpypy-c.dylib`pypy_g_call_stub + 38
    frame #144: 0x00ad8e0c libpypy-c.dylib`pypy_g_handler_inline_call_r_r + 716
    frame #145: 0x00ad034a libpypy-c.dylib`pypy_g_dispatch_loop + 3050
    frame #146: 0x00acf16d libpypy-c.dylib`pypy_g_BlackholeInterpreter_run + 93
    frame #147: 0x00ace3e4 libpypy-c.dylib`pypy_g_BlackholeInterpreter__resume_mainloop + 100
    frame #148: 0x00ace179 libpypy-c.dylib`pypy_g__run_forever + 105
    frame #149: 0x00af58e9 libpypy-c.dylib`pypy_g_ResumeGuardDescr_handle_fail + 505
    frame #150: 0x00cb7ce5 libpypy-c.dylib`pypy_g_execute_assembler__star_2_2 + 453
    frame #151: 0x00cb7435 libpypy-c.dylib`pypy_g_maybe_compile_and_run__star_5 + 981
    frame #152: 0x00800634 libpypy-c.dylib`pypy_g_jump_absolute__AccessDirect_None + 100
    frame #153: 0x00359b5e libpypy-c.dylib`pypy_g_dispatch_bytecode__AccessDirect_None + 17262
    frame #154: 0x00355408 libpypy-c.dylib`pypy_g_handle_bytecode__AccessDirect_None + 72
    frame #155: 0x008004f6 libpypy-c.dylib`pypy_g_portal_3 + 118
    frame #156: 0x00c735a9 libpypy-c.dylib`pypy_g_ll_portal_runner__Unsigned_Bool_pypy_interpreter + 569
    frame #157: 0x00c79ca1 libpypy-c.dylib`pypy_g_handle_jitexception_3 + 97
    frame #158: 0x00c79b89 libpypy-c.dylib`pypy_g_assembler_call_helper_3 + 217
````




More information about the pypy-issue mailing list