[RFC updated PATCHES] Bug Translator 3016 : Error accessing members of anonymous structs / unions
Prerna Saxena
prerna@linux.vnet.ibm.com
Wed Sep 17 11:24:00 GMT 2008
Hi Masami,
Thanks for letting me know..
It pointed me to an incorrect pointer reference that I had
overlooked...Its funny why this was never uncovered in all test-runs I
had on x86 & x86_64 :-)
Here's the updated patch...with this, your test script correctly throws
a semantic error instead of causing SEGV.
Masami Hiramatsu wrote:
> Hi Prerna,
>
> Prerna Saxena wrote:
>> Agree, but making "die_mem" as the 6th arg will disturb the call flow.
>> This is because in each recursive call, the 6th arg is overwritten by
>> a die which is pointed to by DW_AT_type attribute of the original
>> attr_mem. If die_mem is re-used as 6th arg instead of a new variable,
>> the old contents of die (in the parent recursive call) will also be
>> lost as both die & die_mem point to the same location, (whose
>> contents would be overwritten). This is not a problem if search in a
>> branch has succeeded-- but in case a search path fails and a new
>> branch needs to be tried, this will deem it impossible.
>>
>> I agree with your concern about "temp_die_2" being local memory on
>> the stack which may be reused, so I've fixed it by copying the
>> contents of "temp_die_2" to "die_mem" in case of a successful match.
>> This should take care of memory errors.
>
> Hmm, you seems right, but the below command still cause SEGV.
>
> $ stap -e 'probe
> module("libsas").function("sas_ex_revalidate_domain"){print($port_dev->ex_dev->children)}'
> -vp2
> Pass 1: parsed user script and 45 library script(s) in
> 370usr/30sys/404real ms.
> Segmentation fault
>
> Would you run above command for testing & debugging?
>
> Thank you,
>
Thanks & regards,
--
Prerna Saxena
Linux Technology Centre,
IBM Systems and Technology Lab,
Bangalore, India
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: anon-union-1.patch
URL: <http://sourceware.org/pipermail/systemtap/attachments/20080917/ea9ba820/attachment.ksh>
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: anon-union-2.patch
URL: <http://sourceware.org/pipermail/systemtap/attachments/20080917/ea9ba820/attachment-0001.ksh>
More information about the Systemtap
mailing list