• Andrew Jeffery's avatar
    test: Add windows_equally_evictable · c84b8f8f
    Andrew Jeffery authored
    Tests for the condition where the minimum age is less than any window's
    current age, in which case we can get a NULL dereference if the
    windows_reset_all() implementation is broken.
        windows.c:409:23: runtime error: member access within null pointer of type 'struct window_context'
        ==31400==ERROR: AddressSanitizer: SEGV on unknown address 0x00000004 (pc 0x0002b658 bp 0x74c00270 sp 0x7eb7c678 T0)
        ==31400==The signal is caused by a WRITE memory access.
        ==31400==Hint: address points to the zero page.
            #0 0x2b657 in window_reset windows.c:410
            #1 0x2cc9b in windows_create_map windows.c:572
            #2 0x1f3f3 in protocol_v1_create_window protocol.c:167
            #3 0x2121b in protocol_v2_create_window protocol.c:417
            #4 0x24cd7f in generic_vpnor_create_window vpnor/protocol.cpp:51
            #5 0x24d053 in protocol_v2_vpnor_create_window vpnor/protocol.cpp:63
            #6 0x2663b in mbox_handle_create_window transport_mbox.c:282
            #7 0x276db in handle_mbox_req transport_mbox.c:568
            #8 0x276db in transport_mbox_dispatch transport_mbox.c:649
            #9 0x17fcb in poll_loop mboxd.c:185
            #10 0x17fcb in main mboxd.c:423
            #11 0x46b68517 in __libc_start_main (/lib/libc.so.6+0x46b68517)
        AddressSanitizer can not provide additional info.
        SUMMARY: AddressSanitizer: SEGV windows.c:410 in window_reset
    Change-Id: I8161e2ea17953e196d4bb3ca90d19e44ec10c86d
    Signed-off-by: Andrew Jeffery's avatarAndrew Jeffery <andrew@aj.id.au>
windows_equally_evictable.c 2.16 KB