[
https://issues.jboss.org/browse/JBTM-2553?page=com.atlassian.jira.plugin....
]
Andrew Dinn edited comment on JBTM-2553 at 11/26/15 4:18 AM:
-------------------------------------------------------------
Doh! I see Amos is way ahead of me here (nice work, Amos :-)
The trace statement Amos inserted shows that the local variable checking code has found an
entry in the local var table for $this but one that starts at bytecode offset 4 and ends
at offset 535. The injection code is trying to inject the rule at offset 0 i.e. at entry
to the code. This is after transformation by Jacoco. With no transformation the local var
this is found starting at offset 0.
I have not yet looked at the Jacoco code but it seems pretty obvious what is happening.
When Jacoco inserts profiling instructions into the method it updates the start and end
offsets for entries in the local variable table to take account of the new code. One of
those profiling instruction sequences will be injected at the start of the method and
Jacoco appears to be shifting the local var start offset for this so that it comes into
scope after the profiling code rather than at bytecode 0. No doubt it is also shifting the
start position for method parameter entries.
This is at best unhelpful; actually, I think it is an error because this and the
parameters are /always/ in scope from the start of the method even if code is inserted
before the start. I thought that ASM fixed this as a special case. Which version of Jacoco
is being used here? The latest Jacoco version uses ASM 5 which shoudl deal with this
problem. Have you tried updating to a later Jacoco? If that doesn't work I'll take
this up with the Jacoco developers.
was (Author: adinn):
Doh! I see Amos is way ahead of me here (nice work, Amos :-)
The trace statement Amos inserted shows that the local variable checking code has found an
entry in the local var table for $this but one that starts at bytecode offset 4 and ends
at offset 535. The injection code is trying to inject the rule at offset 0 i.e. at entry
to the code. This is after transformation by Jacoco. With no transformation the local var
this is found tarting at offset 0.
I have not yet looked at the Jacoco code but it seems pretty obvious what is happening.
When Jacoco inserts profiling instructions into the method it updates the start and end
offsets for entries in the local variable table to take account of the new code. One of
those profiling instruction sequences will be injected at the start of the method and
Jacoco appears to be shifting the local var start offset for this so that it comes into
scope after the profiling code rather than at bytecode 0. No doubt it is also shifting the
start position for method parameter entries.
This is at best unhelpful; actually, I think it is an error because this and the
parameters are /always/ in scope from the start of the method even if code is inserted
before the start. I thought that ASM fixed this as a special case. Which version of Jacoco
is being used here? The latest Jacoco version uses ASM 5 which shoudl deal with this
problem. Have you tried updating to a later Jacoco? If that doesn't work I'll take
this up with the Jacoco developers.
Investigate the test with byteman do not work with the jacoco
-------------------------------------------------------------
Key: JBTM-2553
URL:
https://issues.jboss.org/browse/JBTM-2553
Project: JBoss Transaction Manager
Issue Type: Sub-task
Components: Testing
Reporter: Amos Feng
Assignee: Amos Feng
Fix For: 5.next
--
This message was sent by Atlassian JIRA
(v6.4.11#64026)