public inbox for systemtap@sourceware.org
 help / color / mirror / Atom feed
* [Bug translator/12770] New: loc2c generates an unsupported deref(8,...) on i686
@ 2011-05-16 23:57 jistone at redhat dot com
  2011-05-17 16:45 ` [Bug translator/12770] " jistone at redhat dot com
  2011-05-21  6:11 ` jistone at redhat dot com
  0 siblings, 2 replies; 3+ messages in thread
From: jistone at redhat dot com @ 2011-05-16 23:57 UTC (permalink / raw)
  To: systemtap

http://sourceware.org/bugzilla/show_bug.cgi?id=12770

           Summary: loc2c generates an unsupported deref(8,...) on i686
           Product: systemtap
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: translator
        AssignedTo: systemtap@sourceware.org
        ReportedBy: jistone@redhat.com


On 32-bit x86, our deref macro only supports accessed of size 1, 2, or 4. 
However, on kernel-2.6.35.12-90.fc14.i686.PAE, the following test generates a
deref-8 call which can't be resolved:

$ stap -e 'probe kernel.function("pagemap_hugetlb_range") { println($pte->pte)
}' -p2 --vp 01
# functions
_dwarf_tvar_get_pte_0:long ()
%{
#define fetch_register k_fetch_register
#define store_register k_store_register
{
  {
    uint32_t addr;
    { // DWARF expression: 0x50
    { uint32_t value = fetch_register (0); addr = value; }
    }
    { uint64_t value = deref (8, addr); THIS->__retvalue = value; }
  }
  goto out;
if (0) goto deref_fault;
deref_fault:
  goto out;
}
/* pure *//* unprivileged */
#undef fetch_register

#undef store_register
%}
# probes
kernel.function("pagemap_hugetlb_range@fs/proc/task_mmu.c:655") /*
pc=_stext+0x119935 */ /* <- kernel.function("pagemap_hugetlb_range") */
println(_dwarf_tvar_get_pte_0())
Pass 2: analyzed script: 1 probe(s), 1 function(s), 0 embed(s), 0 global(s)
using 185848virt/104624res/77516shr kb, in 700usr/110sys/829real ms.


$ stap -e 'probe kernel.function("pagemap_hugetlb_range") { println($pte->pte)
}' -p4 --vp 0001
WARNING: "__get_user_bad"
[/tmp/stapwpN5rU/stap_b871dcd3c99d49de3d49b1b1faf1614a_1195.ko] undefined!
/home/jistone/.systemtap/cache/b8/stap_b871dcd3c99d49de3d49b1b1faf1614a_1195.ko
Pass 4: compiled C into "stap_b871dcd3c99d49de3d49b1b1faf1614a_1195.ko" in
2240usr/1520sys/4287real ms.


$ stap -e 'probe kernel.function("pagemap_hugetlb_range") { println($pte->pte)
}' --vp 00001
Pass 5: starting run.
Error inserting module
'/tmp/stapvnS0Fr/stap_b871dcd3c99d49de3d49b1b1faf1614a_1195.ko': Unknown symbol
in module
Error, 'stap_b871dcd3c99d49de3d49b1b1faf1614a_1195' is not a zombie systemtap
module.
Retrying, after attempted removal of module
stap_b871dcd3c99d49de3d49b1b1faf1614a_1195 (rc -5)
Error inserting module
'/tmp/stapvnS0Fr/stap_b871dcd3c99d49de3d49b1b1faf1614a_1195.ko': Unknown symbol
in module
Pass 5: run completed in 0usr/20sys/91real ms.
Pass 5: run failed.  Try again with another '--vp 00001' option.
$ dmesg | tail -n1
[ 1495.344015] stap_b871dcd3c99d49de3d49b1b1faf1614a_1195: Unknown symbol
__get_user_bad (err 0)

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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

* [Bug translator/12770] loc2c generates an unsupported deref(8,...) on i686
  2011-05-16 23:57 [Bug translator/12770] New: loc2c generates an unsupported deref(8,...) on i686 jistone at redhat dot com
@ 2011-05-17 16:45 ` jistone at redhat dot com
  2011-05-21  6:11 ` jistone at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: jistone at redhat dot com @ 2011-05-17 16:45 UTC (permalink / raw)
  To: systemtap

http://sourceware.org/bugzilla/show_bug.cgi?id=12770

--- Comment #1 from Josh Stone <jistone at redhat dot com> 2011-05-17 16:45:06 UTC ---
It seems that we have this issue with any 8-byte memory access.  A smaller
test:

$ cat deref8.h 
struct foo { long long bar; };

$ stap -e 'probe begin { println(@cast(0, "foo", "<deref8.h>")->bar) }' -vp2
Pass 1: parsed user script and 76 library script(s) using
191836virt/22452res/2832shr kb, in 130usr/20sys/158real ms.
# functions
_dwarf_cast_get_cast_0:long (pointer:long)
%{
#define fetch_register u_fetch_register
#define store_register u_store_register
{
  {
    uintptr_t addr;
    { // synthesized
      addr = THIS->pointer;
    }
    { // DWARF expression: 0x23
      {
        uintptr_t s0;
        s0 = addr;
        s0 = s0 + 0UL;
        addr = s0;
      }
    }
    { int64_t value = deref (8, addr); THIS->__retvalue = value; }
  }
  goto out;
if (0) goto deref_fault;
deref_fault:
  goto out;
}
/* pure *//* unprivileged */
#undef fetch_register

#undef store_register
%}
# probes
begin /* <- begin */
println(_dwarf_cast_get_cast_0(0))
Pass 2: analyzed script: 1 probe(s), 1 function(s), 0 embed(s), 0 global(s)
using 194484virt/23664res/3356shr kb, in 10usr/0sys/6real ms.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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

* [Bug translator/12770] loc2c generates an unsupported deref(8,...) on i686
  2011-05-16 23:57 [Bug translator/12770] New: loc2c generates an unsupported deref(8,...) on i686 jistone at redhat dot com
  2011-05-17 16:45 ` [Bug translator/12770] " jistone at redhat dot com
@ 2011-05-21  6:11 ` jistone at redhat dot com
  1 sibling, 0 replies; 3+ messages in thread
From: jistone at redhat dot com @ 2011-05-21  6:11 UTC (permalink / raw)
  To: systemtap

http://sourceware.org/bugzilla/show_bug.cgi?id=12770

Josh Stone <jistone at redhat dot com> changed:

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

--- Comment #2 from Josh Stone <jistone at redhat dot com> 2011-05-21 06:11:00 UTC ---
It turns out that loc2c already had code that was supposed to deal with this,
discontiguify(), but that failed on certain inputs.  Tweaked in commit
315bfa79.

-- 
Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

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

end of thread, other threads:[~2011-05-21  6:11 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-05-16 23:57 [Bug translator/12770] New: loc2c generates an unsupported deref(8,...) on i686 jistone at redhat dot com
2011-05-17 16:45 ` [Bug translator/12770] " jistone at redhat dot com
2011-05-21  6:11 ` jistone 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).