Record Case Detail

Notes

This function is in beta test. Please help improve it in the issues here.

Stderr

ASAN:DEADLYSIGNAL
=================================================================
==70520==ERROR: AddressSanitizer: SEGV on unknown address 0x000000000010 (pc 0x7f9f036ca4b0 bp 0x7ffc96b404c0 sp 0x7ffc96b40488 T0)
==70520==The signal is caused by a READ memory access.
==70520==Hint: address points to the zero page.
    #0 0x7f9f036ca4af  (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x1274af)
    #1 0x565001e54115 in Station::busLeave() (/out/package/ex3+0x10115)
    #2 0x565001e57f94 in main (/out/package/ex3+0x13f94)
    #3 0x7f9f0229ab96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #4 0x565001e52869 in _start (/out/package/ex3+0xe869)

AddressSanitizer can not provide additional info.
SUMMARY: AddressSanitizer: SEGV (/usr/lib/x86_64-linux-gnu/libstdc++.so.6+0x1274af) 
==70520==ABORTING

Hints

Your answer may be identical to the JOJ answer in the first several lines.

However, the main problem you meet now is Runtime Error. And the exit code of your program is 1, which should be 0.

Please double check your code to solve this problem and try again.

Your Answer

Bus S1 comes!
Bus S2 comes!
Bus S3 comes!
Bus S1 leaves!
Bus S4 comes!
Welcome to the station!
Current number of buses: 4
Passengers getting on bus S2...

Error: too many passengers getting on
Bus S5 comes!
Bus S2 leaves!
Bus S3 leaves!
Bus S4 leaves!
Bus S5 leaves!

JOJ Answer

Bus S1 comes!
Bus S2 comes!
Bus S3 comes!
Bus S1 leaves!
Bus S4 comes!
Welcome to the station!
Current number of buses: 3
Passengers getting on bus S2...
Error: too many passengers getting on
Bus S5 comes!
Bus S2 leaves!
Bus S3 leaves!
Bus S4 leaves!
Bus S5 leaves!
Error: Station is empty!
Error: Station is empty!