This is the mail archive of the
systemtap@sourceware.org
mailing list for the systemtap project.
Re: [RFC PATCH 1/2] Bug Translator 3016 : Error accessing members of anonymous structs / unions
- From: Masami Hiramatsu <mhiramat at redhat dot com>
- To: Prerna Saxena <prerna at linux dot vnet dot ibm dot com>
- Cc: systemtap at sourceware dot org
- Date: Fri, 29 Aug 2008 18:03:27 -0400
- Subject: Re: [RFC PATCH 1/2] Bug Translator 3016 : Error accessing members of anonymous structs / unions
- References: <48B7BE86.9070905@linux.vnet.ibm.com>
Hi Prerna,
Prerna Saxena wrote:
Hi all,
This patch modifies tapsets.cxx to enable members of anonymous structs/
unions to be recognised by the systemtap translator.
Pls let me know your comments..
I'm interested in this feature.
I tested your patches on x86-64 with elfutils-0.137, and I got a SEGV
when I ran following command:
$ stap -e 'probe module("libsas").function("sas_ex_revalidate_domain")
{print($port_dev->ex_dev->children)}' -vvvp2
SystemTap translator/driver (version 0.7.1/0.137 git branch master,
commit 38fc2504 + changes)
Copyright (C) 2005-2008 Red Hat, Inc. and others
This is free software; see the source for copying conditions.
Session arch: x86_64 release: 2.6.18-92.el5
Created temporary directory "/tmp/stapQefK9v"
Searched '/usr/share/systemtap/tapset/x86_64/*.stp', found 2
Searched '/usr/share/systemtap/tapset/*.stp', found 41
Pass 1: parsed user script and 43 library script(s) in
380usr/20sys/533real ms.
control symbols: kts: 0xffffffff80064c68 kte: 0xffffffff80067956 stext:
0xffffffff80001000
parsed 'sas_ex_revalidate_domain' -> func 'sas_ex_revalidate_domain'
blacklist regexps:
blfn:
^(atomic_notifier_call_chain|default_do_nmi|__die|die_nmi|do_debug|do_general_protection|do_int3|do_IRQ|do_page_fault|do_sparc64_fault|do_trap|dummy_nmi_callback|flush_icache_range|ia64_bad_break|ia64_do_page_fault|ia64_fault|io_check_error|mem_parity_error|nmi_watchdog_tick|notifier_call_chain|oops_begin|oops_end|program_check_exception|single_step_exception|sync_regs|unhandled_fault|unknown_nmi_error|.*raw_.*lock.*|.*read_.*lock.*|.*write_.*lock.*|.*spin_.*lock.*|.*rwlock_.*lock.*|.*rwsem_.*lock.*|.*mutex_.*lock.*|raw_.*|.*seq_.*lock.*|atomic_.*|atomic64_.*|get_bh|put_bh|.*apic.*|.*APIC.*|.*softirq.*|.*IRQ.*|.*_intr.*|__delay|.*kernel_text.*|get_current|current_.*|.*exception_tables.*|.*setup_rt_frame.*|.*preempt_count.*|preempt_schedule|__switch_to)$
blfn_ret: ^(do_exit|sys_exit|sys_exit_group)$
blfile: ^(kernel/kprobes.c|arch/.*/kernel/kprobes.c)$
focused on module 'libsas = [0x759a600-0x75aadc9, bias 0x0] file
/usr/lib/debug/lib/modules/2.6.18-92.el5/kernel/drivers/scsi/libsas/libsas.ko.debug
ELF machine x86_64 (code 62)
selected function sas_ex_revalidate_domain
probe sas_ex_revalidate_domain@drivers/scsi/libsas/sas_expander.c:1861
module=libsas reloc=.text section=.text pc=0x759ded1
finding location for local 'port_dev' near address 759ded1, module bias 0
Segmentation fault
----
And here is the output of gdb
$ gdb stap
GNU gdb Red Hat Linux (6.5-37.el5rh)
Copyright (C) 2006 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain
conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB. Type "show warranty" for details.
This GDB was configured as "x86_64-redhat-linux-gnu"...Using host
libthread_db library "/lib64/libthread_db.so.1".
(gdb) r -e 'probe module("libsas").function("sas_ex_revalidate_domain")
{print($port_dev->ex_dev->children)}'
Starting program: /usr/bin/stap -e 'probe
module("libsas").function("sas_ex_revalidate_domain")
{print($port_dev->ex_dev->children)}'
[Thread debugging using libthread_db enabled]
[New Thread 47364313547600 (LWP 3183)]
Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 47364313547600 (LWP 3183)]
0x00002b13dbba7fd3 in __libdw_find_attr (die=0x7fffcf43f930, search_name=3,
codep=0x7fffcf43f9c0, formp=0x7fffcf43f9c4)
at elfutils-0.137/libdw/dwarf_child.c:67
67 elfutils-0.137/libdw/dwarf_child.c: No such file or directory.
in elfutils-0.137/libdw/dwarf_child.c
Current language: auto; currently c
(gdb) p *die
$1 = {addr = 0x2b13e69c2d6b, cu = 0x765c800000aa3d00, abbrev =
0x7fffcf43f930,
padding__ = 140736670726592}
-----
it seems that die is not initialized.
Thank you,
--
Masami Hiramatsu
Software Engineer
Hitachi Computer Products (America) Inc.
Software Solutions Division
e-mail: mhiramat@redhat.com