public inbox for gcc-rust@gcc.gnu.org
 help / color / mirror / Atom feed
From: "marxin at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-rust@gcc.gnu.org
Subject: [Bug rust/108124] New: UBSAN issues when tests are run
Date: Thu, 15 Dec 2022 09:47:29 +0000	[thread overview]
Message-ID: <bug-108124-35322@http.gcc.gnu.org/bugzilla/> (raw)

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=108124

            Bug ID: 108124
           Summary: UBSAN issues when tests are run
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: rust
          Assignee: unassigned at gcc dot gnu.org
          Reporter: marxin at gcc dot gnu.org
                CC: dkm at gcc dot gnu.org, gcc-rust at gcc dot gnu.org
  Target Milestone: ---

I built GCC compiler with ASAN & UBSAN enabled:
F="-fsanitize=address,undefined -g -O2" ; make -j32 all-host -k CFLAGS="$F"
CXXFLAGS="$F"  LDFLAGS="$F"

and I see a couple of issues:

./xgcc -B.
/home/marxin/Programming/gcc/gcc/testsuite/rust/compile/torture/must_use2.rs -c
/usr/include/c++/12/bits/stl_iterator.h:1096:17: runtime error: reference
binding to null pointer of type 'struct SubstitutionParamMapping'
    #0 0x3be00ae in
__gnu_cxx::__normal_iterator<Rust::TyTy::SubstitutionParamMapping*,
std::vector<Rust::TyTy::SubstitutionParamMapping,
std::allocator<Rust::TyTy::SubstitutionParamMapping> > >::operator*() const
/usr/include/c++/12/bits/stl_iterator.h:1096
    #1 0x3be00ae in std::vector<Rust::TyTy::SubstitutionParamMapping,
std::allocator<Rust::TyTy::SubstitutionParamMapping> >::front()
/usr/include/c++/12/bits/stl_vector.h:1207
    #2 0x3be00ae in
Rust::TyTy::TypeBoundPredicate::TypeBoundPredicate(Rust::DefId,
std::vector<Rust::TyTy::SubstitutionParamMapping,
std::allocator<Rust::TyTy::SubstitutionParamMapping> >, Location)
/home/marxin/Programming/gcc/gcc/rust/typecheck/rust-tyty-bounds.cc:129
    #3 0x3be0ea3 in Rust::TyTy::TypeBoundPredicate::error()
/home/marxin/Programming/gcc/gcc/rust/typecheck/rust-tyty-bounds.cc:207
    #4 0x3cc9cb8 in Rust::Resolver::TypeCheckItem::visit(Rust::HIR::ImplBlock&)
/home/marxin/Programming/gcc/gcc/rust/typecheck/rust-hir-type-check-item.cc:74
    #5 0x3cc72e7 in Rust::Resolver::TypeCheckItem::Resolve(Rust::HIR::Item&)
/home/marxin/Programming/gcc/gcc/rust/typecheck/rust-hir-type-check-item.cc:39
    #6 0x39c3724 in Rust::Resolver::TypeResolution::Resolve(Rust::HIR::Crate&)
/home/marxin/Programming/gcc/gcc/rust/typecheck/rust-hir-type-check.cc:48
    #7 0x2aff5ff in Rust::Session::compile_crate(char const*)
/home/marxin/Programming/gcc/gcc/rust/rust-session-manager.cc:565
    #8 0x2b0420e in Rust::Session::handle_input_files(int, char const**)
/home/marxin/Programming/gcc/gcc/rust/rust-session-manager.cc:362
    #9 0x212ce46 in grs_langhook_parse_file
/home/marxin/Programming/gcc/gcc/rust/rust-lang.cc:184
    #10 0xcf3b22e in compile_file
/home/marxin/Programming/gcc/gcc/toplev.cc:444
    #11 0xcf4f14d in do_compile /home/marxin/Programming/gcc/gcc/toplev.cc:2125
    #12 0xcf4f14d in toplev::main(int, char**)
/home/marxin/Programming/gcc/gcc/toplev.cc:2277
    #13 0x10409e86 in main /home/marxin/Programming/gcc/gcc/main.cc:39
    #14 0x7ffff6a2c5af in __libc_start_call_main (/lib64/libc.so.6+0x275af)
    #15 0x7ffff6a2c678 in __libc_start_main_impl (/lib64/libc.so.6+0x27678)
    #16 0x212cbd4 in _start ../sysdeps/x86_64/start.S:115

/usr/include/c++/12/bits/stl_vector.h:1207:16: runtime error: reference binding
to null pointer of type 'struct value_type'
    #0 0x3be00e8 in std::vector<Rust::TyTy::SubstitutionParamMapping,
std::allocator<Rust::TyTy::SubstitutionParamMapping> >::front()
/usr/include/c++/12/bits/stl_vector.h:1207
    #1 0x3be00e8 in
Rust::TyTy::TypeBoundPredicate::TypeBoundPredicate(Rust::DefId,
std::vector<Rust::TyTy::SubstitutionParamMapping,
std::allocator<Rust::TyTy::SubstitutionParamMapping> >, Location)
/home/marxin/Programming/gcc/gcc/rust/typecheck/rust-tyty-bounds.cc:129
    #2 0x3be0ea3 in Rust::TyTy::TypeBoundPredicate::error()
/home/marxin/Programming/gcc/gcc/rust/typecheck/rust-tyty-bounds.cc:207
    #3 0x3cc9cb8 in Rust::Resolver::TypeCheckItem::visit(Rust::HIR::ImplBlock&)
/home/marxin/Programming/gcc/gcc/rust/typecheck/rust-hir-type-check-item.cc:74
    #4 0x3cc72e7 in Rust::Resolver::TypeCheckItem::Resolve(Rust::HIR::Item&)
/home/marxin/Programming/gcc/gcc/rust/typecheck/rust-hir-type-check-item.cc:39
    #5 0x39c3724 in Rust::Resolver::TypeResolution::Resolve(Rust::HIR::Crate&)
/home/marxin/Programming/gcc/gcc/rust/typecheck/rust-hir-type-check.cc:48
    #6 0x2aff5ff in Rust::Session::compile_crate(char const*)
/home/marxin/Programming/gcc/gcc/rust/rust-session-manager.cc:565
    #7 0x2b0420e in Rust::Session::handle_input_files(int, char const**)
/home/marxin/Programming/gcc/gcc/rust/rust-session-manager.cc:362
    #8 0x212ce46 in grs_langhook_parse_file
/home/marxin/Programming/gcc/gcc/rust/rust-lang.cc:184
    #9 0xcf3b22e in compile_file /home/marxin/Programming/gcc/gcc/toplev.cc:444
    #10 0xcf4f14d in do_compile /home/marxin/Programming/gcc/gcc/toplev.cc:2125
    #11 0xcf4f14d in toplev::main(int, char**)
/home/marxin/Programming/gcc/gcc/toplev.cc:2277
    #12 0x10409e86 in main /home/marxin/Programming/gcc/gcc/main.cc:39
    #13 0x7ffff6a2c5af in __libc_start_call_main (/lib64/libc.so.6+0x275af)
    #14 0x7ffff6a2c678 in __libc_start_main_impl (/lib64/libc.so.6+0x27678)
    #15 0x212cbd4 in _start ../sysdeps/x86_64/start.S:115

/home/marxin/Programming/gcc/gcc/rust/util/fnv-hash.h:73:15: runtime error:
shift exponent 6685089673273576526 is too large for 64-bit type 'long unsigned
int'
    #0 0x2b84979 in Rust::Hash::FNV128::write(unsigned char const*, unsigned
long) /home/marxin/Programming/gcc/gcc/rust/util/fnv-hash.h:73
    #1 0x2b84979 in legacy_hash
/home/marxin/Programming/gcc/gcc/rust/backend/rust-mangle.cc:105
    #2 0x2b84979 in legacy_mangle_item
/home/marxin/Programming/gcc/gcc/rust/backend/rust-mangle.cc:266
    #3 0x2b812ec in
Rust::Compile::Mangler::mangle_item[abi:cxx11](Rust::TyTy::BaseType const*,
Rust::Resolver::CanonicalPath const&) const
/home/marxin/Programming/gcc/gcc/rust/backend/rust-mangle.cc:298
    #4 0x421452f in
Rust::Compile::Context::mangle_item[abi:cxx11](Rust::TyTy::BaseType const*,
Rust::Resolver::CanonicalPath const&) const
/home/marxin/Programming/gcc/gcc/rust/backend/rust-compile-context.h:297
    #5 0x421452f in
Rust::Compile::HIRCompileBase::compile_function(Rust::Compile::Context*,
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >
const&, Rust::HIR::SelfParam&, std::vector<Rust::HIR::FunctionParam,
std::allocator<Rust::HIR::FunctionParam> >&, Rust::HIR::FunctionQualifiers
const&, Rust::HIR::Visibility&, std::vector<Rust::AST::Attribute,
std::allocator<Rust::AST::Attribute> >&, Location, Rust::HIR::BlockExpr*,
Rust::Resolver::CanonicalPath const*, Rust::TyTy::FnType*, bool)
/home/marxin/Programming/gcc/gcc/rust/backend/rust-compile-base.cc:537
    #6 0x40b4f0e in Rust::Compile::CompileItem::visit(Rust::HIR::Function&)
/home/marxin/Programming/gcc/gcc/rust/backend/rust-compile-item.cc:164
    #7 0x40a0319 in
Rust::Compile::CompileInherentImplItem::Compile(Rust::HIR::ImplItem*,
Rust::Compile::Context*, Rust::TyTy::BaseType*, bool, Location)
/home/marxin/Programming/gcc/gcc/rust/backend/rust-compile-implitem.h:39
    #8 0x40a0319 in Rust::Compile::CompileItem::visit(Rust::HIR::ImplBlock&)
/home/marxin/Programming/gcc/gcc/rust/backend/rust-compile-item.cc:186
    #9 0x2b64718 in Rust::Compile::CompileItem::compile(Rust::HIR::Item*,
Rust::Compile::Context*, Rust::TyTy::BaseType*, bool, Location)
/home/marxin/Programming/gcc/gcc/rust/backend/rust-compile-item.h:37
    #10 0x2b64718 in Rust::Compile::CompileCrate::go()
/home/marxin/Programming/gcc/gcc/rust/backend/rust-compile.cc:51
    #11 0x2b64eb1 in Rust::Compile::CompileCrate::Compile(Rust::HIR::Crate&,
Rust::Compile::Context*)
/home/marxin/Programming/gcc/gcc/rust/backend/rust-compile.cc:44
    #12 0x2aff8d5 in Rust::Session::compile_crate(char const*)
/home/marxin/Programming/gcc/gcc/rust/rust-session-manager.cc:587
    #13 0x2b0420e in Rust::Session::handle_input_files(int, char const**)
/home/marxin/Programming/gcc/gcc/rust/rust-session-manager.cc:362
    #14 0x212ce46 in grs_langhook_parse_file
/home/marxin/Programming/gcc/gcc/rust/rust-lang.cc:184
    #15 0xcf3b22e in compile_file
/home/marxin/Programming/gcc/gcc/toplev.cc:444
    #16 0xcf4f14d in do_compile /home/marxin/Programming/gcc/gcc/toplev.cc:2125
    #17 0xcf4f14d in toplev::main(int, char**)
/home/marxin/Programming/gcc/gcc/toplev.cc:2277
    #18 0x10409e86 in main /home/marxin/Programming/gcc/gcc/main.cc:39
    #19 0x7ffff6a2c5af in __libc_start_call_main (/lib64/libc.so.6+0x275af)
    #20 0x7ffff6a2c678 in __libc_start_main_impl (/lib64/libc.so.6+0x27678)
    #21 0x212cbd4 in _start ../sysdeps/x86_64/start.S:115

-- 
You are receiving this mail because:
You are on the CC list for the bug.

             reply	other threads:[~2022-12-15  9:47 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-15  9:47 marxin at gcc dot gnu.org [this message]
2022-12-15  9:47 ` [Bug rust/108124] Rust: " marxin at gcc dot gnu.org
2022-12-15  9:51 ` marxin at gcc dot gnu.org
2022-12-15  9:57 ` [Bug rust/108124] Rust: ASAN&UBSAN " marxin at gcc dot gnu.org
2023-04-26  6:57 ` rguenth at gcc dot gnu.org
2023-07-27  9:24 ` rguenth at gcc dot gnu.org

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bug-108124-35322@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-rust@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).