From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9171 invoked by alias); 20 Mar 2013 18:23:05 -0000 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 Received: (qmail 9148 invoked by uid 89); 20 Mar 2013 18:22:54 -0000 X-Spam-SWARE-Status: No, score=-8.1 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI,RP_MATCHES_RCVD,SPF_HELO_PASS,TW_BJ autolearn=ham version=3.3.1 Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Wed, 20 Mar 2013 18:22:52 +0000 Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id r2KIMp96016445 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 20 Mar 2013 14:22:51 -0400 Received: from barimba (ovpn01.gateway.prod.ext.phx2.redhat.com [10.5.9.1]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id r2KIMngS005680 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES128-SHA bits=128 verify=NO); Wed, 20 Mar 2013 14:22:50 -0400 From: Tom Tromey To: gdb-patches@sourceware.org Subject: RFC: fix latent bug in syms_from_objfile_1 Date: Wed, 20 Mar 2013 18:23:00 -0000 Message-ID: <87ip4m7wxy.fsf@fleche.redhat.com> MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2013-03/txt/msg00760.txt.bz2 I recently upgraded to Fedora 18. I randomly see this from gdb: warning: no loadable sections found in added symbol-file system-supplied DSO at 0x7ffff7ffd000 I tracked this warning down to a buglet in syms_from_objfile_1, which references addrs->other[0] without first checking addrs->num_sections. This patch fixes the problem. Built and regtested on x86-64 Fedora 18. This actually improves the test results for me by removing a number of bogus FAILs caused when the warning is emitted. Any comments? Tom 2013-03-20 Tom Tromey * symfile.c (syms_from_objfile_1): Check num_sections before calling addr_info_make_relative. Index: symfile.c =================================================================== RCS file: /cvs/src/src/gdb/symfile.c,v retrieving revision 1.367 diff -u -r1.367 symfile.c --- symfile.c 14 Mar 2013 20:26:19 -0000 1.367 +++ symfile.c 20 Mar 2013 18:19:42 -0000 @@ -997,7 +997,7 @@ We no longer warn if the lowest section is not a text segment (as happens for the PA64 port. */ - if (addrs && addrs->other[0].name) + if (addrs && addrs->num_sections > 0 && addrs->other[0].name) addr_info_make_relative (addrs, objfile->obfd); /* Initialize symbol reading routines for this objfile, allow complaints to