libtool-patches
[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: Wed, 30 Dec 2009 15:22:37 -0600 (CST)
User-agent: Alpine 2.01 (GSO 1266 2009-07-14)

On Wed, 30 Dec 2009, Peter Rosin wrote:

Aha, you have misunderstood the patch, that's why we don't understand
each other. The patch does indeed allocate a buffer, that's the whole
point of sending the error message to lt_dladderror. The error message
is cached indefinitely inside lt_dladderror. In order to not grow that

In what line of code is a string buffer allocated? The only buffer allocation I see is a REALLOC to increase the buffer which holds diagnostic pointers. Then the passed pointer is assigned directly to the pointer at errindex without any allocation or string copy.

"cache", I implemented a comparison so that registering the same user
error multiple times results in returning the index of the old error
message instead of inventing a new error number each time.

Yes. And so it is impossible to decipher meaningless errors from meaningful ones. If the error comes from a loader which should not have worked in the first place, then the user should be able to ignore it.

Note that user_error_strings is an array of strings, not one big long
string.

Yes, it is an array of string pointers.

The patch does exactly the first part, but not the second. There is simply
no way to know when the user is done with the string, so it has to be
kept indefinitely. We could document the lifetime rules, but until then
there is no way to know when the message can be freed.

The documentation should say that this data is only valid until the next lt_* call, which is currently the case.

Yes, that is true. But that is not a new problem, just magnified by
increased usage of lt_dladderror.

It was essentially unused before since it was only used by a rarely used loader on OS-X.

This discussion should completely move to the patches list so I will delete the Cc: to the bugs list.

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]