On Sat, 2015-06-20 at 19:41 +0200, Fabian Raetz wrote:
> Hi,
> 
> starting intellij fails on -current (amd64). Output below.
> java.log and a the output of "LD_DEBUG=1 intellij" are attached.
> 
> Any ideas what's going on?
> 
> Cheers,
> Fabian
> 
> 
> $ uname -a
> OpenBSD ninja.fritz.box 5.8 GENERIC.MP#1078 amd64
> 
> 
> $ intellij
> /usr/local/jdk-1.7.0/bin/java:/usr/local/lib/libglib-2.0.so.4200.1: undefined 
> symbol 'g_mutex_init'
> lazy binding failed!

Fabian,

Thanks for the report. This appears to be an ld.so bug related to
dlopen, dlclose, dlopen. I have reproduced it with this stand alone
program.

=========== main.c ============================
#include <dlfcn.h>
#include <err.h>

int
main()
{
   void (*fp_gdk_threads_init)(void);
   void *gtk_handle = dlopen("libgtk-x11-2.0.so", RTLD_LOCAL);
   if (gtk_handle == 0)
      errx(1, "dlopen failed: %s", dlerror());

#if 1
   if (dlclose(gtk_handle) != 0)
      errx(1, "dlclose failed: %s", dlerror());

   gtk_handle = dlopen("libgtk-x11-2.0.so", RTLD_LOCAL);
   if (gtk_handle == 0)
      errx(1, "dlopen failed: %s", dlerror());
#endif

   fp_gdk_threads_init = dlsym(gtk_handle, "gdk_threads_init");
   if (fp_gdk_threads_init == 0)
      errx(1, "dlsym failed to find gdk_threads_init: %s", dlerror());

   fp_gdk_threads_init();

   return 0;
}

=============================================

$ cc main.c -pthread 
$ ./a.out  
./a.out:/usr/local/lib/libglib-2.0.so.4200.1: undefined symbol
'g_mutex_init'
lazy binding failed!
Segmentation fault (core dumped) 

The test program works fine when #if 1 is changed to 0.

-Kurt


Reply via email to