commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrey Loskutov (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (BCEL-273) Regressions running FindBugs on BCEL6
Date Wed, 08 Jun 2016 14:56:20 GMT

     [ https://issues.apache.org/jira/browse/BCEL-273?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Andrey Loskutov updated BCEL-273:
---------------------------------
    Attachment: BetterCFGBuilder2.java

[~dbrosius]: thanks for the pointers! 

I've pushed https://github.com/findbugsproject/findbugs/commits/java9_bcel6_old branch which
applies the DismantleBytecode fix proposed earlier - this works!

The current (last visible) problem is ClassCastException in org.apache.commons.bcel6.generic.BranchHandle.getBI(BranchHandle.java:64).

If I change BranchHandle.java to https://github.com/iloveeclipse/commons-bcel/commit/25dfa20fd99e4053e68b6054ff21f55fd915e003,
the CCE disappear and all FB tests pass on Java 8.

However I've failed to do a fix on the FB side which would NOT require https://github.com/iloveeclipse/commons-bcel/commit/25dfa20fd99e4053e68b6054ff21f55fd915e003.


If I change FB code, see attached BetterCFGBuilder2.java, I see other errors, and tests are
still failing.

I've never used BCEL before, so my primitive fix was to replace calls to 
{code}
InstructionHandle head;
Instruction replacement;
...
head.swapInstruction(replacement);
{code}

with 
{code}
...
   head = swapInstruction(instructionList, head, replacement);
...
    static InstructionHandle swapInstruction(InstructionList list, InstructionHandle handle,
Instruction i){
        InstructionHandle newOne = list.insert(handle, i);
        try {
            list.delete(handle);
        } catch (TargetLostException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return newOne;
    }
{code}

I'm not sure if replacing BranchInstruction by ConversionInstruction in the way as it shown
above is a good idea (I see that the TargetLostException are flying around which means we
have some loose ends in the list). But honestly speaking, I have no clue how the BetterCFGBuilder2
code works and how to fix it in the "right" way.

In that sense, [~sebb@apache.org]: WDYT about https://github.com/iloveeclipse/commons-bcel/commit/25dfa20fd99e4053e68b6054ff21f55fd915e003?

> Regressions running FindBugs on BCEL6
> -------------------------------------
>
>                 Key: BCEL-273
>                 URL: https://issues.apache.org/jira/browse/BCEL-273
>             Project: Commons BCEL
>          Issue Type: Bug
>          Components: Main
>    Affects Versions: 6.0
>            Reporter: Andrey Loskutov
>            Priority: Blocker
>             Fix For: 6.0
>
>         Attachments: BetterCFGBuilder2.java, bcel6_test_result.txt, invokedynamic.txt
>
>
> h5. PREFACE
> I'm trying to port FindBugs to the latest greatest BCEL 6 state from trunk, see https://github.com/findbugsproject/findbugs/issues/106.
> In short, FindBugs was using some manually created BCEL 5.2 fork which allowed us somehow
run BCEL on Java 8 and even Java 9.
> Unfortunately I have no idea how to rebuild that fork, because no one in the project
left any documentation.
> So anyway, my goal was to use unmodified BCEL6, therefore I fixed all compile issues
caused by BCEL-222 ((n)) and was able to run FB with BCEL6 head.
>  
> Unfortunately I found some regressions.
> h5. Environment
> I'm using my own git clone from BCEL mirror https://github.com/iloveeclipse/commons-bcel/commits/trunk
> The clone only adds few Eclipse files and fixes some obvious errors, nothing worth to
mention here. The reason why I'm not using svn because it is too slow and I won't waste my
time.
> To see commits I needed to port FB to BCEL6 port, go to https://github.com/findbugsproject/findbugs/tree/java9_bcel6
> h5. How to reproduce
> {code}
> git clone https://github.com/findbugsproject/findbugs.git
> cd findbugs
> git checkout java9_bcel6
> cd findbugs
> ant
> cd ../findbugsTestCases
> ant
> {code}
> You should run Java 8.
> After running tests, you should see many various errors, like: https://github.com/findbugsproject/findbugs/files/300401/bcel6_test_result.txt
> None of those error appear with the old private patched BCEL5.2 snapshot we've used before.
> It would be nice to fix the errors before the BCEL release.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message