Bug 397393 - valgrind: the 'impossible' happened: (Archlinux)
Summary: valgrind: the 'impossible' happened: (Archlinux)
Status: RESOLVED DUPLICATE of bug 396887
Alias: None
Product: valgrind
Classification: Developer tools
Component: memcheck (show other bugs)
Version: 3.13.0
Platform: Other Linux
: NOR critical
Target Milestone: ---
Assignee: Julian Seward
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-08-12 03:38 UTC by David Rankin
Modified: 2018-08-16 13:44 UTC (History)
1 user (show)

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


Attachments
Source producing the executable triggering the error. (4.38 KB, text/x-csrc)
2018-08-12 03:38 UTC, David Rankin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Rankin 2018-08-12 03:38:19 UTC
Created attachment 114412 [details]
Source producing the executable triggering the error.

Running valgrind against a basic allocation and free of a simple char** with opendir/readdir valgrind rolled over and died with an 'impossible' error. (there are no compiler error/warnings `-Wall -Wextra -pedantic` and valgrind on opensuse successfully complete and reports no errors)

However on Archlinux under both 4.17.13 and 4.17.14 (I didn't have an earlier kernel to test), valgrind does the impossible

$ valgrind ./bin/opendir_readdir_dyn_char_basic
==1196== Memcheck, a memory error detector
==1196== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==1196== Using Valgrind-3.13.0 and LibVEX; rerun with -h for copyright info
==1196== Command: ./bin/opendir_readdir_dyn_char_basic
==1196==

valgrind: the 'impossible' happened:
   Unsupported arch_prctl option

host stacktrace:
==1196==    at 0x580441BA: show_sched_status_wrk (m_libcassert.c:355)
==1196==    by 0x580442D4: report_and_quit (m_libcassert.c:426)
==1196==    by 0x58044517: panic (m_libcassert.c:502)
==1196==    by 0x58044517: vgPlain_core_panic_at (m_libcassert.c:507)
==1196==    by 0x5804454A: vgPlain_core_panic (m_libcassert.c:512)
==1196==    by 0x580DAE22: vgSysWrap_amd64_linux_sys_arch_prctl_before
(syswrap-amd64-linux.c:286)
==1196==    by 0x580A0C23: vgPlain_client_syscall (syswrap-main.c:1857)
==1196==    by 0x5809D48A: handle_syscall (scheduler.c:1126)
==1196==    by 0x5809EBB6: vgPlain_scheduler (scheduler.c:1443)
==1196==    by 0x580AED50: thread_wrapper (syswrap-linux.c:103)
==1196==    by 0x580AED50: run_a_thread_NORETURN (syswrap-linux.c:156)

sched status:
  running_tid=1

Thread 1: status = VgTs_Runnable (lwpid 1196)
==1196==    at 0x401A1C5: ??? (in /usr/lib/ld-2.28.so)
==1196==    by 0x178BFBFE: ???


Note: see also the FAQ in the source distribution.
It contains workarounds to several common problems.
In particular, if Valgrind aborted or crashed after
identifying problems in your program, there's a good chance
that fixing those problems will prevent Valgrind aborting or
crashing, especially if it happened in m_mallocfree.c.

If that doesn't help, please report this bug to: www.valgrind.org

In the bug report, send all the above text, the valgrind
version, and what OS and version you are using.  Thanks.

Simple test code that read the directory entries from the directory given as the first argument ('.' by default if no argument is given) and simply outputs the stored names to stdout freeing the storage as it goes and freeing the pointers at the end is attached.

Compiler string used:

gcc -Wall -Wextra -pedantic -Wshadow -finline-functions -std=gnu11 -Ofast -o /tmp/bin/opendir_readdir_dyn_char_basic opendir_readdir_dyn_char_basic.c
Comment 1 Tom Hughes 2018-08-16 13:42:53 UTC

*** This bug has been marked as a duplicate of bug 397012 ***
Comment 2 Tom Hughes 2018-08-16 13:44:39 UTC

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