Interpreting Stack Traces

Interpreting Stack Traces#

When an unhandled error occurs POLARIS will generate a stack trace as shown below:

2023-06-07 10:14:57,879 Thread: 140507642888384 | [NOTICE] Turned on signal handler
2023-06-07 10:14:57,880 Thread: 140507642888384 | [NOTICE] There are 3 arguments:
2023-06-07 10:14:57,880 Thread: 140507642888384 | [NOTICE] scenario_abm.modified.json
2023-06-07 10:14:57,880 Thread: 140507642888384 | [NOTICE] 30
2023-06-07 10:14:57,881 Thread: 140507642888384 | [NOTICE] Running in Release mode
2023-06-07 10:14:57,895 Thread: 140507642888384 | [NOTICE] reading scenario data from scenario_abm.modified.json...
2023-06-07 10:14:58,335 Thread: 140507642888384 | [  WARN] unknown database schema 'Popsyn'
2023-06-07 10:14:58,714 Thread: 140507642888384 | [NOTICE] allocating data structures...
2023-06-07 10:14:58,839 Thread: 140507642888384 | [NOTICE] reading network data...
2023-06-07 11:24:55,728 Thread: 140507642873600 | [ ERROR] Error: signal 2: SIGINT
2023-06-07 11:24:55,729 Thread: 140507642873600 | [ ERROR] Stack trace:
2023-06-07 11:24:55,812 Thread: 140507642873600 | [ ERROR] 1   0x563f39dafa27 (null) + 94829553580583
2   0x563f39db0470 (null) + 94829553583216
3   0x7fca7c44d090 (null) + 140507645005968
4   0x7fca7c60b374 pthread_cond_wait + 532
5   0x7fca7c85d2d0 std::condition_variable::wait(std::unique_lock<std::mutex>&) + 16
6   0x563f3a1ae353 polaris::World::Wait_At_Finish_Gate() + 99
7   0x563f3a1b00ab polaris::Simulation_Loop(int) + 91
8   0x7fca7c8636b4 (null) + 140507649291956
9   0x7fca7c604609 (null) + 140507646805513
10  0x7fca7c529133 clone + 67

While this does not give a precise line number, in most cases it should be enough to track down the error. In the example the program was interrupted (signal 2: SIGINT), but we can still see what it was doing at the time it was interrupted.

When that isn’t enough#

If the above information isn’t enough to track down the root cause - the next step would be to run the offending model through a debugger.