libtool-patches
[Top][All Lists]
Advanced

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

Re: Report proper errors from the loadlibrary loader.


From: Peter Rosin
Subject: Re: Report proper errors from the loadlibrary loader.
Date: Thu, 21 Jan 2010 09:09:43 +0100
User-agent: Thunderbird 2.0.0.23 (Windows/20090812)

Hi Ralf,

Den 2010-01-20 22:15 skrev Ralf Wildenhues:
* Peter Rosin wrote on Sun, Jan 17, 2010 at 09:19:27PM CET:
The \r\n at the end of the messages should probably be removed.

Sounds like a good idea to me.

I have since added that to the loadlibraryerror function.

And I did
manage to write a test that exposes this new functionallity - as you
requested - by unloading all modules except the loadlibrary loader (and
the preopen loader). The test is attached.

Good.  Thanks.  I can't find obvious issues with the test, and it should
skip on all unixy systems (due to loadlibrary loader not being present).

I have checked that it indeed skips on linux due to no loadlibrary loader.

But, I have not succeeded in generating any other errors than the above
two. I have tried to remove execute bits on the plugin and a dependent
library, and I have tried removing a dependent library. But real problems
usually manifests themselves in weird ways and the correct error message
may be crucial in some unforseen case. Is it worth it?

We can cross that bridge when we get to it, i.e., when we have a problem
report with a setup that provoke such an error.  The test case is good
because it ensures several code paths are covered in the source.  If it
works on MiNGW (I gather from above that you've already tested Cygwin
and Wine) then feel free to commit both patch and test.

I did some minor tweaks to the test after going through the following
systems, listing the test result after the tweaks:

MSYS/MinGW                    ok
Wine/MinGW                    ok
Wine/MinGW --disable-static   skip (empty $dlname in the .la file)
Cygwin/gcc                    ok
linux/gcc                     skip (no loadlibrary loader)

So, I'm pushing as attached. Thanks for the review!

Cheers,
Peter

2010-01-20  Peter Rosin  <address@hidden>

        Report proper errors from the loadlibrary loader.
        * libltdl/loaders/loadlibrary.c (loadlibraryerror): New
        helper function that returns the latest Windows error as a
        string, or the provided default string on failure to do so.
        (LOADLIB_SETERROR): New macro that wraps previous to make it
        easy to use.
        (vm_open, vm_close, vm_sym): Make use of previous.
        (LOCALFREE): New macro to help free the Windows error string.
        (vl_exit): Make use of previous.
        * tests/loadlibarry.at: New file, new test that makes sure
        the loadlibrary loader reports non-standard error messages.
        * Makefile.am (TESTSUITE_AT): Add above test.

        Signed-off-by: Peter Rosin <address@hidden>

--
They are in the crowd with the answer before the question.
> Why do you dislike Jeopardy?

Attachment: loadlibrary-error-2.patch
Description: Text document


reply via email to

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