Hi -
I am computing some very large tables (somewhere between 1 million and 100 million entries - I don’t actually keep track of how big they get) which I assert as facts. I then try to save the program state so I can resume my computation with the pre-computed tables:
qsave_program('gtestr', [goal(main), stand_alone(true)])
This works well for smaller problems but SWI dies for the problems that induce the very large tables. The stacktrace is below. Note that the computation of the tables works well, even when they are very large (we have 270GB physical RAM and the stack limits are set accordingly), it is just the saving that fails.
I’m using swipl 8.1.30 for x86_64-linux, running on a Linux kernel 4.15.0-54-generic, and an Intel Xeon CPU E5-2640 v2 @ 2GHz processor with 16 physical cores (although nothing else is running, and my application is single-threaded).
Any idea what can go wrong?
Thanks,
– Bernd
ERROR: In:
ERROR: [21] close(<stream>(0x558954b2e090))
ERROR: [19] qsave:write_zip_state(<zipper>(0x558954b2dad0),runtime,none,[goal(...),...]) at /usr/lib/swipl/library/qsave.pl:168
ERROR: [18] setup_call_catcher_cleanup(qsave:zip_open_stream(<stream>(0x558954b2d6b0),<zipper>(0x558954b2dad0),[]),qsave:write_zip_state(<zipper>(0x558954b2dad0),runtime,none,...),_7419814,qsave:zip_close(<zipper>(0x558954b2dad0),...)) at /usr/lib/swipl/boot/init.pl:564
ERROR: [16] qsave:write_state(<stream>(0x558954b2d6b0),runtime,none,[goal(...),...]) at /usr/lib/swipl/library/qsave.pl:155
ERROR: [15] setup_call_catcher_cleanup(qsave:open('v20.exe',write,<stream>(0x558954b2d6b0),...),qsave:write_state(<stream>(0x558954b2d6b0),runtime,none,...),_7419950,qsave:finalize_state(_7419994,<stream>(0x558954b2d6b0),'v20.exe')) at /usr/lib/swipl/boot/init.pl:564
ERROR: [14] '<meta-call>'(qsave:(...,...)) <foreign>
ERROR: [13] setup_call_catcher_cleanup(qsave:open_map(...),qsave:(...,...),_7420078,qsave:close_map) at /usr/lib/swipl/boot/init.pl:564
ERROR: [11] qsave:qsave_program('v20.exe',gtestr:[...|...]) at /usr/lib/swipl/library/qsave.pl:136
ERROR: [9] gtestr:main at /app/src/gtestr.pl:67
ERROR: [8] catch(gtestr:main,error(io_error(write,<stream>(0x558954b2e090)),context(...,'Invalid argument')),'$toplevel':true) at /usr/lib/swipl/boot/init.pl:482
ERROR: [7] catch_with_backtrace('<garbage_collected>',error(io_error(write,<stream>(0x558954b2e090)),context(...,'Invalid argument')),'<garbage_collected>') at /usr/lib/swipl/boot/init.pl:532
ERROR:
ERROR: Note: some frames are missing due to last-call optimization.
ERROR: Re-run your program in debug mode (:- debug.) to get more detail.