The following code crashes Java8 on Codeforces:
public class Main {
public static void main(String[] args) {
java.math.BigInteger.valueOf(7).nextProbablePrime();
}
}
http://codeforces.me/contest/427/submission/6539822
Maybe updating Java8 will solve the problem.
It's well known issue, that nextProbablePrime() use low level access to OS for rand seed and code of "probematic frame" sayed, that crash was in native code and it may be caused by security policy of OS.
I checked that, SecureRandom works fine.
I have the same version of JRE at workstation ( but i have client version, not server ) and no problems. As I can see native calls in
ThreadLocalRandom.current()
are the reason of crush. It used in internals of java.math.BigInteger#passesMillerRabinActually I meant that nextProbablePrime uses SecureRandom. On Codeforces servers SecureRandom doesn't crash Java, but nextProbablePrime does. Or what did you mean?
UPD. Seen your UPD. I thought that it only uses SecureRandom, but I didn't know Java well enough, I see. :)
Was SecureRandom replaced by ThreadLocalRandom in Java 8?
UPD2. In Java 7 and 6,
ThreadLocalRandom.current()
doesn't crash.I don't know in detail how Codeforces protect they java-run sandboxes :)
Mike wrote that OS' low-level rand seed is problematic and they are using java -Djava.security.egd=file:filename to set seed for SecureRandom. (Russian: http://codeforces.me/blog/entry/10037)
We don't have full crush dump or information about protection system. It's all guesswork.
Who 'we'? And do you mean crAsh dump?
Typical Java
typical troll!
yes, but still, he has +72 of contribution (at the time of writing), which is almost the same of yours (+73 at the time of writing). Contribution is not supposed to be a measure of "anti-trollness" also? Amazing CodeForces.
yeah, i noticed that he has a lot of upvotes in Russian interface. i don't know Russian very well, so unfortunately i can't judge him there.
however, he is nothing but a troll in English! :D