| Summary: | memcheck/tests/badfree3 test failed | ||
|---|---|---|---|
| Product: | [Developer tools] valgrind | Reporter: | Mingli <mingli.yu> |
| Component: | memcheck | Assignee: | Julian Seward <jseward> |
| Status: | REPORTED --- | ||
| Severity: | normal | CC: | mark, pjfloyd |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Mingli
2025-09-17 07:47:18 UTC
# cat memcheck/tests/badfree3.vgtest.log
Wed Sep 17 07:30:16 2025 executing VALGRIND_LIB=/usr/libexec/valgrind VALGRIND_LIB_INNER=/usr/libexec/valgrind /usr/bin/valgrind --command-line-only=yes --memcheck:leak-check=no --tool=memcheck -q ./badfree > badfree3.stdout.out 2> badfree3.stderr.out
Wed Sep 17 07:30:22 2025 rc 0
Wed Sep 17 07:30:22 2025 stdout:
Wed Sep 17 07:30:22 2025 stderr:
==8923== Invalid free() / delete / delete[] / realloc()
==8923== at 0x4848A23: free (vg_replace_malloc.c:989)
==8923== by 0x401157: main (badfree.c:12)
==8923== Address 0x87654321 is not stack'd, malloc'd or (recently) free'd
==8923==
==8923== Invalid free() / delete / delete[] / realloc()
==8923== at 0x4848A23: free (vg_replace_malloc.c:989)
==8923== by 0x40116B: main (badfree.c:15)
==8923== Address 0x1fff00098c is on thread 1's stack
==8923== in frame #1, created by main (badfree.c:7)
==8923==
Wed Sep 17 07:30:22 2025 executing diff -u /dev/null badfree3.stdout.out > badfree3.stdout.diff
Wed Sep 17 07:30:22 2025 rc 0
Wed Sep 17 07:30:23 2025 executing ./filter_stderr badfree.c < badfree3.stderr.out > vg_regtest.tmp.743
Wed Sep 17 07:30:23 2025 rc 0
Wed Sep 17 07:30:23 2025 executing diff -u badfree3.stderr.exp badfree3.stderr.out > badfree3.stderr.diff
Wed Sep 17 07:30:23 2025 rc 256
--- badfree3.stderr.exp 2011-04-05 23:00:00.000000000 +0000
+++ badfree3.stderr.out 2025-09-17 07:30:23.637969970 +0000
@@ -1,11 +1,11 @@
Invalid free() / delete / delete[] / realloc()
at 0x........: free (vg_replace_malloc.c:...)
- by 0x........: main (tests/badfree.c:12)
+ by 0x........: main (badfree.c:12)
Address 0x........ is not stack'd, malloc'd or (recently) free'd
Invalid free() / delete / delete[] / realloc()
at 0x........: free (vg_replace_malloc.c:...)
- by 0x........: main (tests/badfree.c:15)
+ by 0x........: main (badfree.c:15)
Address 0x........ is on thread 1's stack
in frame #1, created by main (badfree.c:7)
That is odd. So the difference is the reported backtrace doesn't contain "tests/badfree.c:15" but "badfree.c:15" (no directory/, just the file:line). badfree3 is run with --fullpath-after=memcheck/ --fullpath-after=coregrind/ so one would expect the tests/ path (after the memcheck/). Which compiler is this? Could you maybe show: [eu-]readelf --debug-dump=line memcheck/tests/badfree For me that gives: The Directory Table (offset 0x22, lines 2, columns 1): Entry Name 0 (indirect line string, offset: 0): /home/mark/src/valgrind/memcheck/tests 1 (indirect line string, offset: 0x31): /usr/include The File Name Table (offset 0x30, lines 3, columns 2): Entry Dir Name 0 0 (indirect line string, offset: 0x27): badfree.c 1 0 (indirect line string, offset: 0x27): badfree.c 2 1 (indirect line string, offset: 0x3e): stdlib.h We use gcc 15.2. $ readelf --debug-dump=line memcheck/tests/badfree [snip] The Directory Table (offset 0x237, lines 2, columns 1): Entry Name 0 (indirect line string, offset: 0): /usr/src/debug/glibc/2.42+git/csu 1 (indirect line string, offset: 0x22): ../sysdeps/x86_64 The File Name Table (offset 0x245, lines 2, columns 2): Entry Dir Name 0 1 (indirect line string, offset: 0x11f): crtn.S 1 1 (indirect line string, offset: 0x11f): crtn.S Line Number Statements: [0x0000024f] Extended opcode 2: set Address to 0x401016 [0x0000025a] Advance Line by 39 to 40 [0x0000025c] Copy [0x0000025d] Special opcode 62: advance Address by 4 to 0x40101a and Line by 1 to 41 [0x0000025e] Advance PC by 1 to 0x40101b [0x00000260] Extended opcode 1: End of Sequence [0x00000263] Extended opcode 2: set Address to 0x40118c [0x0000026e] Advance Line by 43 to 44 [0x00000270] Copy [0x00000271] Special opcode 62: advance Address by 4 to 0x401190 and Line by 1 to 45 [0x00000272] Advance PC by 1 to 0x401191 [0x00000274] Extended opcode 1: End of Sequence Using GCC 15.2 on Rocky 8.10 I get output almost Identical to Mark's - only the path to my build directory is different. |