<html>
    <head>
      <base href="https://bugs.llvm.org/">
    </head>
    <body><table border="1" cellspacing="0" cellpadding="8">
        <tr>
          <th>Bug ID</th>
          <td><a class="bz_bug_link 
          bz_status_NEW "
   title="NEW - Segfault while building zircon"
   href="https://bugs.llvm.org/show_bug.cgi?id=43950">43950</a>
          </td>
        </tr>

        <tr>
          <th>Summary</th>
          <td>Segfault while building zircon
          </td>
        </tr>

        <tr>
          <th>Product</th>
          <td>clang
          </td>
        </tr>

        <tr>
          <th>Version</th>
          <td>trunk
          </td>
        </tr>

        <tr>
          <th>Hardware</th>
          <td>PC
          </td>
        </tr>

        <tr>
          <th>OS</th>
          <td>Linux
          </td>
        </tr>

        <tr>
          <th>Status</th>
          <td>NEW
          </td>
        </tr>

        <tr>
          <th>Severity</th>
          <td>enhancement
          </td>
        </tr>

        <tr>
          <th>Priority</th>
          <td>P
          </td>
        </tr>

        <tr>
          <th>Component</th>
          <td>Frontend
          </td>
        </tr>

        <tr>
          <th>Assignee</th>
          <td>unassignedclangbugs@nondot.org
          </td>
        </tr>

        <tr>
          <th>Reporter</th>
          <td>leonardchan@google.com
          </td>
        </tr>

        <tr>
          <th>CC</th>
          <td>llvm-bugs@lists.llvm.org, neeilans@live.com, richard-llvm@metafoo.co.uk
          </td>
        </tr></table>
      <p>
        <div>
        <pre>Created <span class=""><a href="attachment.cgi?id=22787" name="attach_22787" title="reproducer.tar.gz">attachment 22787</a> <a href="attachment.cgi?id=22787&action=edit" title="reproducer.tar.gz">[details]</a></span>
reproducer.tar.gz

We hit the following segfault when building zircon:

```
[2806/49927] CXX
kernel-arm64-clang/obj/kernel/dev/interrupt/arm_gic/v3/v3.arm_gicv3.cc.o
FAILED:
kernel-arm64-clang/obj/kernel/dev/interrupt/arm_gic/v3/v3.arm_gicv3.cc.o 
../../../../llvm-monorepo/llvm-build-2-master-fuchsia-toolchain/install/bin//clang++
-MD -MF
kernel-arm64-clang/obj/kernel/dev/interrupt/arm_gic/v3/v3.arm_gicv3.cc.o.d -o
kernel-arm64-clang/obj/kernel/dev/interrupt/arm_gic/v3/v3.arm_gicv3.cc.o
-DTOOLCHAIN_VERSION=/usr/local/google/home/leonardchan/llvm-monorepo/llvm-build-2-master-fuchsia-toolchain/install/bin/
-DZX_DEBUGLEVEL=2 -DLK_DEBUGLEVEL=2 -DWITH_FRAME_POINTERS=1
-D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS=1 -DKERNEL_BASE=0xffffffff00000000
-DSMP_MAX_CPUS=16 -D_KERNEL -DLK -DENABLE_PANIC_SHELL -DWITH_DEBUG_LINEBUFFER
-DZIRCON_TOOLCHAIN -DWITH_KERNEL_PCIE -DWITH_FAIR_SCHEDULER=1 -DARCH_ARM64
-DKERNEL_ASPACE_BASE=0xffff000000000000 -DKERNEL_ASPACE_SIZE=0x0001000000000000
-DUSER_ASPACE_BASE=0x0000000001000000 -DUSER_ASPACE_SIZE=0x0000fffffe000000
-I../../zircon/kernel/include -I../../zircon/kernel/lib/libc/include
-I../../zircon/kernel/lib/io/include -I../../zircon/kernel/lib/heap/include
-I../../zircon/system/ulib/lazy_init/include
-I../../zircon/system/ulib/lockdep/include
-I../../zircon/system/ulib/ffl/include -I../../zircon/kernel/vm/include
-I../../zircon/kernel/lib/user_copy/include
-I../../zircon/system/ulib/zircon-internal/include
-I../../zircon/kernel/lib/ktrace/include -I../../zircon/system/ulib/fbl/include
-I../../zircon/kernel/lib/fbl/include -I../../zircon/system/public
-I../../zircon/kernel/arch/arm64/include
-I../../zircon/kernel/dev/interrupt/arm_gic/v3/include
-I../../zircon/kernel/dev/interrupt/include
-I../../zircon/kernel/dev/interrupt/arm_gic/common/include
-I../../zircon/kernel/dev/interrupt/arm_gic/v2/include
-I../../zircon/system/ulib/region-alloc/include
-I../../zircon/kernel/dev/pcie/include -I../../zircon/kernel/dev/pdev/include
-idirafter ../../zircon/kernel/lib/libc/limits-dummy -fno-common
--target=aarch64-fuchsia -mcpu=cortex-a53 -ffixed-x18
-fcrash-diagnostics-dir=clang-crashreports -fcolor-diagnostics
-fdebug-prefix-map=/usr/local/google/home/leonardchan/other-fuchsia-checkouts/fuchsia/out/default.zircon=.
-fdebug-prefix-map=/usr/local/google/home/leonardchan/other-fuchsia-checkouts/fuchsia/out=..
-fdebug-prefix-map=/usr/local/google/home/leonardchan/other-fuchsia-checkouts/fuchsia=../..
-no-canonical-prefixes -O2 -g3 -Wall -Wextra -Wno-unused-parameter
-Werror=unused-label -Werror=return-type -Wno-address-of-packed-member
-Wnewline-eof -Wno-unknown-warning-option -Wno-c99-designator
-Wno-int-in-bool-context -fno-omit-frame-pointer -ffunction-sections
-fdata-sections -Wthread-safety -Wimplicit-fallthrough -fvisibility=hidden
-ftrivial-auto-var-init=pattern -Werror -Wno-error=deprecated-declarations
-fpie -ffreestanding -include ../../zircon/kernel/include/hidden.h
-fno-unwind-tables -mgeneral-regs-only -Wformat=2 -Wvla -ffixed-x15
-mcmodel=kernel -fno-sanitize=safe-stack -fsanitize=shadow-call-stack
-fdata-sections -Wno-gnu-string-literal-operator-template -std=c++17
-Wconversion -Wno-sign-conversion -Wextra-semi -Wno-deprecated-copy
-ftemplate-backtrace-limit=0 -fno-exceptions -fno-rtti -fno-threadsafe-statics
-fvisibility-inlines-hidden -faligned-new=8 -fno-exceptions -c
../../zircon/kernel/dev/interrupt/arm_gic/v3/arm_gicv3.cc
clang++: error: unable to execute command: Segmentation fault
clang++: error: clang frontend command failed due to signal (use -v to see
invocation)
Fuchsia clang version 10.0.0 (<a href="https://github.com/llvm/llvm-project.git">https://github.com/llvm/llvm-project.git</a>
01b10bc7b14963902405d202ac78cd88d44adbc5) (based on LLVM 10.0.0svn)
Target: aarch64-unknown-fuchsia
Thread model: posix
InstalledDir:
../../../../llvm-monorepo/llvm-build-2-master-fuchsia-toolchain/install/bin
clang++: note: diagnostic msg: PLEASE submit a bug report to
<a href="https://bugs.llvm.org/">https://bugs.llvm.org/</a> and include the crash backtrace, preprocessed source,
and associated run script.
clang++: note: diagnostic msg: 
********************

PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
Preprocessed source(s) and associated run script(s) are located at:
clang++: note: diagnostic msg: clang-crashreports/arm_gicv3-6dd0ee.cpp
clang++: note: diagnostic msg: clang-crashreports/arm_gicv3-6dd0ee.sh
clang++: note: diagnostic msg: 

********************

```

We have bisected the faulty commit to <a href="https://reviews.llvm.org/D69664">https://reviews.llvm.org/D69664</a>.

Reproducer attached.</pre>
        </div>
      </p>


      <hr>
      <span>You are receiving this mail because:</span>

      <ul>
          <li>You are on the CC list for the bug.</li>
      </ul>
    </body>
</html>