https://bugs.kde.org/show_bug.cgi?id=432440

            Bug ID: 432440
           Summary: Valgrind always crashes Rust programs on FreeBSD with
                    "failed to allocate a guard page"
           Product: valgrind
           Version: unspecified
          Platform: Other
                OS: FreeBSD
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: jsew...@acm.org
          Reporter: asom...@gmail.com
  Target Milestone: ---

SUMMARY
Every Rust program will crash on FreeBSD when run with Valgrind with the error
"failed to allocate a guard page".  This affects literally every single Rust
program.  For example, ripgrep.  It affects every tool: memcheck, cachegrind,
callgrind, helgrind, drd, massif, lackey, exp-bbv, and even none.

STEPS TO REPRODUCE
1. pkg install ripgrep
2. valgrind --tool=callgrind /usr/local/bin/rg

OBSERVED RESULT
$ valgrind --tool=memcheck /usr/local/bin/rg
==10062== Memcheck, a memory error detector
==10062== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==10062== Using Valgrind-3.17.0.GIT and LibVEX; rerun with -h for copyright
info
==10062== Command: /usr/local/bin/rg
==10062== 
thread '<unnamed>' panicked at 'failed to allocate a guard page',
library/std/src/sys/unix/thread.rs:364:17
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
fatal runtime error: failed to initiate panic, error 5
==10062== 
==10062== Process terminating with default action of signal 6 (SIGABRT):
dumping core


EXPECTED RESULT
The program should run normally.

SOFTWARE/OS VERSIONS
FreeBSD.  Reproduced on 14.0-CURRENT, 12.2-RELEASE, 11.2-RELEASE, and
11.4-RELEASE amd64.
Reproduced with Valgrind 3.10.1 and 3.17.0.GIT, 

ADDITIONAL INFORMATION

Rust bug entry.  The Rust team believes this to be a Valgrind bug, however.
https://github.com/rust-lang/rust/issues/67153

Rust code that allocates the guard page on startup of every program.
https://doc.rust-lang.org/src/std/sys/unix/thread.rs.html#346

-- 
You are receiving this mail because:
You are watching all bug changes.

Reply via email to