public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug translator/17959] New: Something (broken DWARF?) causes Systemtap to generate C code with uint0_t types
@ 2015-02-11 15:36 aram.h at mgk dot ro
  2015-02-11 15:38 ` [Bug translator/17959] " aram.h at mgk dot ro
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: aram.h at mgk dot ro @ 2015-02-11 15:36 UTC (permalink / raw)
  To: systemtap

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

            Bug ID: 17959
           Summary: Something (broken DWARF?) causes Systemtap to generate
                    C code with uint0_t types
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: translator
          Assignee: systemtap at sourceware dot org
          Reporter: aram.h at mgk dot ro
                CC: mjw at redhat dot com

When using systemtap on Go binaries that work around issue 17957 and 17958,
systemtap will fail to create the kernel module because the generated C code
uses uint0_t types:

/tmp/stapUOqJjk/stap_ea1e3b08acea61492ed2615b6f549cbe_535512_src.c: In function
‘function__dwarf_tvar_get__p__261’:
/tmp/stapUOqJjk/stap_ea1e3b08acea61492ed2615b6f549cbe_535512_src.c:12640:7:
error: unknown type name ‘uint0_t’
     { uint0_t value = deref (sizeof addr, addr); addr = value; }
       ^
/tmp/stapUOqJjk/stap_ea1e3b08acea61492ed2615b6f549cbe_535512_src.c: In function
‘function__dwarf_tvar_get__p__585’:
/tmp/stapUOqJjk/stap_ea1e3b08acea61492ed2615b6f549cbe_535512_src.c:12712:7:
error: unknown type name ‘uint0_t’
     { uint0_t value = deref (sizeof addr, addr); addr = value; }
       ^
/tmp/stapUOqJjk/stap_ea1e3b08acea61492ed2615b6f549cbe_535512_src.c: In function
‘function__dwarf_tvar_get_addr_647’:
/tmp/stapUOqJjk/stap_ea1e3b08acea61492ed2615b6f549cbe_535512_src.c:13060:7:
error: unknown type name ‘uint0_t’
     { uint0_t value = deref (sizeof addr, addr); addr = value; }
       ^

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug translator/17959] Something (broken DWARF?) causes Systemtap to generate C code with uint0_t types
  2015-02-11 15:36 [Bug translator/17959] New: Something (broken DWARF?) causes Systemtap to generate C code with uint0_t types aram.h at mgk dot ro
@ 2015-02-11 15:38 ` aram.h at mgk dot ro
  2015-02-11 20:32 ` aram.h at mgk dot ro
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: aram.h at mgk dot ro @ 2015-02-11 15:38 UTC (permalink / raw)
  To: systemtap

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

Aram Hăvărneanu <aram.h at mgk dot ro> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |aram.h at mgk dot ro

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug translator/17959] Something (broken DWARF?) causes Systemtap to generate C code with uint0_t types
  2015-02-11 15:36 [Bug translator/17959] New: Something (broken DWARF?) causes Systemtap to generate C code with uint0_t types aram.h at mgk dot ro
  2015-02-11 15:38 ` [Bug translator/17959] " aram.h at mgk dot ro
@ 2015-02-11 20:32 ` aram.h at mgk dot ro
  2015-02-11 20:33 ` aram.h at mgk dot ro
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: aram.h at mgk dot ro @ 2015-02-11 20:32 UTC (permalink / raw)
  To: systemtap

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

--- Comment #1 from Aram Hăvărneanu <aram.h at mgk dot ro> ---
Created attachment 8122
  --> https://sourceware.org/bugzilla/attachment.cgi?id=8122&action=edit
Generated src.c.

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug translator/17959] Something (broken DWARF?) causes Systemtap to generate C code with uint0_t types
  2015-02-11 15:36 [Bug translator/17959] New: Something (broken DWARF?) causes Systemtap to generate C code with uint0_t types aram.h at mgk dot ro
  2015-02-11 15:38 ` [Bug translator/17959] " aram.h at mgk dot ro
  2015-02-11 20:32 ` aram.h at mgk dot ro
@ 2015-02-11 20:33 ` aram.h at mgk dot ro
  2015-02-11 21:18 ` mjw at redhat dot com
  2015-04-09 14:56 ` mjw at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: aram.h at mgk dot ro @ 2015-02-11 20:33 UTC (permalink / raw)
  To: systemtap

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

--- Comment #2 from Aram Hăvărneanu <aram.h at mgk dot ro> ---
Added generated src.c.

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug translator/17959] Something (broken DWARF?) causes Systemtap to generate C code with uint0_t types
  2015-02-11 15:36 [Bug translator/17959] New: Something (broken DWARF?) causes Systemtap to generate C code with uint0_t types aram.h at mgk dot ro
                   ` (2 preceding siblings ...)
  2015-02-11 20:33 ` aram.h at mgk dot ro
@ 2015-02-11 21:18 ` mjw at redhat dot com
  2015-04-09 14:56 ` mjw at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: mjw at redhat dot com @ 2015-02-11 21:18 UTC (permalink / raw)
  To: systemtap

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

--- Comment #3 from Mark Wielaard <mjw at redhat dot com> ---
This seems to be caused by a "sizeless" pointer type.

The following quick hack seems to solve the issue:

diff --git a/loc2c.c b/loc2c.c
index aef999c..b179240 100644
--- a/loc2c.c
+++ b/loc2c.c
@@ -2132,7 +2132,7 @@ c_translate_pointer (struct obstack *pool, int indent,
   Dwarf_Attribute attr_mem;
   Dwarf_Word byte_size;
   if (dwarf_attr_integrate (typedie, DW_AT_byte_size, &attr_mem) == NULL)
-    byte_size = 0;
+    byte_size = max_fetch_size (*input, typedie);
   else if (dwarf_formudata (&attr_mem, &byte_size) != 0)
     FAIL (*input,
          N_("cannot get byte_size attribute for type %s: %s"),

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [Bug translator/17959] Something (broken DWARF?) causes Systemtap to generate C code with uint0_t types
  2015-02-11 15:36 [Bug translator/17959] New: Something (broken DWARF?) causes Systemtap to generate C code with uint0_t types aram.h at mgk dot ro
                   ` (3 preceding siblings ...)
  2015-02-11 21:18 ` mjw at redhat dot com
@ 2015-04-09 14:56 ` mjw at redhat dot com
  4 siblings, 0 replies; 6+ messages in thread
From: mjw at redhat dot com @ 2015-04-09 14:56 UTC (permalink / raw)
  To: systemtap

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

Mark Wielaard <mjw at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #4 from Mark Wielaard <mjw at redhat dot com> ---
commit 4bfa7779843bda6f74c547a42a092a2974d07b9e
Author: Mark Wielaard <mjw@redhat.com>
Date:   Thu Apr 9 16:51:56 2015 +0200

    PR17959 Allow size-less pointer types.

    golang might produce a DW_TAG_pointer_type without any size. Assume
    the size of the pointer is equal to the address size of the DWARF CU
    in that case. Otherwise we might try to create values of type uint0_t.

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2015-04-09 14:56 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-02-11 15:36 [Bug translator/17959] New: Something (broken DWARF?) causes Systemtap to generate C code with uint0_t types aram.h at mgk dot ro
2015-02-11 15:38 ` [Bug translator/17959] " aram.h at mgk dot ro
2015-02-11 20:32 ` aram.h at mgk dot ro
2015-02-11 20:33 ` aram.h at mgk dot ro
2015-02-11 21:18 ` mjw at redhat dot com
2015-04-09 14:56 ` mjw at redhat dot com

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).