You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@commons.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2019/02/11 13:59:00 UTC

[jira] [Work logged] (BCEL-267) Race conditions on static fields in BranchHandle and InstructionHandle

     [ https://issues.apache.org/jira/browse/BCEL-267?focusedWorklogId=196930&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-196930 ]

ASF GitHub Bot logged work on BCEL-267:
---------------------------------------

                Author: ASF GitHub Bot
            Created on: 11/Feb/19 13:58
            Start Date: 11/Feb/19 13:58
    Worklog Time Spent: 10m 
      Work Description: garydgregory commented on pull request #23: [BCEL-267] Race conditions on static fields in BranchHandle and
URL: https://github.com/apache/commons-bcel/pull/23
 
 
   Applied a modified version of the patch in [BCEL-267] https://issues.apache.org/jira/browse/BCEL-267
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

            Worklog Id:     (was: 196930)
            Time Spent: 10m
    Remaining Estimate: 0h

> Race conditions on static fields in BranchHandle and InstructionHandle
> ----------------------------------------------------------------------
>
>                 Key: BCEL-267
>                 URL: https://issues.apache.org/jira/browse/BCEL-267
>             Project: Commons BCEL
>          Issue Type: Bug
>          Components: Main
>    Affects Versions: 5.2
>            Reporter: Stephan Herrmann
>            Priority: Major
>         Attachments: BCEL267--Race-conditions-on-static-fields-in-BranchH.patch
>
>          Time Spent: 10m
>  Remaining Estimate: 0h
>
> I have observed race conditions causing NullPointerException like this
> {code}java.lang.NullPointerException
>         at org.apache.bcel.generic.InstructionList.getInstructionHandles(InstructionList.java:1021)
>         at org.apache.bcel.generic.InstructionList.findHandle(InstructionList.java:141)
>         at org.apache.bcel.generic.MethodGen.<init>(MethodGen.java:194)
> {code}
> In the debugger I could verify that concurrent access to the fields {{BranchHandle.bh_list}} or {{InstructionHandle.ih_list}} can cause corruption of those lists.
> I succeeded to make the exception less frequent by adding synchronized blocks, but still the exception could be observed. I concluded that for safe protection the fields would need to be made volatile, which in the end might actually defeat their original purpose of optimization.
> I have since then run with a patched version of BCEL, where those static fields were simply removed and new Handles were created on every request. This variant finally was free of the race condition.
> Seeing activity towards a 6.0 release, I'd appreciate if this change could be incorporated.
> The original bug tracking my experiments can be found in Eclipse bugzilla: https://bugs.eclipse.org/344350
> The modified classes (based on 5.2) can be found here:
> - http://git.eclipse.org/c/objectteams/org.eclipse.objectteams.git/tree/plugins/org.eclipse.objectteams.otre/bcelpatchsrc/org/apache/bcel/generic



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)