Record Case Detail

Notes

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

Stderr

=================================================================
==31560==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7ffd63eebca4 at pc 0x55f5a1bd0f09 bp 0x7ffd63eebc40 sp 0x7ffd63eebc30
WRITE of size 4 at 0x7ffd63eebca4 thread T0
    #0 0x55f5a1bd0f08 in intMatrix::intMatrix(int, int, int) (/out/package/ex3+0x15f08)
    #1 0x55f5a1bcbbee in main (/out/package/ex3+0x10bee)
    #2 0x7fb0d70b8b96 in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x21b96)
    #3 0x55f5a1bc9259 in _start (/out/package/ex3+0xe259)

Address 0x7ffd63eebca4 is located in stack of thread T0 at offset 36 in frame
    #0 0x55f5a1bd0c69 in intMatrix::intMatrix(int, int, int) (/out/package/ex3+0x15c69)

  This frame has 1 object(s):
    [32, 36) 'a' <== Memory access at offset 36 overflows this variable
HINT: this may be a false positive if your program uses some custom stack unwind mechanism or swapcontext
      (longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-buffer-overflow (/out/packa

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

Testing getElement 2: 4 pts

JOJ Answer

Testing getElement 2: 4 pts
Matrix Information:
rows: 4
cols: 5
Matrix[1][5] = 1
Matrix[1][1] = 1
Matrix[2][3] = 1
Matrix[4][5] = 1