public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/4101] New: "depth" logic in argp/argp-help.c:hol_cluster_cmp is broken
@ 2007-02-26 18:57 nisse at lysator dot liu dot se
  2007-03-15 13:34 ` [Bug libc/4101] " jakub at redhat dot com
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: nisse at lysator dot liu dot se @ 2007-02-26 18:57 UTC (permalink / raw)
  To: glibc-bugs

The comparisons at the start of hol_cluster_cmp goes the wrong way. This makes
foo --help crash when foo has a sufficiently complicated argp tree such that
some clusters are of different depth.

Unfortunately, the only test case I have handy is the development version of lsh.

Tested version: 2.3.2.ds1-22sarge5, but this part of argp seems to ve unchanged
for a very long time.

patch:

--- argp-help.c 2 Mar 2004 21:15:22 -0000       1.23
+++ argp-help.c 26 Feb 2007 17:50:38 -0000      1.24
@@ -690,9 +690,9 @@ hol_cluster_cmp (const struct hol_cluste
 {
   /* If one cluster is deeper than the other, use its ancestor at the same
      level, so that finding the common ancestor is straightforward.  */
-  while (cl1->depth < cl2->depth)
+  while (cl1->depth > cl2->depth)
     cl1 = cl1->parent;
-  while (cl2->depth < cl1->depth)
+  while (cl2->depth > cl1->depth)
     cl2 = cl2->parent;
 
   /* Now reduce both clusters to their ancestors at the point where both have

-- 
           Summary: "depth" logic in argp/argp-help.c:hol_cluster_cmp is
                    broken
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
        AssignedTo: drepper at redhat dot com
        ReportedBy: nisse at lysator dot liu dot se
                CC: glibc-bugs at sources dot redhat dot com
 GCC build triplet: any
  GCC host triplet: any
GCC target triplet: any


http://sourceware.org/bugzilla/show_bug.cgi?id=4101

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libc/4101] "depth" logic in argp/argp-help.c:hol_cluster_cmp is broken
  2007-02-26 18:57 [Bug libc/4101] New: "depth" logic in argp/argp-help.c:hol_cluster_cmp is broken nisse at lysator dot liu dot se
@ 2007-03-15 13:34 ` jakub at redhat dot com
  2007-03-15 20:12 ` drepper at redhat dot com
  2007-07-12 14:59 ` cvs-commit at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: jakub at redhat dot com @ 2007-03-15 13:34 UTC (permalink / raw)
  To: glibc-bugs



-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
         AssignedTo|drepper at redhat dot com   |jakub at redhat dot com
             Status|NEW                         |ASSIGNED


http://sourceware.org/bugzilla/show_bug.cgi?id=4101

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libc/4101] "depth" logic in argp/argp-help.c:hol_cluster_cmp is broken
  2007-02-26 18:57 [Bug libc/4101] New: "depth" logic in argp/argp-help.c:hol_cluster_cmp is broken nisse at lysator dot liu dot se
  2007-03-15 13:34 ` [Bug libc/4101] " jakub at redhat dot com
@ 2007-03-15 20:12 ` drepper at redhat dot com
  2007-07-12 14:59 ` cvs-commit at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: drepper at redhat dot com @ 2007-03-15 20:12 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From drepper at redhat dot com  2007-03-15 20:11 -------
Fixed in cvs.

-- 
           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


http://sourceware.org/bugzilla/show_bug.cgi?id=4101

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libc/4101] "depth" logic in argp/argp-help.c:hol_cluster_cmp is broken
  2007-02-26 18:57 [Bug libc/4101] New: "depth" logic in argp/argp-help.c:hol_cluster_cmp is broken nisse at lysator dot liu dot se
  2007-03-15 13:34 ` [Bug libc/4101] " jakub at redhat dot com
  2007-03-15 20:12 ` drepper at redhat dot com
@ 2007-07-12 14:59 ` cvs-commit at gcc dot gnu dot org
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu dot org @ 2007-07-12 14:59 UTC (permalink / raw)
  To: glibc-bugs


------- Additional Comments From cvs-commit at gcc dot gnu dot org  2007-07-12 14:59 -------
Subject: Bug 4101

CVSROOT:	/cvs/glibc
Module name:	libc
Branch: 	glibc-2_5-branch
Changes by:	jakub@sourceware.org	2007-07-12 14:58:57

Modified files:
	.              : ChangeLog 
	argp           : Makefile argp-help.c 
Added files:
	argp           : tst-argp2.c 

Log message:
	2007-03-15  Jakub Jelinek  <jakub@redhat.com>
	
	[BZ #4101]
	* argp/argp-help.c (hol_cluster_cmp): Fix comparisons used to find
	ancestors with the same depths.
	Patch by Niels Moeller <nisse@lysator.liu.se>.
	(filter_doc): Don't crash if argp is NULL.
	* argp/Makefile (tests): Add tst-argp2.
	* argp/tst-argp2.c: New test.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/ChangeLog.diff?cvsroot=glibc&only_with_tag=glibc-2_5-branch&r1=1.10362.2.53&r2=1.10362.2.54
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/argp/tst-argp2.c.diff?cvsroot=glibc&only_with_tag=glibc-2_5-branch&r1=NONE&r2=1.1.6.1
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/argp/Makefile.diff?cvsroot=glibc&only_with_tag=glibc-2_5-branch&r1=1.7&r2=1.7.2.1
http://sourceware.org/cgi-bin/cvsweb.cgi/libc/argp/argp-help.c.diff?cvsroot=glibc&only_with_tag=glibc-2_5-branch&r1=1.54&r2=1.54.2.1



-- 


http://sourceware.org/bugzilla/show_bug.cgi?id=4101

------- You are receiving this mail because: -------
You are on the CC list for the bug, or are watching someone who is.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2007-07-12 14:59 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-26 18:57 [Bug libc/4101] New: "depth" logic in argp/argp-help.c:hol_cluster_cmp is broken nisse at lysator dot liu dot se
2007-03-15 13:34 ` [Bug libc/4101] " jakub at redhat dot com
2007-03-15 20:12 ` drepper at redhat dot com
2007-07-12 14:59 ` cvs-commit at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).