In recent competitions, I came across this type of RUNTIME ERROR. Here's the thing:
I wrote a program like this:
def main():
k = 15
m = 3
for a in range(k + 1):
for b in range(k + 1):
for c in range(min(m, k) + 1):
for d in range(min(m, k) + 1):
continue
return
t = 1
for _ in range(t):
main()
But in Atcoder, it showed something like this: (Sorry that the picture isn't clear enough)
It really bothered me and I wonder if anyone could be so kind as to help me with this issue.
(p.s. The RUNTIME ERROR doesn't show in Codeforces, so I'm really confused)
Here are some codes that don't show RUNTIME ERROR:
Code 1:
k = 15
m = 3
for a in range(k + 1):
for b in range(k + 1):
for c in range(min(m, k) + 1):
for d in range(min(m, k) + 1):
pass
Code 2:
def main():
k = 15
m = 3
for a in range(k + 1):
for b in range(k + 1):
for c in range(min(m, k) + 1):
for d in range(min(m, k) + 1):
print(d)
return
t = 1
for _ in range(t):
main()
I would also be very grateful if anyone could help me propose an issue to Pypy through this website: https://foss.heptapod.net/pypy/pypy/-/issues. (according to this: https://www.pypy.org/contact.html) (I couldn't get access to the issue tracker)
Did you try reproducing this error locally? Pinging our resident Python expert pajenegod as he might be interested and able to help, since he's quite active there (sorry for the ping if this is not the case).
Thanks a lot! In my computer, this program also terminated with abnormally and there wasn't any error messages printed. But some of my friends didn't see that and the program worked out just fine.
So I think it might have something to do with what kind of system you run the program on.
I can reproduce this with PyPy 7.3.13 on Linux. The program triggers a segmentation fault.
I've posted the program on their issue tracker.
does it happen if you replace continue with pass? maybe there's a problem with that
It still happens, and some others such as
e = a + c
also causes RUNTIME ERROR.For future reference, here is a link to the issue https://foss.heptapod.net/pypy/pypy/-/issues/4031
Thanks a lot!!!
I'm also able to reproduce this segfault locally on my Windows computer. Even something as simple as this segfaults
It is impressive how such a simple piece of Python code can cause a segfault. Probably it is triggering some bug in PyPy's JIT.