Bug 655227 - messed fsck.ext3 output
Summary: messed fsck.ext3 output
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: e2fsprogs
Version: 14
Hardware: Unspecified
OS: Unspecified
low
medium
Target Milestone: ---
Assignee: Eric Sandeen
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2010-11-19 22:19 UTC by Michał Piotrowski
Modified: 2010-12-15 08:54 UTC (History)
4 users (show)

Fixed In Version: e2fsprogs-1.41.12-6.fc14
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2010-12-15 08:54:39 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
patch that removes polish chars from translation string - fixes bug (339 bytes, application/octet-stream)
2010-11-19 22:58 UTC, Michał Piotrowski
no flags Details
testcase (348 bytes, application/octet-stream)
2010-11-19 23:32 UTC, Michał Piotrowski
no flags Details

Description Michał Piotrowski 2010-11-19 22:19:29 UTC
Description of problem:
This problem is somehow related to polish locales.

fsck.ext3 -cvf /dev/sdb1
e2fsck 1.41.12 (17-May-2010)
Poszukiwanie wadliwych bloków (tyl^CGotowe w   0.01%, minęło 0:090807060504

Interrupted at block 56320
/dev/sdb1: Updating bad block inode.

Please take a look at timer  0:090807060504 - strange. Isn't it? (And it's getting worse over time. I can not leave fsck with polish locales on screen, because output is totally messed up later, when I check results)

This is caused by two letters "ęł" in "minęło" word. When I change this string to "minelo"

sudo fsck.ext3 -cvf /dev/sdb1
e2fsck 1.41.12 (17-May-2010)
Poszukiwanie wadliwych bloków (tylko odczyt): ^Ctowe w   0.10%, minelo 0:47

Interrupted at block 375936
/dev/sdb1: Updating bad block inode.

Everything is fine.

This is not a big problem, I can use different locale, but it's still a bug :)

Comment 1 Eric Sandeen 2010-11-19 22:36:04 UTC
I'm not certain where to start with this.  Can you translate some of the above strings for me so I know where it is in the code?  I'm no local/i18n expert, sadly.  Can I reproduce this myself somehow?

Thanks,
-Eric

Comment 2 Michał Piotrowski 2010-11-19 22:54:50 UTC
misc/badblocks.c
line 201
<------>len = snprintf(line_buf, sizeof(line_buf),.
<------><------>       _("%6.2f%% done, %s elapsed"),
<------><------>       calc_percent((unsigned long) currently_testing,
<------><------><------><------>    (unsigned long) num_blocks),.
<------><------>       time_diff_format(&time_end, &time_start, diff_buf));

Translation is in
po/pl.po 
line 3089
#: misc/badblocks.c:202
#, c-format
msgid "%6.2f%% done, %s elapsed"
msgstr "Gotowe w %6.2f%%, min..o %s"


I think that you can reproduce this bug by adding LANG="pl_PL"
LANG="pl_PL" sudo fsck.ext3 -cvf /dev/sdb1

IMHO removal of the polish characters from string is fully acceptable solution if the problem is not obvious to solve.

Comment 3 Michał Piotrowski 2010-11-19 22:58:45 UTC
Created attachment 461670 [details]
patch that removes polish chars from translation string - fixes bug

This patch removes polish chars from translation. Please use it if there is no better solution.

Comment 4 Eric Sandeen 2010-11-19 23:05:40 UTC
Thank you for the further information!  I'll try to sort this out.

-Eric

Comment 5 Eric Sandeen 2010-11-19 23:06:56 UTC
Is e2fsprogs the only package that's exhibiting the problem?  Surely this isn't the only translation with polish characters...?

Comment 6 Michał Piotrowski 2010-11-19 23:16:41 UTC
I have not noticed problems with displaing polish characters in other programs.

Comment 7 Eric Sandeen 2010-11-19 23:18:19 UTC
It was pointed out to me by Arkadiusz Miskiewicz that "the update function that updates timer there doesn't correctly count for multibyte locales causing little shift on the screen which in the end causes many digits written"

and "wchar.h and wcslen() instead of strlen maybe will work"

I'll look into that.

Comment 8 Michał Piotrowski 2010-11-19 23:32:19 UTC
Created attachment 461674 [details]
testcase

I created a test case that demonstrates this problem.

Comment 9 Michał Piotrowski 2010-11-19 23:38:43 UTC
OMG :), I checked this test case without polish chars. It doesn't work as expected - probably I should think about re-learning C :)

Comment 10 Eric Sandeen 2010-11-20 04:43:43 UTC
Ahah. Finally looked at the code.  This is fixed upstream.

the 2nd assignment of "len" should fix it I think:

        len = snprintf(line_buf, sizeof(line_buf),
                       _("%6.2f%% done, %s elapsed"),
                       calc_percent((unsigned long) currently_testing,
                                    (unsigned long) num_blocks),
                       time_diff_format(&time_end, &time_start, diff_buf));
#ifdef HAVE_MBSTOWCS
        len = mbstowcs(NULL, line_buf, sizeof(line_buf));
#endif

$ git annotate misc/badblocks.c | grep MBSTOWCS
61ef2474	(Theodore Ts'o	2010-08-01 22:30:33 -0400	206)#ifdef HAVE_MBSTOWCS
$ git show 61ef2474
commit 61ef2474c24c80a5bf0e24ba85a7506fd7651a5c
Author: Theodore Ts'o <tytso>
Date:   Sun Aug 1 22:30:33 2010 -0400

    badblocks: Deal with UTF-8 characters in progress message
    
    Addresses-Gentoo-Bug: #309909
    Addresses-Debian-Bug: #583782
    Addresses-Debian-Bug: #587834
    
    Signed-off-by: "Theodore Ts'o" <tytso>

...

If this is causing you trouble in F14 I could certainly pull that patch over, I think.

-Eric

Comment 11 Michał Piotrowski 2010-11-20 05:20:56 UTC
It would be great.

Best regards,
Michal

Comment 12 Eric Sandeen 2010-12-07 20:55:25 UTC
Apologies for the late action on this.

I did a scratch build with the patch in place, care to test it?

http://kojipkgs.fedoraproject.org/scratch/sandeen/task_2650057/

Thanks,
-Eric

Comment 13 Michał Piotrowski 2010-12-07 21:08:10 UTC
"Apologies for the late action on this."

No problem, it wasn't critical bug :)

"care to test it?"

Works fine. Thanks!

Best regards,
Michal

Comment 14 Eric Sandeen 2010-12-07 21:23:40 UTC
(In reply to comment #13)
> "Apologies for the late action on this."
> 
> No problem, it wasn't critical bug :)
> 
> "care to test it?"
> 
> Works fine. Thanks!

Great, thanks.  I'll get it pushed out today.

Comment 15 Fedora Update System 2010-12-07 22:55:10 UTC
e2fsprogs-1.41.12-6.fc14 has been submitted as an update for Fedora 14.
https://admin.fedoraproject.org/updates/e2fsprogs-1.41.12-6.fc14

Comment 16 Fedora Update System 2010-12-08 21:42:23 UTC
e2fsprogs-1.41.12-6.fc14 has been pushed to the Fedora 14 testing repository.  If problems still persist, please make note of it in this bug report.
 If you want to test the update, you can install it with 
 su -c 'yum --enablerepo=updates-testing update e2fsprogs'.  You can provide feedback for this update here: https://admin.fedoraproject.org/updates/e2fsprogs-1.41.12-6.fc14

Comment 17 Fedora Update System 2010-12-15 08:54:34 UTC
e2fsprogs-1.41.12-6.fc14 has been pushed to the Fedora 14 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.