On Fri, Jun 30, 2006 at 04:29:25PM -0400, Justin Pryzby wrote:
> Package: dpkg
> Version: 1.13.21
> Severity: normal
> 
> Nearly all the dpkg calls to ohshite use _() for localization;
> unfortunately, as written, it destroys errno, and causes bogus
> messages:

According to the gettext manual:
    The gettext function does not modify the value of the global errno
    variable. This is necessary to make it possible to write something
    like:
        printf (gettext ("Operation failed: %m\n"));
    Here the errno value is used in the printf function while processing
    the %m format element and if the gettext function would change this
    value (it is called before printf is called) we would get a wrong
    message.

> $ sudo gdb --args dpkg -i 
> /var/cache/apt/archives/acct_6.3.99+6.4pre1-2_i386.deb
> (gdb) break fork
> Breakpoint 2, 0xa7e65bf6 in fork () from /lib/tls/i686/cmov/libc.so.6
> (gdb) break malloc
> Breakpoint 3 at 0xa7e3c8b6
> (gdb) d 2
> (gdb) c
> Continuing.
> Breakpoint 3, 0xa7e3c8b6 in malloc () from /lib/tls/i686/cmov/libc.so.6
> (gdb) return 0
> Make selected stack frame return now? (y or n) y
> #0  0x0805f52d in ?? ()
> (gdb) c
> Continuing.
> dpkg: error processing /var/cache/apt/archives/acct_6.3.99+6.4pre1-2_i386.deb 
> (--install):
>  malloc failed (131 bytes): No such file or directory
>  ^^^^^^^^^^^^^              ^^^^^^^^^^^^^^^^^^^^^^^^^

I don't think this example is valid. You only return from malloc, and do
not reset errno.

Did you experienced something like that without gdb?

Kind Regards,
-- 
Nekral


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to