Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

double free or corruption (out) #1233

Closed
Tracked by #1247
bjorn3 opened this issue May 9, 2022 · 2 comments · Fixed by #1242
Closed
Tracked by #1247

double free or corruption (out) #1233

bjorn3 opened this issue May 9, 2022 · 2 comments · Fixed by #1242

Comments

@bjorn3
Copy link

bjorn3 commented May 9, 2022

Code

macro_rules! impl_uint {
    ($($ty:ident = $lang:literal),*) => {
        $(
            impl $ty {
                pub fn to_le(self) -> Self {
                    #[cfg(not(target_endian = "little"))]
                    {
                        self.swap_bytes()
                    }
                }
            }
        )*
    }
}

impl_uint!(u8 = "u8", u16 = "u16", u32 = "u32");

Meta

  • What version of Rust GCC were you using, git sha if possible.
    gccrs (Compiler-Explorer-Build-gcc-74e836599ce80a11b1fe28065ed7aae6ffa3b7e2-binutils-2.38) 12.0.1 20220118 (experimental)
    

Error output

<output>
Backtrace

gccrs-snapshot - 670ms

double free or corruption (out)
rust1: internal compiler error: Aborted
0x205eb59 internal_error(char const*, ...)
  ???:0
0x7f360563303b raise
  ???:0
0x7f3605612858 abort
  ???:0
0x8c9bbe Rust::Session::expansion(Rust::AST::Crate&)
  ???:0
0x8ccfa4 Rust::Session::parse_file(char const*)
  ???:0
0x8cdc18 Rust::Session::parse_files(int, char const**)
  ???:0
Please submit a full bug report,
with preprocessed source if appropriate.
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
Compiler returned: 1

@bjorn3 bjorn3 added the bug label May 9, 2022
@philberty
Copy link
Member

@dkm it seems compiler explorer is missing debug symbols does it make sense for us to compile with -g on compiler explorer?

@CohenArthur CohenArthur added this to To do in Imports and Visbility via automation May 10, 2022
@CohenArthur CohenArthur added this to the Imports and visibility milestone May 10, 2022
@CohenArthur
Copy link
Member

Investigated a little more and the crash seems to originate from deallocating the std::vector<ContextType> in the MacroExpander class. I'll look into it, thanks a lot!

@CohenArthur CohenArthur self-assigned this May 10, 2022
@bors bors bot closed this as completed in c1ff799 May 10, 2022
Imports and Visbility automation moved this from To do to Done May 10, 2022
@philberty philberty mentioned this issue May 12, 2022
16 tasks
CohenArthur added a commit to CohenArthur/gccrs that referenced this issue May 18, 2022
This testcase uncovered a very interesting bug requiring a refactor of
our `AST::Block` class (Rust-GCC#1253), but should still be fixed/adapted in the
meantime so that the BE builds on our buildbot do not fail.
bors bot added a commit that referenced this issue May 18, 2022
1252: privacy: Handle calls to functions defined in previous ancestors r=CohenArthur a=CohenArthur

Previously, we would only check if `current_module` was a direct
descendant of the item's module. However, we also need to visit each of this
item's module's children recursively.


1254: issue #1233: Do not rely on the endianness for testing r=CohenArthur a=CohenArthur

This testcase uncovered a very interesting bug requiring a refactor of
our `AST::Block` class (#1253), but should still be fixed/adapted in the
meantime so that the BE builds on our buildbot do not fail.

I've tested this newtestcase with a compiler from 74e8365, which was the commit pointed out in #1233. The same ICE would still trigger, so I can safely say that this is a different exemple showing the same underlying issue. I'll work on fixing #1253 but it is a refactor we need to think about a little.

This should make all the architectures on buildbot happy again!

Co-authored-by: Arthur Cohen <arthur.cohen@embecosm.com>
CohenArthur added a commit to CohenArthur/gccrs that referenced this issue May 20, 2022
This testcase uncovered a very interesting bug requiring a refactor of
our `AST::Block` class (Rust-GCC#1253), but should still be fixed/adapted in the
meantime so that the BE builds on our buildbot do not fail.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
No open projects
Development

Successfully merging a pull request may close this issue.

3 participants