Your message dated Sat, 1 Jul 2006 12:16:45 -0400
with message-id <[EMAIL PROTECTED]>
and subject line dpkg: ohshite(_(""), ...) destroys errno
has caused the attached Bug report to be marked as done.
This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.
(NB: If you are a system administrator and have no idea what I am
talking about this indicates a serious mail system misconfiguration
somewhere. Please contact me immediately.)
Debian bug tracking system administrator
(administrator, Debian Bugs database)
--- Begin Message ---
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:
$ 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
^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^
[..or..]
Breakpoint 3, 0xa7ed48b6 in malloc () from /lib/tls/i686/cmov/libc.so.6
(gdb) return 0
Make selected stack frame return now? (y or n) y
#0 0x0805eed6 in ?? ()
(gdb) c
Continuing.
dpkg: error processing /var/cache/apt/archives/acct_6.3.99+6.4pre1-2_i386.deb
(--install):
out of memory for new cleanup entry: Illegal seek
^^^^^^^^^^^^^ ^^^^^^^^^^^^
It might be acceptable to pass the literal string to ohshite(), which
then first saves errno, then calls _(), then either restores errno, or
uses strerror().
--- End Message ---
--- Begin Message ---
On Sat, Jul 01, 2006 at 05:55:08PM +0200, Nicolas Fran?ois wrote:
> 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:
Oh; thanks for the pointer.
> > $ 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.
I agree that not setting errno makes this an .. erronous example,
since I returned a failure condition. What do you mean about "only
returning from malloc"?
> Did you experienced something like that without gdb?
No; I originally came across this while causing an internal dpkg
failure to test rollback actions; see #372148.
Justin
--- End Message ---