bug-libtool
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Error reporting should be improved


From: Bob Friesenhahn
Subject: Re: Error reporting should be improved
Date: Tue, 29 Dec 2009 20:48:49 -0600 (CST)
User-agent: Alpine 2.01 (GSO 1266 2009-07-14)

I instrumented libltdl a bit more and captured what happens when there is a failure. Notice that the system (Solaris) provided an excellent error message, but the "file not found" message is produced instead. Also notice that libltdl attempts to dlopen tiff.so with identical parameters four times:

% MAGICK_DEBUG=exception gm convert -debug exception logo: crap.tiff
preopen vm_open: "dlopen.a"
preopen vm_sym: "dlopen_LTX_get_vtable"
dlopen: "/usr/local/lib/GraphicsMagick-1.4/modules-Q16/coders/tiff.so"
dlopen: error "ld.so.1: gm: fatal: libjpeg.so.7: open failed: No such file or 
directory"
preopen vm_open: "/usr/local/lib/GraphicsMagick-1.4/modules-Q16/coders/tiff.so"
dlopen: "/usr/local/lib/GraphicsMagick-1.4/modules-Q16/coders/tiff.so"
dlopen: error "ld.so.1: gm: fatal: libjpeg.so.7: open failed: No such file or 
directory"
preopen vm_open: "/usr/local/lib/GraphicsMagick-1.4/modules-Q16/coders/tiff.so"
20:21:16 0:01 0.000u 3772 module.c/OpenModule/1476/Module:
  Unable to load module 
("/usr/local/lib/GraphicsMagick-1.4/modules-Q16/coders/tiff.la: file not found")
dlopen: "/usr/local/lib/GraphicsMagick-1.4/modules-Q16/coders/tiff.so"
dlopen: error "ld.so.1: gm: fatal: libjpeg.so.7: open failed: No such file or 
directory"
preopen vm_open: "/usr/local/lib/GraphicsMagick-1.4/modules-Q16/coders/tiff.so"
dlopen: "/usr/local/lib/GraphicsMagick-1.4/modules-Q16/coders/tiff.so"
dlopen: error "ld.so.1: gm: fatal: libjpeg.so.7: open failed: No such file or 
directory"
preopen vm_open: "/usr/local/lib/GraphicsMagick-1.4/modules-Q16/coders/tiff.so"
20:21:16 0:01 0.000u 3772 module.c/OpenModule/1476/Module:
  Unable to load module 
("/usr/local/lib/GraphicsMagick-1.4/modules-Q16/coders/tiff.la: file not found")
dlopen: "/usr/local/lib/GraphicsMagick-1.4/modules-Q16/coders/logo.so"
dlsym: "logo_LTX_RegisterLOGOImage"
dlsym: error "ld.so.1: gm: fatal: logo_LTX_RegisterLOGOImage: can't find symbol"
dlsym: "RegisterLOGOImage"
dlsym: "logo_LTX_UnregisterLOGOImage"
dlsym: error "ld.so.1: gm: fatal: logo_LTX_UnregisterLOGOImage: can't find 
symbol"
dlsym: "UnregisterLOGOImage"
dlopen: "/usr/local/lib/GraphicsMagick-1.4/modules-Q16/coders/gif.so"
dlsym: "gif_LTX_RegisterGIFImage"
dlsym: error "ld.so.1: gm: fatal: gif_LTX_RegisterGIFImage: can't find symbol"
dlsym: "RegisterGIFImage"
dlsym: "gif_LTX_UnregisterGIFImage"
dlsym: error "ld.so.1: gm: fatal: gif_LTX_UnregisterGIFImage: can't find symbol"
dlsym: "UnregisterGIFImage"
gm convert: Unable to load module 
("/usr/local/lib/GraphicsMagick-1.4/modules-Q16/coders/tiff.la: file not 
found").

The "file not found" overwrite comes from vm_open() in loaders/preopen.c. It seems that if other loaders fail, then preopen is tried last since it is last in the loaders list:

  LT__SETERROR (FILE_NOT_FOUND);

 done:
  return module;

A possible simple solution is to change this sort of code to:

  if (!lt__get_last_error())
    LT__SETERROR (FILE_NOT_FOUND);

 done:
  return module;

so that existing errors are preserved, but this assumes that all prior loaders are producing useful error messages and errors were purged before attempting to load the module.

The code which loops through the loaders is in ltdl.c/tryall_dlopen().

Bob
--
Bob Friesenhahn
address@hidden, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,    http://www.GraphicsMagick.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]