[SPIGOT-2629] CME from spigot classloader Created: 25/Aug/16  Updated: 26/Aug/16  Resolved: 26/Aug/16

Status: Resolved
Project: Spigot
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Minor
Reporter: Empire92 Assignee: md_5
Resolution: Fixed Votes: 0
Labels: bug, spigot
Environment:

java.specification.version: '1.8'
java.vendor: 'Oracle Corporation'
java.version: '1.8.0_31'
os.arch: 'amd64'
os.name: 'Linux'
os.version: '2.6.32-042stab106.4'


Plugin: PlotSquared, MassiveCore, others

 Description   

Occurs sometimes when an async thread initializes a new object during startup, in this case a JSONObject is being created.

An issue was already reported for this, and incorrectly closed:
https://hub.spigotmc.org/jira/browse/SPIGOT-2521
Just to clarify, PlotSquared is not trying to disable the plugin async by creating a JSONObject.

Current stacktrace:
http://hastebin.com/namadeduhu.avrasm

More Debug information:
http://hastebin.com/umolokupol.vala

Thanks.



 Comments   
Comment by Empire92 [ 26/Aug/16 ]

welp

thanks.

Comment by md_5 [ 26/Aug/16 ]

Would you please care to actually read my code?
https://hub.spigotmc.org/stash/projects/SPIGOT/repos/bukkit/commits/89e4f83cd41117cc8a0264e70049f2f6e490740a

Thanks

Comment by Empire92 [ 26/Aug/16 ]

Not fixed, as per the docs, you need to synchronize while iterating, otherwise it will still throw a CME:

It is imperative that the user manually synchronize on the returned map when iterating over any of its collection views:

http://docs.oracle.com/javase/8/docs/api/java/util/Collections.html#synchronizedMap-java.util.Map-

Comment by Hex [ 26/Aug/16 ]

PlotSquared looks like the loading of a class is being triggered from an async thread, then a plugin loader is being removed or added to the loader map before the class is resolved. The easiest fix as I can see would be synchronizing JavaPluginLoader.getClassByName(String), but there might be a smarter way.

Generated at Tue Apr 15 11:10:29 UTC 2025 using Jira 10.3.3#10030003-sha1:d220e3fefc8dfc6d47f522d3b9a20c1455e12b7b.