This is the mail archive of the systemtap@sourceware.org mailing list for the systemtap project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug translator/18936] script cache will fail if $jiffies is referenced


https://sourceware.org/bugzilla/show_bug.cgi?id=18936

Josh Stone <jistone at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |jistone at redhat dot com

--- Comment #1 from Josh Stone <jistone at redhat dot com> ---
I found that dwflpp::literal_stmt_for_local is passing the address of stack
variable "addr_loc" into c_translate_location(), which eventually saves that
into loc->ops.  By the time this is used by emit_header(), via
express_as_string(), that addr_loc has gone out of scope and is clobbered on
the stack.

If we lift addr_loc to the top of the function, it will live long enough for
emit_header() to comment it correctly.

-- a/dwflpp.cxx
+++ b/dwflpp.cxx
@@ -3860,6 +3860,7 @@ dwflpp::literal_stmt_for_local (vector<Dwarf_Die>&
scopes,
                                 bool lvalue,
                                 Dwarf_Die *die_mem)
 {
+  Dwarf_Op addr_loc;
   Dwarf_Die vardie;
   Dwarf_Attribute fb_attr_mem, *fb_attr = NULL;

@@ -3890,7 +3891,6 @@ dwflpp::literal_stmt_for_local (vector<Dwarf_Die>&
scopes,
   if (dwarf_attr_integrate (&vardie, DW_AT_const_value, &attr_mem) == NULL
       && dwarf_attr_integrate (&vardie, DW_AT_location, &attr_mem) == NULL)
     {
-      Dwarf_Op addr_loc;
       memset(&addr_loc, 0, sizeof(Dwarf_Op));
       addr_loc.atom = DW_OP_addr;
       // If it is an external variable try the symbol table. PR10622.


Now I get a consistent "// DWARF expression: 0x3(-2118082560)", which is
DW_OP_addr with the relative address.

-- 
You are receiving this mail because:
You are the assignee for the bug.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]