From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3629 invoked by alias); 5 Aug 2012 18:51:45 -0000 Received: (qmail 3618 invoked by uid 22791); 5 Aug 2012 18:51:43 -0000 X-SWARE-Spam-Status: No, hits=-3.6 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,KHOP_THREADED,TW_DW,TW_FL,TW_MJ,TW_TM X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Sun, 05 Aug 2012 18:51:31 +0000 From: "mjw at redhat dot com" To: systemtap@sourceware.org Subject: [Bug translator/14434] dwflpp sometimes caches incomplete class_type Date: Sun, 05 Aug 2012 18:51:00 -0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: systemtap X-Bugzilla-Component: translator X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: mjw at redhat dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: systemtap at sourceware dot org X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Mailing-List: contact systemtap-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: systemtap-owner@sourceware.org X-SW-Source: 2012-q3/txt/msg00153.txt.bz2 http://sourceware.org/bugzilla/show_bug.cgi?id=14434 --- Comment #1 from Mark Wielaard 2012-08-05 18:51:29 UTC --- The reason it sometimes fails is that dwflpp::global_alias_caching_callback puts types in an unordered_map (cu_type_cache_t) and depending on the order this map is filled in it might pick the "wrong" class_type for Heap. It can pick the wrong one since there are two in this example: $ eu-readelf --debug-dump=info prog [...] [ b] compile_unit producer (strp) "GNU C++ 4.7.1 20120629 (Red Hat 4.7.1-1) -fpreprocessed -mtune=generic -march=x86-64 -g -O2" language (data1) C++ (4) name (strp) "main.cxx" comp_dir (strp) "/home/mark/src/tests/cxx-decl" ranges (sec_offset) range list [ 0] low_pc (addr) 000000000000000000 stmt_list (sec_offset) 0 [...] [ 289] class_type name (strp) "Heap" byte_size (data1) 16 decl_file (data1) 6 decl_line (data1) 3 sibling (ref4) [ 2a6] [ 295] subprogram external (flag_present) Yes name (strp) "header_size" decl_file (data1) 6 decl_line (data1) 11 linkage_name (strp) "_ZN4Heap11header_sizeEv" type (ref4) [ 30] accessibility (data1) public (1) declaration (flag_present) Yes [ 38e] compile_unit producer (strp) "GNU C++ 4.7.1 20120629 (Red Hat 4.7.1-1) -fpreprocessed -mtune=generic -march=x86-64 -g -O2" language (data1) C++ (4) name (strp) "heap.cxx" comp_dir (strp) "/home/mark/src/tests/cxx-decl" low_pc (addr) 0x00000000004005b0 <_ZN4Heap11header_sizeEv> high_pc (addr) 0x00000000004005ec stmt_list (sec_offset) 220 [...] [ 610] class_type name (strp) "Heap" byte_size (data1) 16 decl_file (data1) 5 decl_line (data1) 3 sibling (ref4) [ 67e] [ 61c] member name (strp) "_memory" decl_file (data1) 5 decl_line (data1) 6 type (ref4) [ 412] data_member_location (data1) 0 [ 628] member name (strp) "_size" decl_file (data1) 5 decl_line (data1) 7 type (ref4) [ 3b7] data_member_location (data1) 8 [ 634] subprogram external (flag_present) Yes name (strp) "Heap" decl_file (data1) 5 decl_line (data1) 9 accessibility (data1) public (1) declaration (flag_present) Yes object_pointer (ref4) [ 644] sibling (ref4) [ 64a] [ 644] formal_parameter type (ref4) [ 67e] artificial (flag_present) Yes [ 64a] subprogram external (flag_present) Yes name (strp) "allocate" decl_file (data1) 5 decl_line (data1) 10 linkage_name (strp) "_ZN4Heap8allocateEm" type (ref4) [ 410] accessibility (data1) public (1) declaration (flag_present) Yes object_pointer (ref4) [ 662] sibling (ref4) [ 66d] [ 662] formal_parameter type (ref4) [ 67e] artificial (flag_present) Yes [ 667] formal_parameter type (ref4) [ 3b7] [ 66d] subprogram external (flag_present) Yes name (strp) "header_size" decl_file (data1) 5 decl_line (data1) 11 linkage_name (strp) "_ZN4Heap11header_sizeEv" type (ref4) [ 3b7] accessibility (data1) public (1) declaration (flag_present) Yes Note how the first one in the main.cxx compile_unit is incomplete. It only contains the header_size subprogram member (since that is the only member used in main.cxx). By just looking at the class_type DIE we cannot tell which one we need though, since both [ 289] and [ 610] look identical, both have a byte_size attribute and neither is marked as declaration. I think this is a gcc DWARF generation bug: http://gcc.gnu.org/bugzilla/show_bug.cgi?id=54181 " partial DW_TAG_class_type generated with DW_AT_byte_size and without DW_AT_declaration" -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are the assignee for the bug.