<< Back to previous view

[ASYNC-170] binding in go block causes tread binding error: "Pop without matching push" Created: 26/May/16  Updated: 27/May/16

Status: Open
Project: core.async
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Defect Priority: Major
Reporter: Christian Weilbach Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Clojure 1.8.0, core.async 0.2.374



 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)


 Comments   
Comment by Kevin Downey [ 27/May/16 1:46 AM ]

this issue only reproduces when the code is aot compiled

Comment by Christian Weilbach [ 27/May/16 6:55 AM ]

Right, I missed to add the AOT condition here, only in the repository. I cannot update the issues myself, right? I tried also to close another issue I opened, but couldn't find a way to close it.





Generated at Sat May 28 01:01:40 CDT 2016 using JIRA 4.4#649-r158309.