Bug 867913 - Assertion `dwarf_tag(cu_die) == DW_TAG_compile_unit || dwarf_tag(cu_die) == DW_TAG_type_unit' failed.
Assertion `dwarf_tag(cu_die) == DW_TAG_compile_unit || dwarf_tag(cu_die) == D...
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: systemtap (Show other bugs)
18
Unspecified Unspecified
unspecified Severity unspecified
: ---
: ---
Assigned To: Mark Wielaard
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-10-18 10:44 EDT by Roman Rakus
Modified: 2014-01-12 19:14 EST (History)
10 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-04-26 08:37:48 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Sourceware 14742 None None None Never

  None (edit)
Description Roman Rakus 2012-10-18 10:44:14 EDT
Description of problem:
When trying to use:
# stap -e 'probe process("/usr/lib64/cmpi/libcmpiCura_Account.so").function("*") { println(probefunc()); println($$parms$$) }'
I got the $Summary

Version-Release number of selected component (if applicable):
# stap -V 
Systemtap translator/driver (version 2.0/0.155, rpm 2.0-1.fc18)
Copyright (C) 2005-2012 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
enabled features: AVAHI LIBRPM LIBSQLITE3 NSS BOOST_SHARED_PTR TR1_UNORDERED_MAP NLS DYNINST
Comment 1 Mark Wielaard 2012-10-18 11:06:58 EDT
The core issue is that systemtap dwflpp.cxx isn't expecting a DW_TAG_partial_unit which dwz generates now.

Simplest patch seems to be:

diff --git a/dwflpp.cxx b/dwflpp.cxx
index 5e27577..7921c99 100644
--- a/dwflpp.cxx
+++ b/dwflpp.cxx
@@ -1081,7 +1081,13 @@ dwflpp::iterate_over_globals (Dwarf_Die *cu_die,
 {
   assert (cu_die);
   assert (dwarf_tag(cu_die) == DW_TAG_compile_unit
-         || dwarf_tag(cu_die) == DW_TAG_type_unit);
+         || dwarf_tag(cu_die) == DW_TAG_type_unit
+         || dwarf_tag(cu_die) == DW_TAG_partial_unit);
+
+  // Ignore partial_unit, if they get imported by a real unit, then
+  // iterate_over_types will traverse them.
+  if (dwarf_tag(cu_die) == DW_TAG_partial_unit)
+    return DWARF_CB_OK;
 
   // If this is C++, recurse for any inner types
   bool has_inner_types = dwarf_srclang(cu_die) == DW_LANG_C_plus_plus;
@@ -1120,6 +1126,9 @@ dwflpp::iterate_over_types (Dwarf_Die *top_die,
       case DW_TAG_namespace:
         rc = (*callback)(&die, has_inner_types, prefix, data);
         break;
+      case DW_TAG_imported_unit:
+        rc = iterate_over_types(&die, has_inner_types, prefix, callback, data);
+        break;
       }
   while (rc == DWARF_CB_OK && dwarf_siblingof(&die, &die) == 0);
 
But there are a couple of other places where dwflpp.cxx does manual dwarf_child/dwarf_siblingof traversal which might need to account for DW_TAG_imported_unit.
Comment 2 Mark Wielaard 2012-10-21 20:05:49 EDT
There is more to it than the part in comment #1. See upstream bug/commit for a more complete fix:
http://sourceware.org/bugzilla/show_bug.cgi?id=14742

Note You need to log in before you can comment on or make changes to this bug.