QuiltMC / enigma

A deobfuscation/remapping tool for Java bytecode, fork of cuchaz's Enigma.
GNU Lesser General Public License v3.0
56 stars 31 forks source link

[Help wanted] Ghost entries and dead space in the class selector #108

Open IotaBread opened 1 year ago

IotaBread commented 1 year ago

This is a weird issue we haven't been able to figure out for three weeks. It's seemingly random, though it happens way more frequently on Windows than on Linux (from my testing). On @\ix0rai's machine using Ubuntu (with a VM) it took 15 minutes worth of tries to reproduce the issue, for just a single ghost entry, while on my Windows desktop it's taken anywhere between 5 and 50 tries, and it's way more severe, with more than 5 ghost entries some of the times.

enigma's class selector with a single ghost entry enigma's class selector with dead space at the bottom

Demo video of the issue also affecting scrolling with the wheel:

https://github.com/QuiltMC/enigma/assets/47987888/5859afbc-cf36-4cae-bfdf-6023fe15c364

The issue has been narrowed down to some duplicated entries in VariableHeightLayoutCache#visibleNodes (ClassSelector#ui -> BasicTreeUI#treeState), and the issue goes away by reloading the tree (ClassSelector#reload()), but we haven't been able to find the its source or a way to fix it. Here are a couple images depicting the normal state and a wrong one with 6 ghost entries debugging window showing the normal state for the visible nodes in the layout cache debugging window showing 6 duplicated entries in the layout cache

ix0rai commented 1 year ago

interesting to note is that I do the majority of my development on an Arch machine, and I've never once reproduced the issue on it even over thousands of reloads