terminal – process was killed — why? how can I find out?

I have written a computer program in C++, compiled it and ran it within terminal using the command line. This program has run fine many times, but it appears that whenever it’s accumulated CPU time exceeds 60min (which occurs after about 9min as it runs at ~700% on 8 threads) it is killed by the run-time system (at least that is suggested by monitoring it using top.)

There is no error or other message, but merely the word “Killed” printed to the command line:

MacBook-Pro-8:~/directory> ./program_name options

Is there a limit on the accumulated CPU time for such processes? How can I find out what killed my process? How can I avoid this?

following the suggestion to run this in a debugger, here is the result:

Process 90937 stopped
* thread #1, queue = 'com.apple.main-thread', stop reason = signal SIGKILL
frame #0: 0x000000010001fc50 captureISO`tbb::interface9::internal::start_for<WDutils::Parallel::details::blocked_range_terminating<unsigned long>, (anonymous namespace)::simulations::sampleSome(bool)::$_2, tbb::auto_partitioner const>::run_body(WDutils::Parallel::details::blocked_range_terminating<unsigned long>&) [inlined] tbb::concurrent_vector<(anonymous namespace)::simulations::initialCondition, tbb::cache_aligned_allocator<(anonymous namespace)::simulations::initialCondition> >::push_back(this=0x00007fff5fbfebd0)::simulations::initialCondition const&) at concurrent_vector.h:846 [opt]
   843      iterator push_back( const_reference item )
   844      {
   845          push_back_helper prolog(*this);
-> 846          new(prolog.internal_push_back_result()) T(item);
   847          return prolog.return_iterator_and_dismiss();
   848      }

Thus, the error occurred within tbb_concurrent_vector.h in a call to placement new, suggesting a lack of memory. Though I’m still mystified why this should result in a kill signal. But this appears off topic here. I have asked on SO

Subscribe to the TAMI Blog Newsletter

Leave a Reply

Your email address will not be published. Required fields are marked *