Skip to content

sparc64 segfault with function returning an empty struct #40784

Open
@arndb

Description

@arndb
Bugzilla Link 41439
Version 8.0
OS Linux
Blocks #4440
CC @nickdesaulniers

Extended Description

Attempting to build a sparc64 linux kernel with clang, I ran into a segmentation fault compiling mm/mmap.c. Reduced the test case to

struct vm_userfaultfd_ctx {
} fn1(struct vm_userfaultfd_ctx p1) {
return p1;
}

$ clang-9 -cc1 mmap.c -triple sparc64-unknown-linux-gnu -S
Stack dump:
0. Program arguments: clang-9 -cc1 mmap-f2e46f.c -triple sparc64-unknown-linux-gnu -S

  1. parser at end of file
  2. mmap-f2e46f.c:2:3: LLVM IR generation of declaration 'fn1'
  3. mmap-f2e46f.c:2:3: Generating code for declaration 'fn1'
    #​0 0x00007f8be972b97f llvm::sys::PrintStackTrace(llvm::raw_ostream&) (/usr/lib/x86_64-linux-gnu/libLLVM-9.so.1+0x96d97f)
    #​1 0x00007f8be9729dd0 llvm::sys::RunSignalHandlers() (/usr/lib/x86_64-linux-gnu/libLLVM-9.so.1+0x96bdd0)
    #​2 0x00007f8be972bd88 (/usr/lib/x86_64-linux-gnu/libLLVM-9.so.1+0x96dd88)
    #​3 0x00007f8bec979390 __restore_rt (/lib/x86_64-linux-gnu/libpthread.so.0+0x11390)
    #​4 0x000000000087982d (clang-9+0x87982d)
    #​5 0x000000000076836a (clang-9+0x76836a)
    #​6 0x000000000076984f (clang-9+0x76984f)
    #​7 0x0000000000780b8b (clang-9+0x780b8b)
    #​8 0x000000000077a90b (clang-9+0x77a90b)
    #​9 0x0000000000783072 (clang-9+0x783072)
    #​10 0x0000000000d70c3f (clang-9+0xd70c3f)
    #​11 0x0000000000d6e572 (clang-9+0xd6e572)
    #​12 0x00000000011f2c33 (clang-9+0x11f2c33)
    #​13 0x0000000000af751f (clang-9+0xaf751f)
    #​14 0x0000000000ab7878 (clang-9+0xab7878)
    #​15 0x0000000000b7c895 (clang-9+0xb7c895)
    #​16 0x00000000006b140c (clang-9+0x6b140c)
    #​17 0x00000000006af97f (clang-9+0x6af97f)
    #​18 0x00007f8be8167830 __libc_start_main /build/glibc-LK5gWL/glibc-2.23/csu/../csu/libc-start.c:325:0
    #​19 0x00000000006ad0d9 (clang-9+0x6ad0d9)
    Segmentation fault (core dumped)

Metadata

Metadata

Assignees

No one assigned

    Labels

    backend:SparcbugzillaIssues migrated from bugzillaclang:codegenIR generation bugs: mangling, exceptions, etc.confirmedVerified by a second partycrashPrefer [crash-on-valid] or [crash-on-invalid]

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions