Bug#759803: python-llvm: Causes segfault on printing certain values

rwb robert.w.bliss at gmail.com
Sat Aug 30 17:43:34 UTC 2014


> However, it is the way LLVM is designed.
> If an incorrect IR is given, LLVM is going to crash, crashing Python in
> the meantime.
Fair enough, but that seems strange for a python module to do. Even
calling `func.verify()` causes a segfault, which according to the docs
(http://www.llvmpy.org/llvmpy-doc/0.12.7/doc/llvm.core.Function.html#verify)
is something you should call to _prevent_ crashing.  Maybe upstream
could add some checks and raise exceptions rather than segfaulting?

(ignoring that though, the note about the instruction count being unclear
seems to be because LLVM is smart enough to see that they're both
constants and doesn't bother with splipping the first add instruction
in (messing around with one of the examples on the site points to
this))

On Sat, Aug 30, 2014 at 05:39:12PM +0200, Sylvestre Ledru wrote:
> severity 759803 normal
> thanks
> 
> 
> 
> On 30/08/2014 17:26, Robert wrote:
> > Package: python-llvm
> > Version: 0.12.6-2
> > Severity: important
> >
> > Dear Maintainer,
> >
> > python-llvm (llvm-py upstream) has been giving me quite a few issues
> > lately.
> >
> > I wrote a quick test to see how easy it would be to generate some code
> > with it, and kept getting segfaults. That was a red flag right away;
> > python code shouldn't ever segfault unless you're doing something
> > strange.
> >
> In theory, yes.
> 
> However, it is the way LLVM is designed.
> If an incorrect IR is given, LLVM is going to crash, crashing Python in
> the meantime.
> 
> FYI, there is the exact same issue with the OCaml binding.
> 
> Cheers,
> Sylvestre



More information about the Pkg-llvm-team mailing list