`proxy` fails with redefined interfaces

Description

Before patch:

After patch:

Cause: `proxy` caches the generated class using a set of classnames (see https://github.com/clojure/clojure/blob/master/src/clj/clojure/core_proxy.clj#L280-L286), this is not safe under redefinition of interfaces

Proposed: change the hashing function used to determine proxy class cache hits to take into account the identity of each interface/super class rather than just their name

Patch: 0001-CLJ-2379-idempotent-proxy-name-just-on-identical-ins-v2.patch

Environment

None

Activity

Show:
Alex Miller
August 2, 2018, 10:50 AM

Can you add a Proposed line to the description explaining the change?

Alex Miller
August 2, 2018, 10:52 AM

I'm not sure I get the problem/solution here.

Nicola Mometto
August 2, 2018, 10:52 AM

sure, done

Alex Miller
August 2, 2018, 11:06 AM

Looks like this breaks the serialized objects in the (admittedly fragile) clojure.test-clojure.java-interop/test-proxy-non-serializable (see CLJ-2204, CLJ-2330).

Nicola Mometto
August 2, 2018, 4:26 PM

As discussed in #clojure-dev, attached patch that disables the brittle tests and restores the determinism of `proxy-name`.

Assignee

Unassigned

Reporter

Nicola Mometto

Labels

Approval

Triaged

Patch

Code

Priority

Minor