From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1267 invoked by alias); 26 Apr 2012 17:12:51 -0000 Received: (qmail 1253 invoked by uid 22791); 26 Apr 2012 17:12:48 -0000 X-SWARE-Spam-Status: No, hits=-2.9 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 26 Apr 2012 17:12:35 +0000 From: "mark-sourceware at glines dot org" To: glibc-bugs@sources.redhat.com Subject: [Bug libc/14024] New: argp: mis-formatted --help output Date: Thu, 26 Apr 2012 17:12:00 -0000 X-Bugzilla-Reason: CC X-Bugzilla-Type: new X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mark-sourceware at glines dot org X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: unassigned at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2012-04/txt/msg00345.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=14024 Bug #: 14024 Summary: argp: mis-formatted --help output Product: glibc Version: unspecified Status: NEW Severity: normal Priority: P2 Component: libc AssignedTo: unassigned@sourceware.org ReportedBy: mark-sourceware@glines.org CC: drepper.fsp@gmail.com Classification: Unclassified Apologies if this is logged against the wrong component, please reassign as needed. The argp feature can sometimes generate mis-formatted --help output. I've reproduced this in glibc 2.3.4 (RHEL), libc6 2.13-20 (Ubuntu), and in the git master branch (as of 2012-04-26). A combination of conditions seem to be needed to trigger the problem: * Manual line wrapping must occur due to the option description containing a newline * Automatic line wrapping of an option description must occur due to the remaining text going past the right margin * The argp_fmtstream_t buffer must be too small (or have too much preceding text in it) for the new prefix whitespace to fit I will attach a test program that triggers the issue. I will also provide more details of how it goes wrong - I've done some analysis of the problem but not enough to know the best way to fix it. The mis-formatted output looks like: $ ./test Usage: test [OPTION...] tttttttttttttttttt --a bbbbbbbbbbbbbbbbb --cc =d eeeeeeeeeeeeeeeee -f, --g hhhhhhhhhhhhhhhhhhhh iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj -?, --help Give this help list --usage Give a short usage message The expected output should be: $ ./test Usage: test [OPTION...] tttttttttttttttttt --a bbbbbbbbbbbbbbbbb --cc=d eeeeeeeeeeeeeeeee -f, --g hhhhhhhhhhhhhhhhhhhh iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii jjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjjj -?, --help Give this help list --usage Give a short usage message When the problem occurs, the prefix whitespace for the "i" line has been moved to appear between "--cc" and "=d". Shortening any of the text strings causes the correct output to be emitted. -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.