Re: Report proper errors from the loadlibrary loader.

2010-01-17 Thread Peter Rosin

Den 2010-01-17 17:45 skrev Bob Friesenhahn:

On Sun, 17 Jan 2010, Ralf Wildenhues wrote:


I'm not too fond of adding new static storage and manipulation (yet
another reason lt_dlopen may not be called concurrently from different
threads), or improved functionality without testsuite exposure that we
really improved.  Further, the documentation I found about GetLastError
states W2K as minimum version, so I hope that you checked that this
works with older Windows as well.  Otherwise, I am fine with the patch.


It seems that GraphicsMagick has been using GetLastError() for a very 
long time.  Certainly at least since Y2K.  There is no special provision 
in this part of the code for anything older than Windows XP and Windows 
2000.  Then again, practically no one cares about Windows versions older 
than this.


I think what has happened is that MS has abandoned WinNT and older and
are thus ignoring them in MSDN. GetLastError certainly predates Win2k
and I think it was in Win32 from from very beginning.

Cheers,
Peter

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




Re: Report proper errors from the loadlibrary loader.

2010-01-17 Thread Bob Friesenhahn

On Sun, 17 Jan 2010, Ralf Wildenhues wrote:


I'm not too fond of adding new static storage and manipulation (yet
another reason lt_dlopen may not be called concurrently from different
threads), or improved functionality without testsuite exposure that we
really improved.  Further, the documentation I found about GetLastError
states W2K as minimum version, so I hope that you checked that this
works with older Windows as well.  Otherwise, I am fine with the patch.


It seems that GraphicsMagick has been using GetLastError() for a very 
long time.  Certainly at least since Y2K.  There is no special 
provision in this part of the code for anything older than Windows XP 
and Windows 2000.  Then again, practically no one cares about Windows 
versions older than this.


It is necessary to collect and store the error as soon as possible 
since any additional activity might invoke a new system call, which 
results in an unrelated error being reported by GetLastError().


Bob
--
Bob Friesenhahn
bfrie...@simple.dallas.tx.us, http://www.simplesystems.org/users/bfriesen/
GraphicsMagick Maintainer,http://www.GraphicsMagick.org/




Re: Report proper errors from the loadlibrary loader.

2010-01-17 Thread Ralf Wildenhues
Hi Peter,

* Peter Rosin wrote on Mon, Jan 11, 2010 at 09:16:37PM CET:
> Den 2010-01-04 21:48 skrev Ralf Wildenhues:
> >* Peter Rosin wrote on Sat, Jan 02, 2010 at 04:02:57AM CET:
> >>Please consider the attached patch.
> >>
> >>I'm just about to go skiing for a week or so, so I'll push when I get
> >>back if this patch is blessed (knock wood) after I leave...
> >
> >Well happy new year and hope you had a fun time in the snow!
> 
> That I did, and so did the kids, the weather was superb, a bit on the
> cold side though (-20 to -30 degrees C or so). But sunny (the sky was
> clear), no wind and very dry so therefore not unbearable...

Sounds nice!

> >What does this patch and its followup fix get us?  What behavior changed
> >in relation to previous code, and if this is fixing a bug, is there need
> >and chance to test for it?
> 
> Previously the reported error was a plain "can't open the module" or
> "symbol not found", even though the system might have reported why it
> could not open the library or not find the symbol. I would say it's
> about the same as using dlerror when present in the dlopen loader.

Ah, ok.  Thanks.

I'm not too fond of adding new static storage and manipulation (yet
another reason lt_dlopen may not be called concurrently from different
threads), or improved functionality without testsuite exposure that we
really improved.  Further, the documentation I found about GetLastError
states W2K as minimum version, so I hope that you checked that this
works with older Windows as well.  Otherwise, I am fine with the patch.

Thanks,
Ralf