Closed Nopey closed 8 months ago
Have you tried with rr master? MADV_COLD
should work there.
That's fantastic news! I haven't, will do
Feb 29, 2024 14:42:22 rocallahan @.***>:
Have you tried with rr master? MADV_COLD should work there.
— Reply to this email directly, view it on GitHub[https://github.com/rr-debugger/rr/issues/3702#issuecomment-1972095841], or unsubscribe[https://github.com/notifications/unsubscribe-auth/ABCVJ6ZQKKV6BPTMDO44TSLYV6XE5AVCNFSM6AAAAABEAW7JB2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZSGA4TKOBUGE]. You are receiving this because you authored the thread. [Tracking image][https://github.com/notifications/beacon/ABCVJ635FUASCLGKLXLROOTYV6XE5A5CNFSM6AAAAABEAW7JB2WGG33NNVSW45C7OR4XAZNMJFZXG5LFINXW23LFNZ2KUY3PNVWWK3TUL5UWJTTVRPFWC.gif]
Thanks again, it works!
When a program under rr tries to use madvise cold or pageout, rr will (intentionally) crash because it does not support them.
single file reproduction
a single-file C program that crashes rr, adapted from the [linux-test-project's madvise01.c test file](https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/syscalls/madvise/madvise01.c) ```c // SPDX-License-Identifier: GPL-2.0-or-later /* * Copyright (c) International Business Machines Corp., 2004 * Copyright (c) Linux Test Project, 2013-2016 */ /* * This is a test case for madvise(2) system call. * It tests madvise(2) with combinations of advice values. * No error should be returned. */ /* * Downloaded from https://github.com/linux-test-project/ltp/blob/master/testcases/kernel/syscalls/madvise/madvise01.c * & then cut down to MADV_COLD and MADV_PAGEOUT, which rr (debugger) doesn't yet support */ #includeAs for a real application that I found triggering this, Themaister/Granite with vulkan-swrast-1 24.0.1-1-x86_64 (installed on Arch, this is also known as lavapipe) is the only open source application I've tested that calls madvise with MADV_COLD.
crashlog on Granite's ui-sandbox
``` $ VK_ICD_FILENAMES=/usr/share/vulkan/icd.d/lvp_icd.x86_64.json rr record tests/ui-sandbox rr: Saving execution to trace directory `/home/magnus/.local/share/rr/ui-sandbox-1'. [INFO]: Targeting VK_KHR_present_wait latency to 1 frames. [INFO]: SDL_Init took 0.016 seconds. [INFO]: SDL_Init(GAMEPAD) took 0.081 seconds async. [INFO]: Initializing static assets. [INFO]: Layer count: 6 [INFO]: Found layer: VK_LAYER_RENDERDOC_Capture. [INFO]: Found layer: VK_LAYER_VALVE_steam_fossilize_32. [INFO]: Found layer: VK_LAYER_VALVE_steam_fossilize_64. [INFO]: Found layer: VK_LAYER_VALVE_steam_overlay_32. [INFO]: Found layer: VK_LAYER_VALVE_steam_overlay_64. [INFO]: Found layer: VK_LAYER_KHRONOS_validation. [INFO]: Enabling instance extension: VK_KHR_surface. [INFO]: Enabling instance extension: VK_KHR_wayland_surface. [INFO]: Enabling instance extension: VK_EXT_debug_utils. [INFO]: Enabling instance extension: VK_KHR_get_surface_capabilities2. [INFO]: Found Vulkan GPU: llvmpipe (LLVM 16.0.6, 256 bits) [INFO]: API: 1.3.274 [INFO]: Driver: 0.0.1 [INFO]: Using Vulkan GPU: llvmpipe (LLVM 16.0.6, 256 bits) [INFO]: Enabling device extension: VK_KHR_swapchain. [INFO]: Enabling device extension: VK_EXT_calibrated_timestamps. [INFO]: Enabling device extension: VK_EXT_memory_priority. [INFO]: Enabling device extension: VK_EXT_memory_budget. [INFO]: Enabling device extension: VK_EXT_pageable_device_local_memory. [INFO]: Enabling device extension: VK_NV_device_generated_commands. [INFO]: Enabling device extension: VK_EXT_mesh_shader. [INFO]: Enabling device extension: VK_EXT_index_type_uint8. [INFO]: Enabling device extension: VK_EXT_external_memory_host. [INFO]: Initializing pipeline cache. [FATAL ../src/record_syscall.cc:6312:rec_process_syscall_arch()] (task 14071 (rec:14071) at time 5585) -> Assertion `t->regs().syscall_result_signed() == -syscall_state.expect_errno' failed to hold. Expected EINVAL for 'madvise' but got result 0 (errno SUCCESS); unknown madvise(20) Tail of trace dump: { real_time:58470.062480 global_time:5565, event:`SYSCALLBUF_RESET' tid:14071, ticks:20320632 } { real_time:58470.062499 global_time:5566, event:`SYSCALL: sysinfo' (state:EXITING_SYSCALL) tid:14071, ticks:20320632 rax:0x0 rbx:0x681fffa0 rcx:0xffffffffffffffff rdx:0x7fd4ebb961f0 rsi:0x7ffe29dc0cd0 rdi:0x7ffe29dc0ad0 rbp:0x681fffa0 rsp:0x681ffde0 r8:0x5604a25a5f50 r9:0x5604a25a5f58 r10:0x7 r11:0x246 r12:0x1 r13:0x5604a09e8270 r14:0x7fd4ec415000 r15:0x56049f6511b8 rip:0x70000002 eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0x63 fs_base:0x7fd4ec2accc0 gs_base:0x0 { tid:14071, addr:0x7ffe29dc0ad0, length:0x70 } } { real_time:58470.062537 global_time:5567, event:`SYSCALLBUF_FLUSH' tid:14071, ticks:20320918 { syscall:'openat', ret:0x12, size:0x10, desched:1 } { syscall:'readlinkat', ret:0xd, size:0x1d } } { real_time:58470.062540 global_time:5568, event:`SYSCALL: fstatat' (state:ENTERING_SYSCALL) tid:14071, ticks:20320918 rax:0xffffffffffffffda rbx:0x7ffe29dc0bc0 rcx:0xffffffffffffffff rdx:0x7ffe29dc0a60 rsi:0x7fd4ebb98bd5 rdi:0x12 rbp:0x7ffe29dc0c50 rsp:0x7ffe29dc0a48 r8:0x0 r9:0x5604a25a5f58 r10:0x1000 r11:0x246 r12:0x3e4aad000 r13:0x12 r14:0x40 r15:0x56049f6511b8 rip:0x7fd4ebafb5da eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0x106 fs_base:0x7fd4ec2accc0 gs_base:0x0 } { real_time:58470.062544 global_time:5569, event:`SYSCALLBUF_RESET' tid:14071, ticks:20320918 } { real_time:58470.062576 global_time:5570, event:`SYSCALL: fstatat' (state:EXITING_SYSCALL) tid:14071, ticks:20320918 rax:0x0 rbx:0x7ffe29dc0bc0 rcx:0xffffffffffffffff rdx:0x7ffe29dc0a60 rsi:0x7fd4ebb98bd5 rdi:0x12 rbp:0x7ffe29dc0c50 rsp:0x7ffe29dc0a48 r8:0x0 r9:0x5604a25a5f58 r10:0x1000 r11:0x246 r12:0x3e4aad000 r13:0x12 r14:0x40 r15:0x56049f6511b8 rip:0x7fd4ebafb5da eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0x106 fs_base:0x7fd4ec2accc0 gs_base:0x0 { tid:14071, addr:0x7ffe29dc0a60, length:0x90 } } { real_time:58470.062632 global_time:5571, event:`SYSCALLBUF_FLUSH' tid:14071, ticks:20322072 { syscall:'read', ret:0x3f, size:0x4f, desched:1 } { syscall:'read', ret:0x40, size:0x50, desched:1 } { syscall:'read', ret:0x80, size:0x90, desched:1 } { syscall:'read', ret:0x100, size:0x110, desched:1 } { syscall:'read', ret:0x200, size:0x210, desched:1 } { syscall:'read', ret:0x234, size:0x244, desched:1 } { syscall:'read', ret:0x0, size:0x10, desched:1 } { syscall:'close', ret:0x0, size:0x10 } } { real_time:58470.062636 global_time:5572, event:`SYSCALL: sysinfo' (state:ENTERING_SYSCALL) tid:14071, ticks:20322072 rax:0xffffffffffffffda rbx:0x681fffa0 rcx:0xffffffffffffffff rdx:0x7fd4ebb961f0 rsi:0x7ffe29dc0cd0 rdi:0x7ffe29dc0ad0 rbp:0x681fffa0 rsp:0x681ffde0 r8:0x1d0 r9:0x0 r10:0x7fd4ebb7fac0 r11:0x246 r12:0x1 r13:0x5604a09e8270 r14:0x7fd4ec415000 r15:0x56049f6511b8 rip:0x70000002 eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0x63 fs_base:0x7fd4ec2accc0 gs_base:0x0 } { real_time:58470.062638 global_time:5573, event:`SYSCALLBUF_RESET' tid:14071, ticks:20322072 } { real_time:58470.062658 global_time:5574, event:`SYSCALL: sysinfo' (state:EXITING_SYSCALL) tid:14071, ticks:20322072 rax:0x0 rbx:0x681fffa0 rcx:0xffffffffffffffff rdx:0x7fd4ebb961f0 rsi:0x7ffe29dc0cd0 rdi:0x7ffe29dc0ad0 rbp:0x681fffa0 rsp:0x681ffde0 r8:0x1d0 r9:0x0 r10:0x7fd4ebb7fac0 r11:0x246 r12:0x1 r13:0x5604a09e8270 r14:0x7fd4ec415000 r15:0x56049f6511b8 rip:0x70000002 eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0x63 fs_base:0x7fd4ec2accc0 gs_base:0x0 { tid:14071, addr:0x7ffe29dc0ad0, length:0x70 } } { real_time:58470.062704 global_time:5575, event:`SYSCALLBUF_FLUSH' tid:14071, ticks:20322358 { syscall:'openat', ret:0x12, size:0x10, desched:1 } { syscall:'readlinkat', ret:0xd, size:0x1d } } { real_time:58470.062707 global_time:5576, event:`SYSCALL: fstatat' (state:ENTERING_SYSCALL) tid:14071, ticks:20322358 rax:0xffffffffffffffda rbx:0x7ffe29dc0bc0 rcx:0xffffffffffffffff rdx:0x7ffe29dc0a60 rsi:0x7fd4ebb98bd5 rdi:0x12 rbp:0x7ffe29dc0c50 rsp:0x7ffe29dc0a48 r8:0x0 r9:0x0 r10:0x1000 r11:0x246 r12:0x3e4aad000 r13:0x12 r14:0x40 r15:0x56049f6511b8 rip:0x7fd4ebafb5da eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0x106 fs_base:0x7fd4ec2accc0 gs_base:0x0 } { real_time:58470.062709 global_time:5577, event:`SYSCALLBUF_RESET' tid:14071, ticks:20322358 } { real_time:58470.062727 global_time:5578, event:`SYSCALL: fstatat' (state:EXITING_SYSCALL) tid:14071, ticks:20322358 rax:0x0 rbx:0x7ffe29dc0bc0 rcx:0xffffffffffffffff rdx:0x7ffe29dc0a60 rsi:0x7fd4ebb98bd5 rdi:0x12 rbp:0x7ffe29dc0c50 rsp:0x7ffe29dc0a48 r8:0x0 r9:0x0 r10:0x1000 r11:0x246 r12:0x3e4aad000 r13:0x12 r14:0x40 r15:0x56049f6511b8 rip:0x7fd4ebafb5da eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0x106 fs_base:0x7fd4ec2accc0 gs_base:0x0 { tid:14071, addr:0x7ffe29dc0a60, length:0x90 } } { real_time:58470.062782 global_time:5579, event:`SYSCALLBUF_FLUSH' tid:14071, ticks:20323658 { syscall:'read', ret:0x3f, size:0x4f, desched:1 } { syscall:'read', ret:0x40, size:0x50, desched:1 } { syscall:'read', ret:0x80, size:0x90, desched:1 } { syscall:'read', ret:0x100, size:0x110, desched:1 } { syscall:'read', ret:0x200, size:0x210, desched:1 } { syscall:'read', ret:0x234, size:0x244, desched:1 } { syscall:'read', ret:0x0, size:0x10, desched:1 } { syscall:'close', ret:0x0, size:0x10 } } { real_time:58470.062786 global_time:5580, event:`SYSCALL: mmap' (state:ENTERING_SYSCALL) tid:14071, ticks:20323658 rax:0xffffffffffffffda rbx:0x681fffa0 rcx:0xffffffffffffffff rdx:0x3 rsi:0x4002000 rdi:0x0 rbp:0x681fffa0 rsp:0x681ffde0 r8:0xffffffff r9:0x0 r10:0x22 r11:0x246 r12:0x0 r13:0x0 r14:0x1000 r15:0x7fd4ebc37b20 rip:0x70000002 eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0x9 fs_base:0x7fd4ec2accc0 gs_base:0x0 } { real_time:58470.062788 global_time:5581, event:`SYSCALLBUF_RESET' tid:14071, ticks:20323658 } { real_time:58470.062812 global_time:5582, event:`SYSCALL: mmap' (state:EXITING_SYSCALL) tid:14071, ticks:20323658 rax:0x7fd4c7ffe000 rbx:0x681fffa0 rcx:0xffffffffffffffff rdx:0x3 rsi:0x4002000 rdi:0x0 rbp:0x681fffa0 rsp:0x681ffde0 r8:0xffffffff r9:0x0 r10:0x22 r11:0x246 r12:0x0 r13:0x0 r14:0x1000 r15:0x7fd4ebc37b20 rip:0x70000002 eflags:0x246 cs:0x33 ss:0x2b ds:0x0 es:0x0 fs:0x0 gs:0x0 orig_rax:0x9 fs_base:0x7fd4ec2accc0 gs_base:0x0 { map_file:"