<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/109592>109592</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            BOLT merge-fdata crashes on assertion build
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            BOLT
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          kongy
      </td>
    </tr>
</table>

<pre>
    ```
bad runtime enum value
UNREACHABLE executed at llvm-project/llvm/lib/Support/YAMLTraits.cpp:688!
 #0 0x0000560b03a2c531 llvm::sys::PrintStackTrace(llvm::raw_ostream&, int) llvm-project/llvm/lib/Support/Unix/Signals.inc:723:11
 #1 0x0000560b03a2ca2b PrintStackTraceSignalHandler(void*) llvm-project/llvm/lib/Support/Unix/Signals.inc:798:1
 #2 0x0000560b03a2aa26 llvm::sys::RunSignalHandlers() llvm-project/llvm/lib/Support/Signals.cpp:105:5
 #3 0x0000560b03a2d1c5 SignalHandler(int) llvm-project/llvm/lib/Support/Unix/Signals.inc:413:1
 #4 0x00007ff20f0591a0 (/lib/x86_64-linux-gnu/libc.so.6+0x3d1a0)
 #5 0x00007ff20f0a70ec __pthread_kill_implementation ./nptl/pthread_kill.c:44:76
 #6 0x00007ff20f059102 gsignal ./signal/../sysdeps/posix/raise.c:27:6
 #7 0x00007ff20f0424f2 abort ./stdlib/abort.c:81:7
 #8 0x0000560b03944310 llvm::install_out_of_memory_new_handler() llvm-project/llvm/lib/Support/ErrorHandling.cpp:195:0
 #9 0x0000560b03a02e72 llvm::yaml::Output::endEnumScalar() llvm-project/llvm/lib/Support/YAMLTraits.cpp:689:1
#10 0x0000560b038efd62 std::enable_if<has_ScalarEnumerationTraits<llvm::bolt::HashFunction>::value, void>::type llvm::yaml::yamlize<llvm::bolt::HashFunction>(llvm::yaml::IO&, llvm::bolt::HashFunction&, bool, llvm::yaml::EmptyContext&) llvm-project/llvm/include/llvm/Support/YAMLTraits.h:988:1
#11 0x0000560b038efcdf void llvm::yaml::IO::processKeyWithDefault<llvm::bolt::HashFunction, llvm::yaml::EmptyContext>(char const*, llvm::bolt::HashFunction&, llvm::bolt::HashFunction const&, bool, llvm::yaml::EmptyContext&) llvm-project/llvm/include/llvm/Support/YAMLTraits.h:946:7
#12 0x0000560b038efc28 void llvm::yaml::IO::mapOptionalWithContext<llvm::bolt::HashFunction, llvm::yaml::EmptyContext, llvm::bolt::HashFunction>(char const*, llvm::bolt::HashFunction&, llvm::bolt::HashFunction const&, llvm::yaml::EmptyContext&) llvm-project/llvm/include/llvm/Support/YAMLTraits.h:930:3
#13 0x0000560b038edb11 void llvm::yaml::IO::mapOptional<llvm::bolt::HashFunction, llvm::bolt::HashFunction>(char const*, llvm::bolt::HashFunction&, llvm::bolt::HashFunction const&) llvm-project/llvm/include/llvm/Support/YAMLTraits.h:899:3
#14 0x0000560b038ed9ba llvm::yaml::MappingTraits<llvm::yaml::bolt::BinaryProfileHeader>::mapping(llvm::yaml::IO&, llvm::yaml::bolt::BinaryProfileHeader&) llvm-project/bolt/include/bolt/Profile/ProfileYAMLMapping.h:270:3
#15 0x0000560b038ed8d1 void llvm::yaml::detail::doMapping<llvm::yaml::bolt::BinaryProfileHeader>(llvm::yaml::IO&, llvm::yaml::bolt::BinaryProfileHeader&, llvm::yaml::EmptyContext&) llvm-project/llvm/include/llvm/Support/YAMLTraits.h:978:1
#16 0x0000560b038ed875 std::enable_if<unvalidatedMappingTraits<llvm::yaml::bolt::BinaryProfileHeader, llvm::yaml::EmptyContext>::value, void>::type llvm::yaml::yamlize<llvm::yaml::bolt::BinaryProfileHeader, llvm::yaml::EmptyContext>(llvm::yaml::IO&, llvm::yaml::bolt::BinaryProfileHeader&, bool, llvm::yaml::EmptyContext&) llvm-project/llvm/include/llvm/Support/YAMLTraits.h:1136:5
#17 0x0000560b038ed7fa void llvm::yaml::IO::processKey<llvm::yaml::bolt::BinaryProfileHeader, llvm::yaml::EmptyContext>(char const*, llvm::yaml::bolt::BinaryProfileHeader&, bool, llvm::yaml::EmptyContext&) llvm-project/llvm/include/llvm/Support/YAMLTraits.h:960:7
#18 0x0000560b038ed6fe void llvm::yaml::IO::mapRequired<llvm::yaml::bolt::BinaryProfileHeader>(char const*, llvm::yaml::bolt::BinaryProfileHeader&) llvm-project/llvm/include/llvm/Support/YAMLTraits.h:883:3
#19 0x0000560b038ed654 llvm::yaml::MappingTraits<llvm::yaml::bolt::BinaryProfile>::mapping(llvm::yaml::IO&, llvm::yaml::bolt::BinaryProfile&) llvm-project/bolt/include/bolt/Profile/ProfileYAMLMapping.h:315:5
#20 0x0000560b038ed621 void llvm::yaml::detail::doMapping<llvm::yaml::bolt::BinaryProfile>(llvm::yaml::IO&, llvm::yaml::bolt::BinaryProfile&, llvm::yaml::EmptyContext&) llvm-project/llvm/include/llvm/Support/YAMLTraits.h:978:1
#21 0x0000560b038ed5c5 std::enable_if<unvalidatedMappingTraits<llvm::yaml::bolt::BinaryProfile, llvm::yaml::EmptyContext>::value, void>::type llvm::yaml::yamlize<llvm::yaml::bolt::BinaryProfile, llvm::yaml::EmptyContext>(llvm::yaml::IO&, llvm::yaml::bolt::BinaryProfile&, bool, llvm::yaml::EmptyContext&) llvm-project/llvm/include/llvm/Support/YAMLTraits.h:1136:5
#22 0x0000560b038ce107 std::enable_if<has_MappingTraits<llvm::yaml::bolt::BinaryProfile, llvm::yaml::EmptyContext>::value, llvm::yaml::Output&>::type llvm::yaml::operator<<<llvm::yaml::bolt::BinaryProfile>(llvm::yaml::Output&, llvm::yaml::bolt::BinaryProfile&) llvm-project/llvm/include/llvm/Support/YAMLTraits.h:1884:5
#23 0x0000560b038c7c7b main llvm-project/bolt/tools/merge-fdata/merge-fdata.cpp:441:3
#24 0x00007ff20f043b8a __libc_start_call_main ./csu/../sysdeps/nptl/libc_start_call_main.h:74:3
#25 0x00007ff20f043c45 call_init ./csu/../csu/libc-start.c:128:20
#26 0x00007ff20f043c45 __libc_start_main ./csu/../csu/libc-start.c:347:5
#27 0x0000560b038c71e1 _start (build/bin/merge-fdata+0xd91e1)
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace.
Stack dump:
0.      Program arguments: build/bin/merge-fdata -o /dev/null a.yaml b.yaml
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzMWU1v2zoW_TX0hojBD30uvHDSGH2YvknR9mEwK4ESKZtTitSQVF48v34gyqkixW2cxkkLBDDN0IfnnnN1r0Qx5-RWC7EC8SWI3y1Y53fGrr4avd0vSsP3K5Cgwx96B9C6ZBzaTnvZCCh018Bbpjox_O-vf366Xl-9X19-uIbiTlSdFxwyD5W6bS5aa_4jKg_Ipv_af8gSkM3nrm2N7af_vf7zwxfLpHfLqm0BXSdZBggeoCEgFEF0hxBCcYJKRBmpYooDNqBrQNdu74bBRyu1_-xZ9fWLZZUAJBsXWfZ3YZy3gjWAJIBcQak9IPmJHP_S8q6fkFvNlFtKXQG6TgkFdI0fMMVzpoyUcEZrwHjPNFfCApLdGskBWb-US571XEYqZEaFMZIcE-1TpyeMHCDZ6VzuSQzGYRQDuo5HEnRGguMqhnMBXm5EhOk0-Oiwb1rXBNUozjFDMAR2ALzLkiKJLpTU3d3FVnfDP6qlM8sEkEt0RzlmCJB8xIynmCxFooJF0fqdFYwXX6VShWxaJRqhPfPSaLgEZKNbrwDZPFy2DJyj3rVkxE8ecUYEbl0INCANQ0A2y_Bt77hoXQ9tXNDEMulEwCZpfxWN0OkUOiJRTSArjfUDsOeDKmEqIGS4ZzciZBMj8yiiGD3IJqmdZ0oVpvOFqYtGNMbuCy3-LnbfbD7d42trjQ35IfX2PrXyPrXQyCifphYiIiUPGO1Zo4bRTefbzg9jofm17prPFVPseZyOFKl8zLn-0p9WqUzUPCHQeX6_MyuVKGQN6NWOuWKg0JMRNiTLAA7o1RhDadSB93vmdptOV_1CQK-HyaEAkysYKsj9rN-34qgO_Uj-T5y4w8PaOWL8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