From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 25842 invoked by alias); 3 Jun 2002 00:06:02 -0000 Mailing-List: contact gcc-prs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-prs-owner@gcc.gnu.org Received: (qmail 25820 invoked by uid 71); 3 Jun 2002 00:06:01 -0000 Resent-Date: 3 Jun 2002 00:06:01 -0000 Resent-Message-ID: <20020603000601.25819.qmail@sources.redhat.com> Resent-From: gcc-gnats@gcc.gnu.org (GNATS Filer) Resent-To: nobody@gcc.gnu.org Resent-Cc: gcc-prs@gcc.gnu.org, gcc-bugs@gcc.gnu.org, bam@snoopy.apana.org.au Resent-Reply-To: gcc-gnats@gcc.gnu.org, 147145@bugs.debian.org Received:(qmail 23764 invoked from network); 3 Jun 2002 00:00:38 -0000 Received: from unknown (HELO snoopy.apana.org.au) (203.12.237.97) by sources.redhat.com with SMTP; 3 Jun 2002 00:00:38 -0000 Received: from localhost (localhost [127.0.0.1]) by snoopy.apana.org.au (Postfix) with ESMTP id 8F94D32155; Mon, 3 Jun 2002 10:00:31 +1000 (EST) Received: from scrooge.chocbit.org.au (scrooge.apana.org.au [203.12.237.100]) by snoopy.apana.org.au (Postfix) with ESMTP id 224D631F65; Mon, 3 Jun 2002 10:00:28 +1000 (EST) Received: from localhost (localhost [127.0.0.1]) by scrooge.chocbit.org.au (Postfix) with ESMTP id 37594CC3F; Mon, 3 Jun 2002 10:00:30 +1000 (EST) Received: by scrooge.chocbit.org.au (Postfix, from userid 1003) id 38DD4CC13; Mon, 3 Jun 2002 10:00:26 +1000 (EST) Message-Id:<20020603000026.38DD4CC13@scrooge.chocbit.org.au> Date: Sun, 02 Jun 2002 17:06:00 -0000 From: bam@snoopy.apana.org.au Reply-To: 147145@bugs.debian.org To: gcc-gnats@gcc.gnu.org, debian-gcc@lists.debian.org X-Send-Pr-Version:3.113 X-GNATS-Notify:bam@snoopy.apana.org.au Subject: ada/6910: reproducible segmentation fault X-SW-Source: 2002-06/txt/msg00046.txt.bz2 List-Id: >Number: 6910 >Category: ada >Synopsis: When I run this code it segfaults. >Confidential: no >Severity: serious >Priority: medium >Responsible: unassigned >State: open >Class: wrong-code >Submitter-Id: net >Arrival-Date: Sun Jun 02 17:06:01 PDT 2002 >Closed-Date: >Last-Modified: >Originator: bam@snoopy.apana.org.au >Release: 3.1 (Debian) (Debian unstable) >Organization: The Debian Project >Environment: System: Debian GNU/Linux (unstable) Architecture: i686 Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Installed/Config-files/Unpacked/Failed-config/Half-installed |/ Err?=(none)/Hold/Reinst-required/X=both-problems (Status,Err: uppercase=bad) ||/ Name Version Description +++-==============-==============-============================================ ii gcc-3.1 3.1-2 The GNU C compiler. ii g++-3.1 3.1-2 The GNU C++ compiler. ii libstdc++4 3.1-2 The GNU stdc++ library version 3 ii libstdc++4-dev 3.1-2 The GNU stdc++ library version 3 (developmen ii binutils 2.12.90.0.7-1 The GNU assembler, linker and binary utiliti ii libc6 2.2.5-6 GNU C Library: Shared libraries and Timezone host: i386-linux configured with: /mnt/data/gcc-3.1/gcc-3.1-3.1ds2/src/configure -v --enable-languages=c,c++,java,f77,proto,objc,ada --prefix=/usr --mandir=$\(prefix\)/share/man --infodir=$\(prefix\)/share/info --with-gxx-include-dir=$\(prefix\)/include/g++-v3-3.1 --enable-shared --with-system-zlib --enable-long-long --enable-nls --without-included-gettext --enable-clocale=gnu --enable-threads=posix --enable-java-gc=boehm --enable-objc-gc i386-linux >Description: [ Reported to the Debian BTS as report #147145. Please CC 147145@bugs.debian.org on replies. Log of report can be found at http://bugs.debian.org/147145 ] When I run this code which combines the usage of GNAT.Dynamic_Tables and XmlAda in the one program, the program segfaults for some unknown reason. This occurs with the prior gcc-3.0 version of Gnat, too. (I apologize in advance if this problem is my fault, but I can't see any indication that is the case). --- CUT --- [532] [scrooge:bam] ~/tmp/ada/testbug >~/tmp/gnat-gdb-5/gdb/gdb ./testbug3 GNU gdb 5.0.gnat.3.15w-41 Copyright 2000 Free Software Foundation, Inc. Ada Core Technologies version of GDB for GNAT Professional GDB is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. Type "show copying" to see the conditions. See your support agreement for details of warranty and support. If you do not have a current support agreement, then there is absolutely no warranty for this version of GDB. Type show warranty for details. This GDB was configured as "i686-pc-linux"... (gdb) r Starting program: /home/bam/tmp/ada/testbug/./testbug3 Program received signal SIGSEGV, Segmentation fault. 0x80afd9f in system__finalization_implementation__finalize_list () (gdb) bt #0 0x80afd9f in system__finalization_implementation__finalize_list () #1 0x80584a3 in (v=@0x80c9f08, b=false) at testbug3.adb:41 #2 0x8058efb in testbug3 () at testbug3.adb:77 #3 0x8049f2e in main (argc=1, argv=3221223924, envp=) at b~testbug3.adb:277 #4 0x4003a14f in __libc_start_main () from /lib/libc.so.6 --- CUT --- >How-To-Repeat: Run this code: --- CUT --- with Ada.Text_IO; use Ada.Text_IO; with Ada.Strings.Unbounded; use Ada.Strings.Unbounded; with Input_Sources.File; use Input_Sources.File; with Tree_Readers; use Tree_Readers; with Sax.Readers; use Sax.Readers; with DOM.Core; use DOM.Core; with DOM.Core.Nodes; use DOM.Core.Nodes; with DOM.Core.Documents; use DOM.Core.Documents; with DOM.Core.Elements; use DOM.Core.Elements; with GNAT.Dynamic_Tables; procedure TestBug3 is Read : File_Input; My_Tree_Reader : Tree_Reader; My_Tree : Document; My_Root : DOM.Core.Element; My_Nodes : Node_List; type Arm is delta 0.1 range 1_000.0 .. 5_000.0; type Litres is range 0..200; type Fuel_Tank is record Description : Unbounded_String; The_Arm : Arm; Maximum : Litres; end record; package Fuel_Tank_Tables is new GNAT.Dynamic_Tables(Table_Component_Type=>Fuel_Tank, Table_Index_Type=>Positive, Table_Low_Bound=>1, Table_Initial=>5, Table_Increment=>50); use Fuel_Tank_Tables; T : Fuel_Tank_Tables.Instance; begin Set_Public_Id (Read, "aircrafts.xml"); Set_System_Id (Read, "aircrafts.xml"); Open ("aircrafts.xml", Read); -- Set_Feature (My_Tree_Reader, Validation_Feature, True); -- Parse (My_Tree_Reader, Read); Close (Read); -- Normalize(Get_Tree(My_Tree_Reader)); -- My_Tree := Get_Tree(My_Tree_Reader); -- My_Root := Get_Element(My_Tree); -- My_Nodes := DOM.Core.Elements.Get_Elements_By_Tag_Name(My_Root); Init(T); Set_Last(T,1); T.Table(1) := ( Description => To_Unbounded_String("Fuel Tank"), The_Arm => 2413.0, Maximum => 181 ); end TestBug3; --- CUT --- For reference, I compiler it with: #!/bin/sh -ex XMLADA=$HOME/tmp/xmlada-0.7.1 #gnatmake -g testbug3 -I$XMLADA/unicode -I$XMLADA/input_sources/ -I$XMLADA/dom -I$XMLADA/sax gnatmake -gstabs+ testbug3 -I$XMLADA/unicode -I$XMLADA/input_sources/ -I$XMLADA/dom -I$XMLADA/sax >Fix: Comment out the call to Close, Get_Element, and Get_Elements_By_Tag_Name. >Release-Note: >Audit-Trail: >Unformatted: