core.async

binding in go block causes thread binding error: "Pop without matching push"

Details

  • Type: Defect Defect
  • Status: In Progress In Progress
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: None
  • Fix Version/s: None
  • Component/s: None
  • Labels:
    None
  • Environment:
    Clojure 1.8.0, core.async 0.2.374
  • Patch:
    Code and Test
  • Approval:
    Triaged

Description

Reproduced in https://github.com/whilo/async-binding.

(def ^:dynamic *foo* nil)

(defn -main [& args]
  (go
    (binding [*foo* nil]
      (<! (go 42))
      (println "done.")))

  (Thread/sleep 30000))

$ lein uberjar
$ java -jar ...

done.
Exception in thread "async-dispatch-3" java.lang.IllegalStateException: Pop without matching push
	at clojure.lang.Var.popThreadBindings(Var.java:331)
	at clojure.core$pop_thread_bindings.invokeStatic(core.clj:1839)
	at clojure.core$pop_thread_bindings.invoke(core.clj:1839)
	at async_binding.core$_main$fn__6354$state_machine__4495__auto____6355$fn__6357.invoke(core.clj:8)
	at async_binding.core$_main$fn__6354$state_machine__4495__auto____6355.invoke(core.clj:8)
	at clojure.core.async.impl.ioc_macros$run_state_machine.invokeStatic(ioc_macros.clj:1011)
	at clojure.core.async.impl.ioc_macros$run_state_machine.invoke(ioc_macros.clj:1010)
	at clojure.core.async.impl.ioc_macros$run_state_machine_wrapped.invokeStatic(ioc_macros.clj:1015)
	at clojure.core.async.impl.ioc_macros$run_state_machine_wrapped.invoke(ioc_macros.clj:1013)
	at clojure.core.async.impl.ioc_macros$take_BANG_$fn__4511.invoke(ioc_macros.clj:1024)
	at clojure.core.async.impl.channels.ManyToManyChannel$fn__313$fn__314.invoke(channels.clj:95)
	at clojure.lang.AFn.run(AFn.java:22)
	at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
	at java.lang.Thread.run(Thread.java:745)

Activity

People

Vote (1)
Watch (2)

Dates

  • Created:
    Updated: