[jbossts-issues] [JBoss JIRA] (JBTM-2553) Investigate the test with byteman do not work with the jacoco

Andrew Dinn (JIRA) issues at jboss.org
Thu Nov 26 04:18:00 EST 2015

    [ https://issues.jboss.org/browse/JBTM-2553?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13134060#comment-13134060 ] 

Andrew Dinn commented on JBTM-2553:

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

More information about the jbossts-issues mailing list