rheostat2718 / unladen-swallow

Automatically exported from code.google.com/p/unladen-swallow
Other
0 stars 0 forks source link

PyAliasAnalysis crashes when with "&PyInt_Type" in llvm_inline_functions.c #89

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
While playing around with the type feedback, I tried to call specialized
functions out of llvm_inline_functions.c instead of the standard functions.

To make a PyInt_Type version of the BINARY_ADD/BINARY_SUB I tried to
implement a guard using PyInt_CheckExact(v), which compares with address of
the Int type.

The PyAliasAnalysis now crashes on initialization:

Program received signal SIGSEGV, Segmentation fault.
RegisterConstantType (this=0x898c8e8, type=<value optimized out>)
    at Util/PyAliasAnalysis.cc:215
215         dyn_cast<ConstantStruct>(type_var->getInitializer())) {
Current language:  auto
The current source language is "auto; currently c++".
(gdb) backtrace
#0  RegisterConstantType (this=0x898c8e8, type=<value optimized out>)
    at Util/PyAliasAnalysis.cc:215
#1  0x081f1a4d in doInitialization (this=0x898c8e8, module=...)
    at Util/PyAliasAnalysis.cc:185
#2  0x081f05ea in runOnFunction (this=0x898c8e8, f=...)
    at Util/PyAliasAnalysis.cc:238

Original issue reported on code.google.com by joerg...@gmail.com on 11 Nov 2009 at 2:56

GoogleCodeExporter commented 9 years ago
Jeffrey, can you comment on this?

Original comment by collinw on 12 Nov 2009 at 9:24

GoogleCodeExporter commented 9 years ago
From IRC:

<ebo^> it happens as soon as there is a "&PyInt_Type" present in the inlined
functions. it does not even has to be called.
<ebo^> you add a "if(PyInt_CheckExact(o)) print_something" to 
llvm_inline_functions.c
<ebo^> compile
<ebo^> jit something
<ebo^> PyAA crashes at line 215 in PyAliasAnalysis.cc

Original comment by joerg...@gmail.com on 13 Nov 2009 at 8:39

GoogleCodeExporter commented 9 years ago
This happens when the ConstantMirror is asked for a GlobalVariable for an 
address, the 
GV already exists, but it is missing an initializer. I'm working on a fix. The 
fix is 
trickier because we're likely to have to RAUW the GV to change its type to 
match the 
new initializer.

Original comment by jyass...@gmail.com on 17 Nov 2009 at 12:59

GoogleCodeExporter commented 9 years ago
Fixed by r902.

Original comment by jyass...@gmail.com on 19 Nov 2009 at 12:36