Bug 2216978 - [abrt] clang-tools-extra: clang::expandUCNs(): clangd killed by SIGSEGV
Summary: [abrt] clang-tools-extra: clang::expandUCNs(): clangd killed by SIGSEGV
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: clang
Version: 38
Hardware: x86_64
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Tom Stellard
QA Contact: Fedora Extras Quality Assurance
URL: https://retrace.fedoraproject.org/faf...
Whiteboard: abrt_hash:c0c82e71ca0e37de8e20cdbf247...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2023-06-23 13:52 UTC by Scott Worley
Modified: 2023-08-04 08:31 UTC (History)
12 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: ---
Embargoed:


Attachments (Terms of Use)
File: proc_pid_status (1.39 KB, text/plain)
2023-06-23 13:52 UTC, Scott Worley
no flags Details
File: maps (4.00 KB, text/plain)
2023-06-23 13:52 UTC, Scott Worley
no flags Details
File: limits (1.29 KB, text/plain)
2023-06-23 13:52 UTC, Scott Worley
no flags Details
File: environ (4.44 KB, text/plain)
2023-06-23 13:52 UTC, Scott Worley
no flags Details
File: open_fds (258 bytes, text/plain)
2023-06-23 13:52 UTC, Scott Worley
no flags Details
File: mountinfo (3.87 KB, text/plain)
2023-06-23 13:52 UTC, Scott Worley
no flags Details
File: os_info (734 bytes, text/plain)
2023-06-23 13:52 UTC, Scott Worley
no flags Details
File: cpuinfo (2.87 KB, text/plain)
2023-06-23 13:52 UTC, Scott Worley
no flags Details
File: core_backtrace (78.92 KB, text/plain)
2023-06-23 13:52 UTC, Scott Worley
no flags Details
File: exploitable (81 bytes, text/plain)
2023-06-23 13:52 UTC, Scott Worley
no flags Details
File: backtrace (72.11 KB, text/plain)
2023-06-23 13:53 UTC, Scott Worley
no flags Details

Description Scott Worley 2023-06-23 13:52:37 UTC
Description of problem:
Running emacs + lsp on zephyr rtos code project.
Adding parameters to a C macro and I mistyped: MACRO_NAME(a b, c) and mistyped MACRO_NAME refer to below
Missed the comma after the first parameter.
Abrt reported clangd faulted.
Note, I'm using zephyr Device Tree macros making the parsing more complicated.
static const struct espi_mec5_host_index_config espi_mec5_vw_reg_map[] = {
    DT_FOREACH_CHILD_STATUS_OKAY(DT_PATH(mchp_mec5_espi_vw_map), MEC5_DT_VW_REG_MAP)
};
#define MEC5_DT_VW_REG_MAP(n) \
{
   ..., \
  MEC5_DT_CTVW_IRQ_SEL(n), \
},
#define MEC5_DT_CWVW_IRQ_SEL(n) \
  COND_CODE_1(DT_NODE_HAS_PROP(n, vw_interrupt_sels), \
                                    (MEC5_DT_CTVW_ISEL(n)), (MEC5_DT_CTVW_NO_ISEL))
#define MEC5_DT_CTVW_NO_ISEL(n) \
    .irq_sel = { \
      DT_FOREACH_PROP_ELEM(n, vw_source_names, MEC5_DT_CTVW_ISEL_BY_NAME), \
    }
#define MEC5_CT_CTVW_ISEL_BY_NAME(n prop, idx)

With two levels of DT_FOREACH_... and incorrect names by me, clangd got very upset.

Version-Release number of selected component:
clang-tools-extra-16.0.5-1.fc38

Additional info:
reporter:       libreport-2.17.10
type:           CCpp
reason:         clangd killed by SIGSEGV
journald_cursor: s=dbd31240a7624db5a7563b25e7378010;i=1611d;b=61feae009bf640d0bd815b9a4f3b8537;m=6a191ff7;t=5fecbb3004d44;x=8c22e642e321d716
executable:     /usr/bin/clangd
cmdline:        /usr/bin/clangd --header-insertion-decorators=0
cgroup:         0::/user.slice/user-1000.slice/user/app.slice/app-org.gnome.Terminal.slice/vte-spawn-9aedee34-51ac-4255-a031-6dd0d542f00e.scope
rootdir:        /
uid:            1000
kernel:         6.3.8-200.fc38.x86_64
package:        clang-tools-extra-16.0.5-1.fc38
runlevel:       N 5
dso_list:       /usr/bin/clangd clang-tools-extra-16.0.5-1.fc38.x86_64 (Fedora Project) 1687048504
backtrace_rating: 4
crash_function: clang::expandUCNs

Truncated backtrace:
Thread no. 0 (21 frames)
 #0 clang::expandUCNs at /usr/src/debug/clang-16.0.5-1.fc38.x86_64/lib/Lex/LiteralSupport.cpp:333
 #1 clang::NumericLiteralParser::NumericLiteralParser at /usr/src/debug/clang-16.0.5-1.fc38.x86_64/lib/Lex/LiteralSupport.cpp:1074
 #2 clang::Sema::ActOnNumericConstant at /usr/src/debug/clang-16.0.5-1.fc38.x86_64/lib/Sema/SemaExpr.cpp:3769
 #3 clang::Parser::ParseCastExpression at /usr/src/debug/clang-16.0.5-1.fc38.x86_64/lib/Parse/ParseExpr.cpp:992
 #5 clang::Parser::ParseAssignmentExpression at /usr/src/debug/clang-16.0.5-1.fc38.x86_64/lib/Parse/ParseExpr.cpp:174
 #6 clang::Parser::ParseInitializer at /usr/src/debug/clang-16.0.5-1.fc38.x86_64/include/clang/Parse/Parser.h:2038
 #7 clang::Parser::ParseInitializerWithPotentialDesignator at /usr/src/debug/clang-16.0.5-1.fc38.x86_64/lib/Parse/ParseInit.cpp:396
 #8 clang::Parser::ParseBraceInitializer at /usr/src/debug/clang-16.0.5-1.fc38.x86_64/lib/Parse/ParseInit.cpp:495
 #9 clang::Parser::ParseInitializer at /usr/src/debug/clang-16.0.5-1.fc38.x86_64/include/clang/Parse/Parser.h:2039
 #10 clang::Parser::ParseBraceInitializer at /usr/src/debug/clang-16.0.5-1.fc38.x86_64/lib/Parse/ParseInit.cpp:497
 #11 clang::Parser::ParseInitializer at /usr/src/debug/clang-16.0.5-1.fc38.x86_64/include/clang/Parse/Parser.h:2039
 #12 clang::Parser::ParseDeclarationAfterDeclaratorAndAttributes at /usr/src/debug/clang-16.0.5-1.fc38.x86_64/lib/Parse/ParseDecl.cpp:2464
 #13 clang::Parser::ParseDeclGroup at /usr/src/debug/clang-16.0.5-1.fc38.x86_64/lib/Parse/ParseDecl.cpp:2196
 #14 clang::Parser::ParseDeclOrFunctionDefInternal at /usr/src/debug/clang-16.0.5-1.fc38.x86_64/lib/Parse/Parser.cpp:1211
 #15 clang::Parser::ParseDeclarationOrFunctionDefinition at /usr/src/debug/clang-16.0.5-1.fc38.x86_64/lib/Parse/Parser.cpp:1226
 #16 clang::Parser::ParseExternalDeclaration at /usr/src/debug/clang-16.0.5-1.fc38.x86_64/lib/Parse/Parser.cpp:1041
 #17 clang::Parser::ParseTopLevelDecl at /usr/src/debug/clang-16.0.5-1.fc38.x86_64/lib/Parse/Parser.cpp:743
 #18 clang::ParseAST at /usr/src/debug/clang-16.0.5-1.fc38.x86_64/lib/Parse/ParseAST.cpp:162
 #19 clang::FrontendAction::Execute at /usr/src/debug/clang-16.0.5-1.fc38.x86_64/lib/Frontend/FrontendAction.cpp:1058
 #20 clang::clangd::(anonymous namespace)::semaCodeComplete at /builddir/build/BUILD/clang-tools-extra-16.0.5.src/clangd/CodeComplete.cpp:1343
 #21 clang::clangd::signatureHelp at /builddir/build/BUILD/clang-tools-extra-16.0.5.src/clangd/CodeComplete.cpp:2133

Comment 1 Scott Worley 2023-06-23 13:52:41 UTC
Created attachment 1972246 [details]
File: proc_pid_status

Comment 2 Scott Worley 2023-06-23 13:52:43 UTC
Created attachment 1972247 [details]
File: maps

Comment 3 Scott Worley 2023-06-23 13:52:45 UTC
Created attachment 1972248 [details]
File: limits

Comment 4 Scott Worley 2023-06-23 13:52:46 UTC
Created attachment 1972249 [details]
File: environ

Comment 5 Scott Worley 2023-06-23 13:52:49 UTC
Created attachment 1972250 [details]
File: open_fds

Comment 6 Scott Worley 2023-06-23 13:52:51 UTC
Created attachment 1972251 [details]
File: mountinfo

Comment 7 Scott Worley 2023-06-23 13:52:52 UTC
Created attachment 1972252 [details]
File: os_info

Comment 8 Scott Worley 2023-06-23 13:52:54 UTC
Created attachment 1972253 [details]
File: cpuinfo

Comment 9 Scott Worley 2023-06-23 13:52:56 UTC
Created attachment 1972254 [details]
File: core_backtrace

Comment 10 Scott Worley 2023-06-23 13:52:58 UTC
Created attachment 1972255 [details]
File: exploitable

Comment 11 Scott Worley 2023-06-23 13:53:00 UTC
Created attachment 1972256 [details]
File: backtrace


Note You need to log in before you can comment on or make changes to this bug.