Archived:Lack of thread safety in Java ME TCP implementation on Series 40 1st and 2nd Edition (Known Issue)
There is a known race condition in the Java networking code for TCP, UDP, and SSL. In certain situations the code gets into an unstable state and remains unstable until all the operations have completed.
There is a known race condition in the Java networking code for TCP(, UDP, and SSL) in S40 devices. If more than one thread does any combination of these (not necessarily on the same socket): opening, reading, writing; the code gets in to an unstable state and the phone is likely to crash if any of these happen:
- The connection drops (red end key, loss of signal, etc.)
- Problems with a socket (remote host closes TCP connection or refuses new TCP connection, SSL certificate problems, etc.)
- Almost anything else that would throw an IOException
No solution exists for Series 40 1st Edition and Series 40 2nd Edition. Avoid running multiple socket operations simultaneously.
This issue is fixed in the Series 40 3rd Edition devices.