I triggered this in real code with a form like this one:
(defn ^:1234567891011 foo []
);
Sending a file with this form (cider-load-buffer in emacs) throws an exception:
StringIndexOutOfBoundsException: Range [44, 34) out of bounds for length 34
jdk.internal.util.Preconditions$1.apply (Preconditions.java:55)
jdk.internal.util.Preconditions$1.apply (Preconditions.java:52)
jdk.internal.util.Preconditions$4.apply (Preconditions.java:213)
jdk.internal.util.Preconditions$4.apply (Preconditions.java:210)
jdk.internal.util.Preconditions.outOfBounds (Preconditions.java:98)
jdk.internal.util.Preconditions.outOfBoundsCheckFromToIndex (Preconditions.java:112)
jdk.internal.util.Preconditions.checkFromToIndex (Preconditions.java:349)
java.lang.AbstractStringBuilder.substring (AbstractStringBuilder.java:1086)
java.lang.StringBuilder.substring (StringBuilder.java:91)
java.lang.AbstractStringBuilder.substring (AbstractStringBuilder.java:1038)
java.lang.StringBuilder.substring (StringBuilder.java:91)
clojure.tools.reader.reader-types/peek-source-log (reader_types.clj:248)
clojure.tools.reader.reader-types/peek-source-log (reader_types.clj:243)
clojure.tools.reader.reader-types/log-source*/fn--4391 (reader_types.clj:324)
clojure.core/apply (core.clj:667)
clojure.core/with-bindings* (core.clj:1990)
clojure.core/with-bindings* (core.clj:1990)
clojure.tools.reader.reader-types/log-source* (reader_types.clj:321)
clojure.tools.reader.reader-types/log-source* (reader_types.clj:316)
clojure.tools.reader/read+string (reader.clj:1029)
clojure.tools.reader/read+string (reader.clj:1019)
shadow.cljs.repl/read-one/fn--17402 (repl.clj:628)
shadow.cljs.repl/read-one (repl.clj:601)
shadow.cljs.repl/read-one (repl.clj:578)
shadow.cljs.repl/process-input (repl.clj:703)
shadow.cljs.repl/process-input (repl.clj:691)
shadow.cljs.repl/repl-load-file* (repl.clj:195)
shadow.cljs.repl/repl-load-file* (repl.clj:173)
shadow.cljs.repl/repl-load-file (repl.clj:231)
shadow.cljs.repl/repl-load-file (repl.clj:229)
shadow.cljs.repl/process-read-result (repl.clj:570)
shadow.cljs.repl/process-read-result (repl.clj:550)
shadow.cljs.repl/process-input (repl.clj:713)
shadow.cljs.repl/process-input (repl.clj:691)
shadow.cljs.devtools.server.worker.impl/eval17950/fn--17953 (impl.clj:698)
clojure.lang.MultiFn.invoke (MultiFn.java:234)
shadow.cljs.devtools.server.util/server-thread/fn--17590/fn--17591/fn--17599 (util.clj:283)
shadow.cljs.devtools.server.util/server-thread/fn--17590/fn--17591 (util.clj:282)
shadow.cljs.devtools.server.util/server-thread/fn--17590 (util.clj:255)
java.lang.Thread.run (Thread.java:1583)
I found this old slack thread where @thheller narrowed it down to tools.reader and provided this repro:
(let [rdr (clojure.tools.reader.reader-types/source-logging-push-back-reader
"(ns demo.test)\n\n(def foo \"foo\");\n(def bar [])\n")]
(clojure.tools.reader/read+string rdr)
(clojure.tools.reader/read+string rdr)
(clojure.tools.reader/read+string rdr))