From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 4880 invoked by alias); 15 Aug 2009 18:32:34 -0000 Received: (qmail 4740 invoked by uid 22791); 15 Aug 2009 18:32:33 -0000 X-SWARE-Spam-Status: No, hits=-2.0 required=5.0 tests=AWL,BAYES_00,J_CHICKENPOX_43 X-Spam-Check-By: sourceware.org Received: from mailout05.t-online.de (HELO mailout05.t-online.de) (194.25.134.82) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sat, 15 Aug 2009 18:32:26 +0000 Received: from fwd02.aul.t-online.de by mailout05.t-online.de with smtp id 1McO2t-00037C-07; Sat, 15 Aug 2009 20:32:03 +0200 Received: from [192.168.178.22] (JT47YgZlYhRv5VeOS6Os+WUMKpEeRxSb5zv58H+0esD+BQACdwhlHazJ1DnvCevw7h@[84.156.171.219]) by fwd02.aul.t-online.de with esmtp id 1McO2j-0OnhUO0; Sat, 15 Aug 2009 20:31:53 +0200 Subject: Re: Trace crash in gargabe collector to the code at fault? From: oliver.kellogg@t-online.de (Oliver Kellogg) Reply-To: okellogg@users.sourceforge.net To: Andrew Haley Cc: gcc@gcc.gnu.org In-Reply-To: <4A85312D.1070609@redhat.com> References: <400e1c6303a9c2d634341fa3e69ce5ae@email.freenet.de> <4A85312D.1070609@redhat.com> Content-Type: text/plain Date: Sat, 15 Aug 2009 23:25:00 -0000 Message-Id: <1250361620.4569.41.camel@tidbit.site> Mime-Version: 1.0 Content-Transfer-Encoding: quoted-printable Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-08/txt/msg00266.txt.bz2 On Fri, 2009-08-14 at 10:41 +0100, Andrew Haley wrote: > > > > I am stuck here, i.e. I don't know how to find the code > > that is > > at fault. > > Is there some way to trace a pointer entered in > > G.free_object_list > > back to its origin in the code? >=20 > The usual way to find this is to use a gdb watchpoint. Find what object = is > being freed, put a breakpoing on ggc_alloc_stat at the point the object is > created, and then put a watchpoint on the word that is being corrupted. >=20 > Andrew. Thanks. I tried as follows: $ gdb /usr/src/packages/BUILD/gcc-build/gcc/gnat1 GNU gdb (GDB; openSUSE 11.1) 6.8.50.20081120-cvs [...] (gdb) catch exception Catchpoint 1: all Ada exceptions (gdb) run -g -I../../isf_pmc_interface/libsrc/ada -I../../isf_pmc_interface/spv/ada Apc.Init Apc.Init.B_1 Apc.Init.B_1.Pos_Io.Get Apc.Init.B_1.Pos_Io.Get Apc.Init.B_1.Pos_Io.Get Apc.Init.B_1.Pos_Io.Put Apc.Init.B_1.Pos_Io.Put Apc.Init.B_1.Pos_Io.Put {GC 17511k -> 17346k} {GC 17348k -> 17340k} {GC 17341k -> 17341k} {GC 17343k -> 17342k} {GC 17344k -> 17343k} Analyzing compilation unit {GC 17423k -> 17382k} {GC 17382k -> 17382k} {GC 17395k -> 17393k} {GC 17393k -> 17393k} {GC 17394k -> 17394k} {GC 17394k -> 17394k} {GC 17395k -> 17395k} {GC 17395k -> 17395k} {GC 17402k -> 17399k} {GC 17399k -> 17399k} {GC 17405k -> 17403k} {GC 17403k -> 17403k} {GC 17409k -> 17407k} {GC 17407k -> 17407k} {GC 17409k -> 17408k} {GC 17408k -> 17408k} {GC 17408k -> 17403k} {GC 17403k -> 17403k}Performing interprocedural optimizations {GC 17403k -> 17403k} {GC 34561k -> +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3DGNAT BUG DETECTED=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D+ | 4.5.0 20090815 (experimental) (i686-pc-linux-gnu) GCC error: | | in validate_free_objects, at ggc-page.c:1888 | | Error detected around ../../isf_pmc_interface/spv/ada/basic_types.ads:140:26| | Please submit a bug report; see http://gcc.gnu.org/bugs.html. | | Use a subject line meaningful to you and us to track the bug. | | Include the entire contents of this bug box in the report. | | Include the exact gcc or gnatmake command that you entered. | | Also include sources listed below in gnatchop format | | (concatenated together with no headers between files). | +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D+ Please include these source files with error report Note that list may not be accurate in some cases, so please double check that the problem can still be reproduced with the set of files listed. Consider also -gnatd.n switch (see debug.adb). [...] Catchpoint 1, TYPES.UNRECOVERABLE_ERROR at <__gnat_debug_raise_exception> (e=3D0x8ddfd3c) at ../../../SOURCES/gcc/gcc/ada/s-except.adb:44 44 end Debug_Raise_Exception; Current language: auto; currently ada (gdb) bt #0 <__gnat_debug_raise_exception> (e=3D0x8ddfd3c) at ../../../SOURCES/gcc/gcc/ada/s-except.adb:44 #1 0x081ca713 in <__gnat_raise_nodefer_with_msg> (e=3D0x8ddfd3c) at ../../../SOURCES/gcc/gcc/ada/a-except.adb:800 #2 0x081cb0a9 in <__gnat_raise_exception> (e=3D0x8ddfd3c, message=3D0x0) at ../../../SOURCES/gcc/gcc/ada/a-except.adb:839 #3 0x081fd422 in comperr.compiler_abort (x=3D0x9813b90, code=3D-1, fallback_loc=3D0x9813bc8) at ../../../SOURCES/gcc/gcc/ada/comperr.adb:415 #4 0x0818401c in internal_error_function (msgid=3D0x8ccfa23 "in %s, at % s:%d["00"]", ap=3D0xbfffc71c) at ../../../SOURCES/gcc/gcc/ada/gcc-interface/misc.c:372 #5 0x0857a754 in diagnostic_report_diagnostic (context=3D0x92d0bc0, diagnostic=3D0xbfffc720) at ../../../SOURCES/gcc/gcc/diagnostic.c:406 #6 0x0857adfe in internal_error (gmsgid=3D0x8ccfa23 "in %s, at %s:% d["00"]") at ../../../SOURCES/gcc/gcc/diagnostic.c:676 #7 0x0857aed3 in fancy_abort (file=3D0x8cc422c "../../../SOURCES/gcc/gcc/ggc-page.c["00"]", line=3D1888, function=3D0x8cc42bc "validate_free_objects["00"]") at ../../../SOURCES/gcc/gcc/diagnostic.c:730 #8 0x0851163c in validate_free_objects () at ../../../SOURCES/gcc/gcc/ggc-page.c:1888 #9 0x085117ab in ggc_collect () at ../../../SOURCES/gcc/gcc/ggc-page.c:1949 #10 0x089357e2 in cgraph_finalize_function (decl=3D0xb56de600, nested=3D0 '["00"]') at ../../../SOURCES/gcc/gcc/cgraphunit.c:550 #11 0x0818886b in end_subprog_body (body=3D0xb570c5cc) at ../../../SOURCES/gcc/gcc/ada/gcc-interface/utils.c:2116 #12 0x081ba1ae in Subprogram_Body_to_gnu (gnat_node=3D571248) at ../../../SOURCES/gcc/gcc/ada/gcc-interface/trans.c:2339 #13 0x081c0d42 in gnat_to_gnu (gnat_node=3D571248) at ../../../SOURCES/gcc/gcc/ada/gcc-interface/trans.c:4792 #14 0x081c4bc2 in process_decls (gnat_decls=3D-99950950, gnat_decls2=3D0, gnat_end_list=3D0, pass1p=3D0 '["00"]', pass2p=3D1 '["01"]') at ../../../SOURCES/gcc/gcc/ada/gcc-interface/trans.c:6306 #15 0x081c4cba in process_decls (gnat_decls=3D-99984793, gnat_decls2=3D0, gnat_end_list=3D0, pass1p=3D1 '["01"]', pass2p=3D1 '["01"]') at ../../../SOURCES/gcc/gcc/ada/gcc-interface/trans.c:6316 #16 0x081c0dd9 in gnat_to_gnu (gnat_node=3D146150) at ../../../SOURCES/gcc/gcc/ada/gcc-interface/trans.c:4812 #17 0x081c0d8d in gnat_to_gnu (gnat_node=3D147256) at ../../../SOURCES/gcc/gcc/ada/gcc-interface/trans.c:4806 #18 0x081bc788 in Compilation_Unit_to_gnu (gnat_node=3D146130) at ../../../SOURCES/gcc/gcc/ada/gcc-interface/trans.c:3387 #19 0x081b5769 in gigi (gnat_root=3D146130, max_gnat_node=3D1140983, number_name=3D125936, nodes_ptr=3D0xb1af3008, next_node_ptr=3D0xb5a8c008, prev_node_ptr=3D0xb6cf6008, elists_ptr=3D0x96b5a90,=20 elmts_ptr=3D0xb7b39008, strings_ptr=3D0x966f9b8, string_chars_ptr=3D0xb66c2008, list_headers_ptr=3D0xb73ea008, number_file=3D208, file_info_ptr=3D0xbfffd400, standard_boolean=3D12, standard_integer=3D27,=20 standard_long_long_float=3D67, standard_exception_type=3D1225, gigi_operating_mode=3D0, main_unit_number=3D38) at ../../../SOURCES/gcc/gcc/ada/gcc-interface/trans.c:629 #20 0x0850a93a in back_end.call_back_end (mode=3Dgenerate_object) at ../../../SOURCES/gcc/gcc/ada/back_end.adb:100 #21 0x0850c79e in gnat1drv () at ../../../SOURCES/gcc/gcc/ada/gnat1drv.adb:1002 #22 0x08183a0f in gnat_parse_file (set_yydebug=3D0) at ../../../SOURCES/gcc/gcc/ada/gcc-interface/misc.c:167 #23 0x08794eda in compile_file () at ../../../SOURCES/gcc/gcc/toplev.c:1032 #24 0x08796d1b in do_compile () at ../../../SOURCES/gcc/gcc/toplev.c:2387 #25 0x08796e46 in toplev_main (argc=3D98, argv=3D0xbfffe004) at ../../../SOURCES/gcc/gcc/toplev.c:2445 #26 0x0850fe2e in main (argc=3D1836016485, argv=3D0x72726570) at ../../../SOURCES/gcc/gcc/main.c:35 (gdb) up 8 #8 0x0851163c in validate_free_objects () at ../../../SOURCES/gcc/gcc/ggc-page.c:1888 1888 gcc_assert (!(pe->in_use_p[word] & (1UL << bit))); Current language: auto; currently c (gdb) p f->object $1 =3D (void *) 0xb7fd6138 (gdb) watch 0xb7fd6138 Watchpoint 2: 3086836024 (gdb) run The program being debugged has been started already. Start it from the beginning? (y or n) y Starting program: /usr/src/packages/BUILD/gcc-build/gcc/gnat1 -g -I../../isf_pmc_interface/libsrc/ada -I../../isf_pmc_interface/spv/ada -I../../isf_pmc_interface/spv/spv_client -I../common_simple -I../cs/dchdl/dchdlsw -I../cs/dchdl/dchdlsw_link16 -I../cs/dchdl/dchdlsw_llapi -I../cs/dchdl/link_16_general -I../cs/dchdl/message_sequence -I../cs/dchdl/tcp_ip -I../cs/lrm/scserv -I../cs/rtdh -I../eo/anmeldung -I../eo/apc -I../eo/apc/corba -I../eo/apc/corba/dev_ctrl -I../eo/apc/socket_if -I../eo/apc/container -I../eo/apc/identification -I../eo/asmc/new_mapman_client/spv_client -I../eo/asmc/new_mapman_client/standard_routines -I../eo/asmc/real_asmc -I../eo/as_control -I../eo/as_type_conversions -I../eo/coordinate_routines_ss -I../eo/eo_main -I../eo/fsm -I../eo/general_utilities_ss -I../eo/general_utilities_ss/geometries -I../eo/general_utilities_ss/wgs84_conv -I../eo/isf -I../eo/jsm -I../eo/llapi_types -I../eo/protocol_handler -I../eo/protocol_handler/tcp_ip -I../eo/protocol_handler/track_transmit -I../eo/samocdef -I../eo/samocdef/tbm_samoc -I../eo/socbpv -I../eo/socbpv/db_handler -I../eo/socmapman -I../eo/socmapman/spv -I../eo/eommi/ -I../eo/eommi/oi/ -I../eo/eommi/oi/mmi_interface_definition/ -I../eo/eommi/oi_project/ -I../eo/eommi/oi/oix_oi_interface_definition/ -I../eo/eommi/oi/oix_to_oi_interface_implementation/socket_layer/ -I../eo/eommi/oi/oi_core/views/ -I../eo/eommi/oi/oi_core/ -I../eo/eommi/oi/oi_core/zyklop/ -I../eo/eommi/oi/oi_core/models/ -I../eo/eommi/oi/oi_core/controller/ -I../eo/eommi/oi/oi_core/views/geographical_views/ -I../eo/eommi/oi/oi_to_oix_interface_proxy/ -I../eo/eommi/oi_project/extern_to_mmi_interface_implementation/spv_layer/ = -I../eo/eommi/oi_project/extern_to_mmi_interface_implementation/netman_laye= r/ -I../eo/eommi/oi_project/mmi_to_extern_interface_proxy/ -I../eo/eommi/oi= /mmi_interface_definition/to_extern_interface_definition/ -I../eo/eommi/oi/= mmi_interface_definition/to_mmi_interface_definition/ -I../sysman/bridge -I= ../sysman/corba -I../sysman/eas -I../sysman/lrec -I../sysman/lrm/lrm_swe_ad= a -I../sysman/netman -I../sysman/port -I../sysman/syspro -I../sysman/top -I= ../mathlibs -I../cs/dchdl/dchdlsw_link22 -I../eo/link22 -I- /home/okellogg/= ada/mdlp/binsrc/eo/apc/apc.adb /home/okellogg/ada/mdlp/isf_pmc_interface/sp= v/ada/basic_types.ads /home/okellogg/ada/mdlp/binsrc/cs/dchdl/dchdlsw/dchdl= .adb /home/okellogg/ada/mdlp/binsrc/eo/anmeldung/eomain_anmeldung.adb /home= /okellogg/ada/mdlp/binsrc/sysman/port/exception_output.adb /home/okellogg/a= da/mdlp/binsrc/eo/link22/fsm_rx_receive.adb /home/okellogg/ada/mdlp/binsrc/= eo/socbpv/grunddaten.adb /home/okellogg/ada/mdlp/binsrc/cs/dchdl/dchdlsw_li= nk16/l16_dchdl_j28_2_text_message.ads /home/okellogg/ada/mdlp/binsrc/cs/dch= dl/dchdlsw_link16/link16_dchdl.adb /home/okellogg/ada/mdlp/binsrc/cs/dchdl/= dchdlsw_link22/link22_dchdl.adb /home/okellogg/ada/mdlp/binsrc/eo/apc/corba= /milipos_interface.adb /home/okellogg/ada/mdlp/binsrc/sysman/syspro/p_dialo= g.adb /home/okellogg/ada/mdlp/binsrc/cs/dchdl/dchdlsw_llapi/p_llapi.adb /ho= me/okellogg/ada/mdlp/binsrc/sysman/lrec/p_monserv.adb /home/okellogg/ada/md= lp/binsrc/cs/dchdl/dchdlsw/p_prot_automa.adb /home/okellogg/ada/mdlp/binsrc= /cs/rtdh/p_rtdhcnf_as.adb /home/okellogg/ada/mdlp/binsrc/cs/rtdh/p_rtdhcnf_= db.adb /home/okellogg/ada/mdlp/binsrc/cs/rtdh/p_rtdhcnf_dchdl.adb /home/oke= llogg/ada/mdlp/binsrc/eo/protocol_handler/protocol_handler.adb /home/okello= gg/ada/mdlp/binsrc/sysman/port/retrieve_exception.ads /home/okellogg/ada/md= lp/isf_pmc_interface/spv/spv_client/spv_mgmt.adb /home/okellogg/ada/mdlp/bi= nsrc/sysman/corba/strings.adb /home/okellogg/ada/mdlp/binsrc/sysman/corba/u= nix.adb Program received signal SIGTRAP, Trace/breakpoint trap. 0xb7fe0852 in ?? () from /lib/ld-linux.so.2 And now I'm getting lots of these SIGTRAP signals in gdb. So first question is: Did I use the "watch" command in the right way? And if so, why is gdb giving me all these SIGTRAPs? Thanks again, Oliver