seesaw icon indicating copy to clipboard operation
seesaw copied to clipboard

`proxy-super` not thread safe

Open owenRiddy opened this issue 1 year ago • 0 comments

G'Day! There is a concerning bug in seesaw.table. It makes extensive use of proxy-super which is not thread safe. This bug can cause the proxied methods (ie, the Clojure implementations passed in through the proxy macro) to vanish unexpectedly leading to errors like Exception in thread "Thread-117" java.lang.ArrayIndexOutOfBoundsException: Index -1 out of bounds for length 3 and other weirdnesses.

I have been experimenting with fixes. There must be lots of ways to approach this but my favourite is adapting Nathan Marz's proxy-plus library to support proxy-super. See https://github.com/redplanetlabs/proxy-plus/issues/17 and then https://github.com/owenRiddy/proxy-plus-minus where I have a fork of the library that implements the ugly hack.

I have now started experimenting with using that hack in seesaw proper. Experiments are taking place over here. Tests are passing. Unfortunately I've felt pressure to bump the version of Clojure required because 1.4.0 was too old for leiningen. I also ran cljfmt over the code..

Is there anyone maintaining seesaw? I'd like to negotiate what trade offs would be acceptable for merging the proxy-plus-minus hack in vs some other attempt at fixing this problem. I'm happy enough to use a dodgy fork for my own work, but it'd be a shame for people to be using a library with buggy tables. Plus I see a few other uses of proxy-super that should raise concerns now that this bug is flagged.

owenRiddy avatar Sep 09 '23 14:09 owenRiddy