From f20966c21c8acdd589ae25d9d9c0fc13192660ef Mon Sep 17 00:00:00 2001 From: Maxime Guillaud Date: Tue, 18 Oct 2011 23:44:06 +0200 Subject: [PATCH] Increase RLIMIT_CPU to 12h (from 5mn) in fgfs-construct. I have never witnessed the infinite loop that this limit is supposed to catch - however complex tiles frequently require more than 5 minutes CPU. --- src/BuildTiles/Main/main.cxx | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/src/BuildTiles/Main/main.cxx b/src/BuildTiles/Main/main.cxx index f666187e..032e6644 100644 --- a/src/BuildTiles/Main/main.cxx +++ b/src/BuildTiles/Main/main.cxx @@ -1184,10 +1184,15 @@ int main(int argc, char **argv) { // cpu time limit since occassionally the triangulator can go into // an infinite loop. - limit.rlim_cur = 300; // seconds - limit.rlim_max = 300; // seconds - result = setrlimit( RLIMIT_CPU, &limit ); - cout << "result of setting mem limit = " << result << endl; + limit.rlim_cur = 43200; // seconds + limit.rlim_max = 43200; // seconds + if (setrlimit( RLIMIT_CPU, &limit )) { + SG_LOG(SG_GENERAL, SG_ALERT, "Error setting RLIMIT_CPU, aborting"); + exit(-1); + } else { + cout << "Setting RLIMIT_CPU to " << limit.rlim_cur << " seconds" << endl; + }; + #endif // end of stuff that crashes Cygwin // main construction data management class