Skip to content

[Clang][Test] Analysis/reinterpret-cast-pointer-to-member.cpp: Assertion failure in Debug build on PPC64 #102190

Open
@awilfox

Description

@awilfox

Test output:

FAIL: Clang :: Analysis/reinterpret-cast-pointer-to-member.cpp (1113 of 19841)
******************** TEST 'Clang :: Analysis/reinterpret-cast-pointer-to-member.cpp' FAILED ********************
Exit Code: 134

Command Output (stderr):
--
RUN: at line 1: /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/build/bin/clang -cc1 -internal-isystem /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/build/lib/clang/18/include -nostdsysteminc -analyze -analyzer-constraints=range -setup-static-analyzer -analyzer-checker=core,debug.ExprInspection -verify /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/test/Analysis/reinterpret-cast-pointer-to-member.cpp
+ /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/build/bin/clang -cc1 -internal-isystem /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/build/lib/clang/18/include -nostdsysteminc -analyze -analyzer-constraints=range -setup-static-analyzer -analyzer-checker=core,debug.ExprInspection -verify /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/test/Analysis/reinterpret-cast-pointer-to-member.cpp
Assertion failed: isValidBaseClass(RD, cast<TypedValueRegion>(Super), IsVirtual) (/home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/lib/StaticAnalyzer/Core/MemRegion.cpp: getCXXBaseObjectRegion: 1259)
PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace, preprocessed source, and associated run script.
Stack dump:
0.	Program arguments: /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/build/bin/clang -cc1 -internal-isystem /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/build/lib/clang/18/include -nostdsysteminc -analyze -analyzer-constraints=range -setup-static-analyzer -analyzer-checker=core,debug.ExprInspection -verify /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/test/Analysis/reinterpret-cast-pointer-to-member.cpp
1.	<eof> parser at end of file
2.	While analyzing stack: 
	#0 Calling testReinterpretCasting::f()
3.	/home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/test/Analysis/reinterpret-cast-pointer-to-member.cpp:24:23: Error evaluating statement
4.	/home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/test/Analysis/reinterpret-cast-pointer-to-member.cpp:24:23: Error evaluating statement
#0 0x00003fff7f362090 (/usr/lib/llvm18/lib/libLLVM.so.18.1+0xb9b090)
#1 0x00003fff8c772444 (+0x444)
/home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/build/test/Analysis/Output/reinterpret-cast-pointer-to-member.cpp.script: line 1: 19565 Aborted                 (core dumped) /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/build/bin/clang -cc1 -internal-isystem /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/build/lib/clang/18/include -nostdsysteminc -analyze -analyzer-constraints=range -setup-static-analyzer -analyzer-checker=core,debug.ExprInspection -verify /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/test/Analysis/reinterpret-cast-pointer-to-member.cpp

GDB Backtrace: unfortunately was too long to paste here. Uploaded: clang-backtrace-gwyn-202408061227.txt

Minimal backtrace (so others can search)

#0  0x00003fff8c6afe6c in __syscall4 (d=8, c=0, b=70368243940976, a=1, n=174) at ./arch/powerpc64/syscall_arch.h:54
#1  abort () at src/exit/abort.c:23
#2  0x00003fff8c6afee8 in __assert_fail (expr=<optimized out>, file=<optimized out>, line=<optimized out>, func=<optimized out>)
    at src/exit/assert.c:7
#3  0x00003fff8b07da00 in clang::ento::MemRegionManager::getCXXBaseObjectRegion (this=0x3fff7c0b76d8, RD=0x3fff7c04ba98, 
    Super=0x3fff7c02f7d8, IsVirtual=false)
    at /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/lib/StaticAnalyzer/Core/MemRegion.cpp:1259
#4  0x00003fff8b0fd6dc in clang::ento::StoreManager::evalDerivedToBase (this=0x3fff7c055820, 
    Derived=<error reading variable: DWARF-2 expression error: DW_OP_GNU_uninit must always be the very last op.>, BaseType=..., 
    IsVirtual=false)
    at /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/lib/StaticAnalyzer/Core/Store.cpp:296
#5  0x00003fff8b0f1284 in operator()<clang::FieldDecl> (FD=0x3fff7c04ba30, __closure=<synthetic pointer>)
    at /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:1091
#6  (anonymous namespace)::SimpleSValBuilder::evalBinOpLN (this=0x3fff7c0b75f0, state=..., op=<optimized out>, lhs=..., rhs=..., 
    resultTy=...)
    at /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/lib/StaticAnalyzer/Core/SimpleSValBuilder.cpp:1098
#7  0x00003fff8b102588 in clang::ento::SValBuilder::evalBinOp (this=0x3fff7c0b75f0, state=..., op=<optimized out>, lhs=..., 
    rhs=..., type=...)
    at /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/lib/StaticAnalyzer/Core/SValBuilder.cpp:517
#8  0x00003fff8b03512c in clang::ento::ExprEngine::evalBinOp (this=0x3fffe22f0e98, ST=..., T=..., RHS=..., LHS=..., 
    Op=clang::BO_PtrMemD)
    at /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h:611
#9  clang::ento::ExprEngine::VisitBinaryOperator (this=0x3fffe22f0e98, B=0x3fff7c04e628, Pred=<optimized out>, Dst=...)
    at /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/lib/StaticAnalyzer/Core/ExprEngineC.cpp:100
#10 0x00003fff8b01953c in clang::ento::ExprEngine::Visit (this=0x3fffe22f0e98, S=0x3fff7c04e628, Pred=0x3fff7c032978, DstTop=...)
    at /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp:2112
#11 0x00003fff8b019e9c in clang::ento::ExprEngine::ProcessStmt (this=0x3fffe22f0e98, currStmt=0x3fff7c04e628, 
    Pred=<optimized out>) at /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/lib/StaticAnalyzer/Core/ExprEngine.cpp:1131
#12 0x00003fff8b021e40 in clang::ento::ExprEngine::processCFGElement (this=0x3fffe22f0e98, E=..., Pred=0x3fff7c032978, StmtIdx=25, Ctx=0x3fffe22f0ba0) at /usr/lib/llvm18/include/llvm/ADT/PointerIntPair.h:190
#13 0x00003fff8afd6b78 in clang::ento::CoreEngine::HandlePostStmt (this=<error reading variable: value has been optimized out>, B=0x3fff7c04efd8, StmtIdx=<optimized out>, Pred=<optimized out>) at /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp:496
#14 0x00003fff8afd72c4 in operator() (__closure=__closure@entry=0x3fffe22f0ce8, MaxSteps=MaxSteps@entry=225000) at /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp:159
#15 0x00003fff8afd745c in clang::ento::CoreEngine::ExecuteWorkList (this=0x3fffe22f0ec0, L=<optimized out>, MaxSteps=225000, InitState=...) at /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/lib/StaticAnalyzer/Core/CoreEngine.cpp:163
#16 0x00003fff8b59a510 in clang::ento::ExprEngine::ExecuteWorkList (Steps=<optimized out>, L=<optimized out>, this=0x3fffe22f0e98) at /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/include/clang/StaticAnalyzer/Core/PathSensitive/ExprEngine.h:190
#17 (anonymous namespace)::AnalysisConsumer::RunPathSensitiveChecks (VisitedCallees=<optimized out>, IMode=clang::ento::ExprEngine::Inline_Regular, D=0x3fff7c04c130, this=0x3fff7c127540) at /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:727
#18 (anonymous namespace)::AnalysisConsumer::HandleCode (this=this@entry=0x3fff7c127540, D=D@entry=0x3fff7c04c130, Mode=<optimized out>, Mode@entry=2, IMode=clang::ento::ExprEngine::Inline_Regular, VisitedCallees=<optimized out>) at /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:697
#19 0x00003fff8b5b4e34 in (anonymous namespace)::AnalysisConsumer::HandleDeclsCallGraph (LocalTUDeclsSize=<optimized out>, this=0x3fff7c127540) at /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:486
#20 (anonymous namespace)::AnalysisConsumer::runAnalysisOnTranslationUnit (C=..., this=0x3fff7c127540) at /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:557
#21 (anonymous namespace)::AnalysisConsumer::HandleTranslationUnit (this=0x3fff7c127540, C=...) at /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/lib/StaticAnalyzer/Frontend/AnalysisConsumer.cpp:612
#22 0x00003fff8820eb00 in clang::ParseAST (S=..., PrintStats=<optimized out>, SkipFunctionBodies=<optimized out>) at /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/lib/Parse/ParseAST.cpp:176
#23 0x00003fff8ac6e954 in clang::ASTFrontendAction::ExecuteAction (this=0x3fff7c189f00) at /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/lib/Frontend/FrontendAction.cpp:1183
#24 0x00003fff8ac75224 in clang::FrontendAction::Execute (this=<optimized out>) at /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/lib/Frontend/FrontendAction.cpp:1069
#25 0x00003fff8abf61c0 in clang::CompilerInstance::ExecuteAction (this=0x3fff7c166ca0, Act=...) at /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/lib/Frontend/CompilerInstance.cpp:1057
#26 0x00003fff8ad17488 in clang::ExecuteCompilerInvocation (Clang=0x3fff7c166ca0) at /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp:272
#27 0x000000013e3e5cd4 in cc1_main (Argv=<error reading variable: DWARF-2 expression error: DW_OP_GNU_uninit must always be the very last op.>, Argv0=0x3fffe22f3aeb "/home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/build/bin/clang", MainAddr=0x13e3df240 <GetExecutablePath[abi:cxx11](char const*, bool)>) at /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/tools/driver/cc1_main.cpp:294
#28 0x000000013e3dfa50 in ExecuteCC1Tool (ArgV=..., ToolContext=...) at /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/tools/driver/driver.cpp:365
#29 0x000000013e3e389c in clang_main (Argc=<optimized out>, Argv=<optimized out>, ToolContext=...) at /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/tools/driver/driver.cpp:405
#30 0x000000013e3dda70 in main (argc=<optimized out>, argv=<optimized out>) at /home/awilcox/Code/awilfox/rust-next/user/clang/src/llvm-project-18.1.8.src/clang/build/tools/driver/clang-driver.cpp:17

System Information

% uname -a; lscpu; gcc --version; ld --version
Linux gwyn.foxkit.us 5.15.98-mc4-easy #1 SMP Sun Apr 2 00:16:18 CDT 2023 ppc64 GNU/Linux
Architecture:          ppc64
  CPU op-mode(s):      32-bit, 64-bit
  Byte Order:          Big Endian
CPU(s):                64
  On-line CPU(s) list: 0-63
Model name:            POWER9, altivec supported
  Model:               2.2 (pvr 004e 1202)
  Thread(s) per core:  4
  Core(s) per socket:  8
  Socket(s):           2
Caches (sum of all):   
  L1d:                 512 KiB (16 instances)
  L1i:                 512 KiB (16 instances)
  L2:                  8 MiB (16 instances)
  L3:                  160 MiB (16 instances)
NUMA:                  
  NUMA node(s):        2
  NUMA node0 CPU(s):   0-31
  NUMA node8 CPU(s):   32-63
Vulnerabilities:       
  Itlb multihit:       Not affected
  L1tf:                Mitigation; RFI Flush, L1D private per thread
  Mds:                 Not affected
  Meltdown:            Mitigation; RFI Flush, L1D private per thread
  Mmio stale data:     Not affected
  Retbleed:            Not affected
  Spec store bypass:   Mitigation; Kernel entry/exit barrier (eieio)
  Spectre v1:          Mitigation; __user pointer sanitization, ori31 speculation barrier enabled
  Spectre v2:          Mitigation; Indirect branch cache disabled, Software link stack flush
  Srbds:               Not affected
  Tsx async abort:     Not affected
gcc (Adelie 13.3.0) 13.3.0
Copyright (C) 2023 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

GNU ld (GNU Binutils) 2.42
Copyright (C) 2024 Free Software Foundation, Inc.
This program is free software; you may redistribute it under the terms of
the GNU General Public License version 3 or (at your option) a later version.
This program has absolutely no warranty.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions