@@ -55,13 +55,16 @@ def N_(message: str):
5555 N_ ("Your submission exceeded the time limit while compiling. "
5656 "This might be caused by an excessive use of C++ "
5757 "templates, for example." )),
58+ HumanMessage ("memorylimit" ,
59+ N_ ("Compilation memory limit exceeded" ),
60+ N_ ("Your submission exceeded the memory limit while compiling. "
61+ "This might be caused by an excessive use of C++ "
62+ "templates, or too large global variables, for example." )),
5863 HumanMessage ("signal" ,
59- N_ ("Compilation killed with signal %s (could be triggered "
60- "by violating memory limits)" ),
64+ N_ ("Compilation killed with signal %s" ),
6165 N_ ("Your submission was killed with the specified signal. "
62- "Among other things, this might be caused by exceeding "
63- "the memory limit for the compilation, and in turn by an "
64- "excessive use of C++ templates, for example." )),
66+ "This might be caused by a bug in the compiler, "
67+ "for example." )),
6568])
6669
6770
@@ -136,6 +139,13 @@ def compilation_step(
136139 text = [COMPILATION_MESSAGES .get ("timeout" ).message ]
137140 return True , False , text , stats
138141
142+ elif exit_status == Sandbox .EXIT_MEM_LIMIT :
143+ # Memory limit: we assume it is the user's fault, and we return the
144+ # error to them.
145+ logger .debug ("Compilation memory limit exceeded." )
146+ text = [COMPILATION_MESSAGES .get ("memorylimit" ).message ]
147+ return True , False , text , stats
148+
139149 elif exit_status == Sandbox .EXIT_SIGNAL :
140150 # Terminated by signal: we assume again it is the user's fault, and
141151 # we return the error to them.
0 commit comments