Uncaught exception when an allocation is empty
I have the following exception in batsim when I send an empty allocation: It is the scheduler's fault but still the error message should be better:
[master_host0:Scheduler REQ-REP:(497) 7603.518654] [network/INFO] Received '{"now": 7603.518654, "events": [{"timestamp": 7603.518654, "type": "EXECUTE_JOB", "data": {"job_id": "ec4853!136", "alloc": "8 9 10 11
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71"}}, {"timestamp": 7603.518654,
"type": "EXECUTE_JOB", "data": {"job_id": "ec4853!141", "alloc": "72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87"}}, {"timestamp": 7603.518654, "type": "EXECUTE_JOB", "data": {"job_id": "ec4853!144", "alloc": "
"}}]}'
[master_host0:server:(2) 7603.519254] [server/INFO] Server received a message of type SCHED_EXECUTE_JOB:
[a8:job_ec4853!136:(498) 7603.519254] [jobs_execution/INFO] Sleeping the whole task length
[master_host0:Scheduler REQ-REP:(497) 7603.519854] /tmp/nix-build-simgrid-batsim.drv-0/simgrid/src/xbt/exception.cpp:47: [xbt_exception/CRITICAL] Uncaught exception std::invalid_argument: stoi
[master_host0:Scheduler REQ-REP:(497) 7603.519854] /tmp/nix-build-simgrid-batsim.drv-0/simgrid/src/xbt/exception.cpp:80: [xbt_exception/CRITICAL] Current backtrace:
[master_host0:Scheduler REQ-REP:(497) 7603.519854] /tmp/nix-build-simgrid-batsim.drv-0/simgrid/src/xbt/exception.cpp:82: [xbt_exception/CRITICAL] -> ???9366a at /nix/store/fwm5shhj7p6rrvpdaz5zv202zvbdcbp1-simg
rid-batsim/lib/libsimgrid.so.3.13.91(_ZN7simgrid3xbt9backtraceEv+0x2f) [0x7fdec35b8def], 0x7fdec35b8def
[master_host0:Scheduler REQ-REP:(497) 7603.519854] /tmp/nix-build-simgrid-batsim.drv-0/simgrid/src/xbt/exception.cpp:82: [xbt_exception/CRITICAL] -> ???9366a at /nix/store/fwm5shhj7p6rrvpdaz5zv202zvbdcbp1-simg
rid-batsim/lib/libsimgrid.so.3.13.91(+0x20ae28) [0x7fdec36e2e28], 0x7fdec36e2e28
[master_host0:Scheduler REQ-REP:(497) 7603.519854] /tmp/nix-build-simgrid-batsim.drv-0/simgrid/src/xbt/exception.cpp:82: [xbt_exception/CRITICAL] -> ???9366a at /nix/store/f0pvl01br5rm76kf2f9i8iapi01i8nr8-gcc-
6.3.0-lib/lib/libstdc++.so.6(+0x8c956) [0x7fdec1627956], 0x7fdec1627956
[master_host0:Scheduler REQ-REP:(497) 7603.519854] /tmp/nix-build-simgrid-batsim.drv-0/simgrid/src/xbt/exception.cpp:82: [xbt_exception/CRITICAL] -> ???9366a at /nix/store/f0pvl01br5rm76kf2f9i8iapi01i8nr8-gcc-
6.3.0-lib/lib/libstdc++.so.6(+0x8c9a1) [0x7fdec16279a1], 0x7fdec16279a1
[master_host0:Scheduler REQ-REP:(497) 7603.519854] /tmp/nix-build-simgrid-batsim.drv-0/simgrid/src/xbt/exception.cpp:82: [xbt_exception/CRITICAL] -> ???9366a at /nix/store/f0pvl01br5rm76kf2f9i8iapi01i8nr8-gcc-
6.3.0-lib/lib/libstdc++.so.6(+0x8cbb8) [0x7fdec1627bb8], 0x7fdec1627bb8
[master_host0:Scheduler REQ-REP:(497) 7603.519854] /tmp/nix-build-simgrid-batsim.drv-0/simgrid/src/xbt/exception.cpp:82: [xbt_exception/CRITICAL] -> ???9366a at /nix/store/f0pvl01br5rm76kf2f9i8iapi01i8nr8-gcc-
6.3.0-lib/lib/libstdc++.so.6(_ZSt24__throw_invalid_argumentPKc+0x3f) [0x7fdec165010f], 0x7fdec165010f
[master_host0:Scheduler REQ-REP:(497) 7603.519854] /tmp/nix-build-simgrid-batsim.drv-0/simgrid/src/xbt/exception.cpp:82: [xbt_exception/CRITICAL] -> ???9366a at /nix/store/5c6a0nfzsv73sf6hji6q76hf2ig9w86a-bats
im/bin/batsim(_ZN9__gnu_cxx6__stoaIlicJiEEET0_PFT_PKT1_PPS3_DpT2_EPKcS5_PmS9_+0xc8) [0x446318], 0x446318
[master_host0:Scheduler REQ-REP:(497) 7603.519854] /tmp/nix-build-simgrid-batsim.drv-0/simgrid/src/xbt/exception.cpp:82: [xbt_exception/CRITICAL] -> ???9366a at /nix/store/5c6a0nfzsv73sf6hji6q76hf2ig9w86a-bats
im/bin/batsim(_ZN12MachineRange18from_string_hyphenERKNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEES7_S7_S7_+0x70e) [0x479cbe], 0x479cbe
[master_host0:Scheduler REQ-REP:(497) 7603.519854] /tmp/nix-build-simgrid-batsim.drv-0/simgrid/src/xbt/exception.cpp:82: [xbt_exception/CRITICAL] -> ???9366a at /nix/store/5c6a0nfzsv73sf6hji6q76hf2ig9w86a-bats
im/bin/batsim(_ZN18JsonProtocolReader18handle_execute_jobEidRKN9rapidjson12GenericValueINS0_4UTF8IcEENS0_19MemoryPoolAllocatorINS0_12CrtAllocatorEEEEE+0x62a) [0x49366a], 0x49366a
Segmentation fault.
It seems to be an uncaught exception from stoi that is not able to convert the input: https://stackoverflow.com/a/31928967/2165830