[LLVMdev] Segfault when using llvm-3.6 and OpenGL at the same time on Linux (with mesa, which uses llvm-3.4)

Tom Stellard tom at stellard.net
Tue Feb 24 11:53:06 PST 2015


On Tue, Feb 24, 2015 at 08:39:20PM +0100, Daniel Albuschat wrote:
> 2015-02-17 20:49 GMT+01:00 Tom Stellard <tom at stellard.net>:
> 
> > On Tue, Feb 17, 2015 at 08:15:09PM +0100, Daniel Albuschat wrote:
> > > 2015-02-17 15:59 GMT+01:00 Tom Stellard <tom at stellard.net>:
> > >
> > > > On Mon, Feb 16, 2015 at 10:38:52PM +0100, Daniel Albuschat wrote:
> > > > > Hello there,
> > > > >
> > > > > tl;dr:
> > > > > Is it a known behaviour that using llvm-3.4 and llvm-3.6 at the same
> > time
> > > > > in the same process (while llvm-3.6 is used from a linked shared
> > library
> > > > > and llvm-3.4 is dlopen'ed - with a strange detail: Especially if
> > > > -rdynamic
> > > > > is used when linking the program).
> > > > > If so, is there a workaround?
> > > > > If not, can it be fixed in llvm-3.6?
> > > >
> > > > The NVIDIA proprietary driver does not use mesa at all.  Also based on
> > > > your backtrace, you are using llvmpipe and not nouveau.
> > > >
> > >
> > > Yeah, the backtrace was created from within VirtualBox. That driver, and
> > > the nouveau driver, cause the same issue. The VMWare driver, too.
> > >
> > >
> > > > I'm not a linking expert, but I have seen and fixed a few of these
> > issues
> > > > with Mesa.  In most cases the fix is to make sure that the llvm symbols
> > > > in the mesa driver and also the llvm symbols in your application aren't
> > > > being exported as global symbols.
> > >
> > >
> > > How do I have control about how llvm symbols are being exported?
> >
> > Mesa uses linker scripts to control this.
> >
> > > nm reports no exported symbols matching llvm:
> > >
> > > daniel at ubuntu32-dev:~/projects/llvmcrash$ nm libcrashme.so | grep llvm
> > >          U _ZN4llvm11LLVMContextC1Ev
> > >          U _ZN4llvm11LLVMContextD1Ev
> >
> > What about swrast_dri.so from Mesa?
> 
> 

Do you have a test program you can share?

> No llvm symbols, either:
> 
> daniel at ubuntu32-dev:~/projects/omni2/cbuild$ nm -DC
> /usr/lib/i386-linux-gnu/dri/swrast_dri.so | grep llvm
>          U draw_create_no_llvm
>          U draw_get_shader_param_no_llvm
> 
> I'm out of ideas now... can I somehow log the pathes of libraries loaded in
> a process? Maybe I can find out whether llvm-3.4 loads some llvm-3.5
> libraries or so. On the other hand, why would that only happen when
> llvm-3.5 is actually used? Shouldn't it solely depend on PATH /
> LD_LIBRARY_PATH which library is used?
> 

Did you build a single libLLVM-3.x.so or did you have one shared object
per llvm component.

You can use ldd to see which libraries a shared object depends on.

-Tom

> It seems that dynamic libraries are far more complicated / far less
> straight forward on Linux than I thought...
> 
> Greetings,
> Daniel Albuschat



More information about the llvm-dev mailing list