dd segfault when LANGUAGE=en_GB

Bug #55892 reported by Robert Ancell
4
Affects Status Importance Assigned to Milestone
coreutils (Ubuntu)
New
Undecided
Unassigned

Bug Description

Binary package hint: coreutils

DD appears to segfault when using languages it is not made for. I am using Ubuntu 6.06 with coreutils 5.93-5ubuntu4.

Here is an example of how to generate the segmentation fault:
rancell@bos:~$ LANGUAGE=en_GB dd if=/dev/zero bs=1 count=2 of=/tmp/foo
2+0 records in
2+0 records out
Segmentation fault (core dumped)

And here is it working correctly:
rancell@bos:~$ LANGUAGE=C dd if=/dev/zero bs=1 count=2 of=/tmp/foo
2+0 records in
2+0 records out
2 bytes (2 B) copied, 4.3e-05 seconds, 46.5 kB/s

(Note it would work fine using bs=1 count=1 as this executes a different codepath).

Looking through the source code (apt-get source coreutils) the problem is in print_stats() (coreutils-5.93/src/dd.c). Specifically it appears the ngettext fails to resolve leaving an invalid printf format string.

I have tried this with the latest upstream coreutils (5.97) and the bug is still present.

This bug is always reproducible.

Revision history for this message
Vassilis Pandis (pandisv) wrote :

Possibly a duplicate of bug 42264 ?

Revision history for this message
Robert Ancell (robert-ancell) wrote :

I didn't see that - it seems to be the same bug. The bug is in dd/coreutils however as it appears not to handle unknown locales - it should fall back on the C locale if it cannot find a translation.

Revision history for this message
Robert Ancell (robert-ancell) wrote :

OK, launchpad is confusing me. Both bugs show up here:
https://launchpad.net/distros/ubuntu/+source/coreutils/+bugs
but not here:
https://launchpad.net/products/coreutils/+bugs

This is a bug both in the Ubuntu version and upstream.

Revision history for this message
Vassilis Pandis (pandisv) wrote :

It appears to be the same (judging from 42264's backtrace) but I'm not too confident to mark it as a dupe without looking at the code first ...

Revision history for this message
Vassilis Pandis (pandisv) wrote :

The latter link is about the upstream coreutils. As you can see above, a task has been opened only for the Ubuntu coreutils. Tasks for the upstream projects are usually opened when the bug has been forwarded to the developers (it doesn't really help to just open an upstream task if upstream hasn't been notified).

Revision history for this message
Gert Kulyk (gkulyk) wrote :

For me it seems to be a dupe of bug 42264 , like Vassilis Pandis mentioned above. Affected also is german locale.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.