Bug 486662 - Running with --sanity-level=3 or higher fails on Linux using btrfs
Summary: Running with --sanity-level=3 or higher fails on Linux using btrfs
Status: RESOLVED DUPLICATE of bug 317127
Alias: None
Product: valgrind
Classification: Developer tools
Component: general (show other bugs)
Version: 3.23 GIT
Platform: Other Other
: NOR normal
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-05-06 09:45 UTC by Paul Floyd
Modified: 2024-05-06 16:22 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Paul Floyd 2024-05-06 09:45:23 UTC
When running with --sanity-level=3 or higher the following assert gets triggered

-361664:0: aspacem segment mismatch: V's seg 1st, kernel's 2nd:
--361664:0: aspacem   1: file 0000400000-0000400fff    4096 r----
SmFixed d=0x027 i=1025160 o=0
(1,67) /home/paulf/scratch/valgrind/none/tests/stackgrowth
--361664:0: aspacem ...: .... 0000400000-0000400fff    4096 r--..
....... d=0x01e i=1025160 o=0
(.) m=. /home/paulf/scratch/valgrind/none/tests/stackgrowth
--361664:0: aspacem sync check at m_aspacemgr/aspacemgr-linux.c:2147
(vgPlain_am_get_advisory): FAILE
D
--361664:0: aspacem
--361664:0: aspacem Valgrind: FATAL: aspacem assertion failed:
--361664:0: aspacem   VG_(am_do_sync_check)
(__PRETTY_FUNCTION__,__FILE__,__LINE__)
--361664:0: aspacem   at m_aspacemgr/aspacemgr-linux.c:2147
(vgPlain_am_get_advisory)
--361664:0: aspacem Exiting now.

This is early on in the process, when Valgrind is loading the guest exe. I can reproduce the problem with any exe.

It seems like the values for the filesytem device are from /proc/self/maps and the statx syscall are different. On my system I'm seeing vlaues of 30 and 32.
Comment 1 Paul Floyd 2024-05-06 11:10:40 UTC
In /proc, I see both / and /home as device 00:30 (or d=0x01e as reported by Valgrind).

61 1 0:30 /root / rw,relatime shared:1 - btrfs /dev/sdb3 rw,seclabel,compress=zstd:1,space_cache=v2,subvolid=257,subvol=/root
50 61 0:30 /home /home rw,relatime shared:76 - btrfs /dev/sdb3 rw,seclabel,compress=zstd:1,space_cache=v2,subvolid=256,subvol=/home

stat reports the two as 00:32 and 00:39

stat $(which sleep)
  File: /usr/bin/sleep
  Size: 36864           Blocks: 72         IO Block: 4096   regular file
Device: 0,32    Inode: 13321       Links: 1

And a file in home

stat /home/paulf/.config
  File: /home/paulf/.config
  Size: 3742            Blocks: 0          IO Block: 4096   directory
Device: 0,39    Inode: 65046       Links: 1

00:39 corresponds to d=0x027 in the error message.
Comment 2 Paul Floyd 2024-05-06 16:21:12 UTC
I don't think that it's possible to get this to work and the only option if to detect btrfs and disable the ino/dev check.

And looking even further, this looks like a dupe.
Comment 3 Paul Floyd 2024-05-06 16:22:07 UTC

*** This bug has been marked as a duplicate of bug 317127 ***