cms icon indicating copy to clipboard operation
cms copied to clipboard

An int may not be enough to store the amount of memory used

Open lw opened this issue 10 years ago • 2 comments

A signed int on 32 bit allows to store the amount of bytes used by a program up to about 2.1GB. In some (very rare) cases this may not be enough. I've been able to trigger this behavior on compilation (where no memory limit is enforced) with the compile-timeout test. Here's the error I got:

DataError: (raised as a result of Query-invoked autoflush; consider using a session.no_autoflush block if this flush is occurring prematurely) (psycopg2.DataError) integer out of range
 [SQL: 'UPDATE submission_results SET compilation_outcome=%(compilation_outcome)s, compilation_text=%(compilation_text)s, compilation_stdout=%(compilation_stdout)s, compilation_stderr=%(compilation_stderr)s, compilation_time=%(compilation_time)s, compilation_wall_clock_time=%(compilation_wall_clock_time)s, compilation_memory=%(compilation_memory)s, compilation_shard=%(compilation_shard)s, compilation_sandbox=%(compilation_sandbox)s WHERE submission_results.submission_id = %(submission_results_submission_id)s AND submission_results.dataset_id = %(submission_results_dataset_id)s'] [parameters: {'compilation_text': '["Compilation timed out"]', 'submission_results_dataset_id': 17, 'compilation_shard': 0, 'compilation_stderr': u'In file included from batchfileio.cpp:1:0,\n                 from batchfileio.cpp:1,\n                 from batchfileio.cpp:1,\n                 from batchfileio.cpp:1,\n                 from batchfileio.cpp:1,\n                 from batchfileio.cpp:1,\n                 from batchfileio.cpp:1,\n                 from batchfileio.cpp:1,\n                 from batchfileio.cpp:1,\n                 from batchfileio.cpp:1,\n                 from batchfileio.cpp:1,\n                 from batchfileio.cpp:1,\n                 from batchfileio.cpp:1,\n                 from batchfileio.cpp:1,\n                 from batchfileio.cpp:1,\n                 from batchfileio.cpp:1,\n                 from batchfileio.cpp:1,\n                 from batchfileio.cpp:1,\n                 from batchfileio.cpp:1,\n                 from batchfileio.cpp:1,\n                 from batchfileio.cpp:1,\n                 from batchfileio.cpp:1,\n                 from batchfileio.cpp:1,\n                 from batchfileio.cpp:1,\n                 from batchfileio.cpp:', 'compilation_stdout': u'', 'compilation_sandbox': u'/tmp/tmp_KjOS5/tmp', 'compilation_outcome': u'fail', 'compilation_wall_clock_time': 21.069, 'compilation_time': 0.0, 'submission_results_submission_id': 59, 'compilation_memory': 2378412032}]

lw avatar Jun 13 '15 10:06 lw

This should be only a matter of using BigInteger in the schema (handled as a usual int in Python). See http://docs.sqlalchemy.org/en/latest/core/type_basics.html

Since we're at it, it would also be nice to use decimal to store the score.

stefano-maggiolo avatar Feb 25 '16 22:02 stefano-maggiolo

I think the milestone here should be changed from 1.3 to 1.4

wil93 avatar Apr 04 '17 20:04 wil93