trifork / erjang

A JVM-based Erlang VM
http://www.erjang.org
Apache License 2.0
727 stars 62 forks source link

TCP driver lifecycle consistency #82

Open eriksoe opened 10 years ago

eriksoe commented 10 years ago

The thing does not seem terribly thread-safe at the moment. At least the field fd seems to be an issue at this point:

java.lang.NullPointerException
at erjang.driver.tcp_inet.TCPINet.tcp_recv(TCPINet.java:878)
at erjang.driver.tcp_inet.TCPINet.tcp_recv(TCPINet.java:1682)
at erjang.driver.tcp_inet.TCPINet.control(TCPINet.java:1536)
at erjang.driver.LockingDriverInstance.control(LockingDriverInstance.java:69)
at erjang.driver.EDriverTask.control(EDriverTask.java:514)
at erjang.EInternalPort.control(EInternalPort.java:123)
at erjang.m.erlang.ErlPort.port_control0(ErlPort.java:221)
at erjang.m.erlang.ErlPort.port_control(ErlPort.java:188)
at erjang.m.erlang.ErlPort$FN_port_control__3.go(Unknown Source)
at erjang.EFun3.invoke(Unknown Source)
at erjang.m.prim_inet.prim_inet.ctl_cmd__3(prim_inet.erl:2186)
at erjang.m.prim_inet.prim_inet.async_recv__3(prim_inet.erl:461)
at erjang.m.prim_inet.prim_inet.recv0__3(prim_inet.erl:449)
at erjang.m.prim_inet.prim_inet$FN_recv0__3.go(Unknown Source)
at erjang.EFun3.invoke(Unknown Source)
at erjang.m.packet_parser_tests.packet_parser_tests.gather_then_send__3(packet_parser_tests.erl:82)