From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 13437 invoked by alias); 22 Oct 2009 17:44:14 -0000 Received: (qmail 13427 invoked by uid 22791); 22 Oct 2009 17:44:13 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_HELO_PASS,SPF_PASS X-Spam-Check-By: sourceware.org Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 22 Oct 2009 17:44:09 +0000 Received: from int-mx05.intmail.prod.int.phx2.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.18]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id n9MHhvdm019151; Thu, 22 Oct 2009 13:43:57 -0400 Received: from ns3.rdu.redhat.com (ns3.rdu.redhat.com [10.11.255.199]) by int-mx05.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id n9MHhu9L023197; Thu, 22 Oct 2009 13:43:57 -0400 Received: from opsy.redhat.com (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by ns3.rdu.redhat.com (8.13.8/8.13.8) with ESMTP id n9MHhtq1031600; Thu, 22 Oct 2009 13:43:56 -0400 Received: by opsy.redhat.com (Postfix, from userid 500) id 6C62A378534; Thu, 22 Oct 2009 11:43:55 -0600 (MDT) From: Tom Tromey To: Paul Pluzhnikov Cc: Andreas Schwab , Pedro Alves , gdb-patches@sourceware.org, Jan Kratochvil Subject: Re: [patch] Fix for PR gdb/10819 References: <8ac60eac0910212148w24f44d53xfa6bedd7e12b41d1@mail.gmail.com> <20091022054758.GA15116@host0.dyn.jankratochvil.net> <8ac60eac0910212314h3517ff9btcad84f8d0978bddb@mail.gmail.com> <200910221142.55021.pedro@codesourcery.com> <8ac60eac0910220833v96b75i379486328b8f7955@mail.gmail.com> <8ac60eac0910220929v4cad21b4gcf706be716b13771@mail.gmail.com> Reply-To: tromey@redhat.com Date: Thu, 22 Oct 2009 17:44:00 -0000 In-Reply-To: <8ac60eac0910220929v4cad21b4gcf706be716b13771@mail.gmail.com> (Paul Pluzhnikov's message of "Thu, 22 Oct 2009 09:29:52 -0700") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2009-10/txt/msg00524.txt.bz2 >>>>> "Paul" == Paul Pluzhnikov writes: Paul> There is one more call to bsearch in solib-osf.c, but that file appears Paul> to not be used anymore. Ok to deleted it? It is referenced from config/alpha/alpha-osf3.mh, so I think it isn't dead. I would not worry about this call to bsearch. It has been there since revision 1.1 of that file, in 2001. I think any problem it might provoke probably would have been encountered by now. Paul> + if (cie_table->num_entries == 0) Paul> + { Paul> + gdb_assert (cie_table->entries == NULL); Paul> + Paul> + /* The C standard (ISO/IEC 9899:TC2) requires the BASE argument to Paul> + bsearch be a valid pointer even when the NMEMB argument is 0. Paul> + Paul> + Passing NULL for BASE and 0 for NMEMB is also known to cause Paul> + Solaris-8 bsearch to call bsearch_cie_cmp with NULL ELEMENT Paul> + (which doesn't expect that and crashes); see PR gdb/10819. Paul> + Paul> + Therefore, avoid calling bsearch under these conditions. */ I'm ok with this paragraph but given that this is a C standard thing, it could really just say something like "The C89 Standard requires BASE to be non-NULL". Paul> + /* See comment in dwarf2-frame.c:find_cie on why this check Paul> + is necessary. */ I'm not ok with this comment; references like this are fragile because the referenced comment may change without anybody knowing to update this one. This patch is ok if you replace the second comment with something self-contained. thanks, Tom