<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/104590>104590</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Random SEGFAULTs with llvm-tblgen
</td>
</tr>
<tr>
<th>Labels</th>
<td>
new issue
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
abhisen7
</td>
</tr>
</table>
<pre>
Can someone explain why `llvm-tblgen` is randomly SEGFAULTing?
```
abhishek@abhishek-ThinkCentre-M90t:~$ ./llvm-tblgen -d
llvm-tblgen: for the -d option: requires a value!
abhishek@abhishek-ThinkCentre-M90t:~$ ./llvm-tblgen -d
Segmentation fault (core dumped)
```
Tried debugging the core dump, but not really helping-
```
abhishek@abhishek-ThinkCentre-M90t:~$ coredumpctl gdb 97121
PID: 97121 (llvm-tblgen)
UID: 1000 (abhishek)
GID: 1000 (abhishek)
Signal: 11 (SEGV)
Timestamp: Fri 2024-08-16 16:19:21 +03 (2min 2s ago)
Command Line: /llvm-project/llvm/bin/llvm-tblgen -gen-intrinsic-enums -intrinsic-prefix=xcore -I llvm-project/llvm/include/llvm/IR -I /sql_parser/llvm-project/llvm/include -I /llvm-project/llvm/include /llvm-project/llvm/include/llvm/IR/Intrinsics.td --write-if-changed -o /llvm-project/llvm/include/llvm/IR/IntrinsicsXCore.h -d /llvm-project/llvm/include/llvm/IR/IntrinsicsXCore.h.d
Executable: /llvm-project/llvm/bin/llvm-tblgen
Control Group: /user.slice/user-1000.slice/session-5.scope
Unit: session-5.scope
Slice: user-1000.slice
Session: 5
Owner UID: 1000 (abhishek)
Boot ID: 7176813a7d0e4ccc88231d695c240ccb
Machine ID: b4a360ae60a542b6afb7e25564813061
Hostname: abhishek-ThinkCentre-M90t
Storage: /var/lib/systemd/coredump/core.llvm-tblgen.1000.7176813a7d0e4ccc88231d695c240ccb.97121.1723814361000000.zst (present)
Disk Size: 120.4K
Message: Process 97121 (llvm-tblgen) of user 1000 dumped core.
Found module /usr/lib/x86_64-linux-gnu/libc.so.6 with build-id: 490fef8403240c91833978d494d39e537409b92e
Found module /usr/lib/x86_64-linux-gnu/libm.so.6 with build-id: a508ec5d8bf12fb7fd08204e0f87518e5cd0b102
Found module /usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2 with build-id: 4186944c50f8a32b47d74931e3f512b811813b64
Found module linux-vdso.so.1 with build-id: 104789970bc380523362c588c13a113f5272af58
Stack trace of thread 97121:
#0 0x00006192b704b3f0 n/a (n/a + 0x0)
GNU gdb (Ubuntu 12.1-0ubuntu1~22.04.2) 12.1
Copyright (C) 2022 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "x86_64-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<https://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
GEF for linux ready, type `gef' to start, `gef config' to configure
89 commands loaded and 5 functions added for GDB 12.1 in 0.00ms using Python engine 3.10
Reading symbols from /sql_parser/llvm-project/llvm/bin/llvm-tblgen...
[New LWP 97121]
Core was generated by `/sql_parser/contrib/llvm-project/llvm/bin/llv'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0 0x00006192b704b3f0 in ?? ()
gef⤠bt
#0 0x00006192b704b3f0 in ?? ()
#1 <signal handler called>
#2 0x00006192b704b3f0 in ?? ()
#3 <signal handler called>
#4 0x00006192b704b3f0 in ?? ()
#5 <signal handler called>
#6 0x00006192b704b3f0 in ?? ()
#7 <signal handler called>
#8 0x00006192b704b3f0 in ?? ()
#9 <signal handler called>
#10 0x00006192b704b3f0 in ?? ()
#11 <signal handler called>
#12 0x00006192b704b3f0 in ?? ()
#13 <signal handler called>
#14 0x00006192b704b3f0 in ?? ()
#15 <signal handler called>
#16 0x00006192b704b3f0 in ?? ()
#17 <signal handler called>
#18 0x00006192b704b3f0 in ?? ()
#19 <signal handler called>
#20 0x00006192b704b3f0 in ?? ()
#21 <signal handler called>
#22 0x00006192b704b3f0 in ?? ()
#23 <signal handler called>
#24 0x00006192b704b3f0 in ?? ()
#25 <signal handler called>
#26 0x00006192b704b3f0 in ?? ()
#27 <signal handler called>
#28 0x00006192b704b3f0 in ?? ()
#29 <signal handler called>
#30 0x00006192b704b3f0 in ?? ()
#31 <signal handler called>
#32 0x00006192b704b3f0 in ?? ()
#33 <signal handler called>
#34 0x00006192b705c691 in ?? ()
#35 0x0000040000002000 in ?? ()
#36 0x0000000000000000 in ?? ()
```
This is the binary version, how I am compiling with `clang-15`
```abhishek@abhishek-ThinkCentre-M90t:~/packdb/fuzzer-tests/sql_parser/contrib/llvm-project/llvm/bin$ ./llvm-tblgen --version
LLVM (http://llvm.org/):
LLVM version 14.0.6
Optimized build.
Default target: x86_64-unknown-linux-gnu
Host CPU: skylake
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysWc1y2zgSfhr60kUWCJAUefDBf_Kk1sm44mRm9zQFEk0KaxLQAKBl5TDPvgWI-rFjT6TsuFwqEWh83eiv0eimuLWyU4jnUX4Z5ddnfHQLbc55vZAW1eys1mJ9fsUVWD2gVgj4vOy5VLBarCEqSN8_DbGr-w5VVBCQFgxXQg_9Gh5ubucXX---SNVFbA4RuY7IxfRZkOk_PAZtC3yMMrL9Gn9ZSPV4hcoZjD9WxEXs4q-IZpBEdH6gFGKxwTg0hF1Aqw24BUIsQC-d1GHQ4J-jNGiBwxPvR4xoemjVP2HGA3YDKse9Smj52DuIaNlogyDGYYkiotWbPth8fjESBQisx66Tqgtb2C2O6BXUowOlHRjkfb-GBfZLqbr4b5x7-t68Qq-vcT10ooZqlm4dBfu_-w_X3qdh0u_xkIDtHg_Ev27EU0KIl97Z84bo7ZGiD7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