Bug 97917

Summary: Enabling sisched gives Assertion `!NodePtr->isKnownSentinel()' failed
Product: Mesa Reporter: Vedran Miletić <vedran>
Component: Drivers/Gallium/radeonsiAssignee: Default DRI bug account <dri-devel>
Status: RESOLVED FIXED QA Contact: Default DRI bug account <dri-devel>
Severity: normal    
Priority: medium Keywords: bisected, regression
Version: git   
Hardware: Other   
OS: All   
URL: https://llvm.org/bugs/show_bug.cgi?id=30514
Whiteboard:
i915 platform: i915 features:
Attachments: Dump with R600_DEBUG=vs,tcs,tes,gs,ps,cs,sisched

Description Vedran Miletić 2016-09-24 20:12:16 UTC
WRN:  CPU Power saving is enabled and performance governor is not used.
INF:  Encoded user ID = f97a7a75:53b8c3e8
INF:  
INF:  * Desktop settings...
INF:  Color depth: 32-bit
INF:  Desktop resolution: 1920 x 1080
INF:  [OpenGL] Detected GLSL 1.30
WRN:  [OpenGL] "GL_ARB_get_program_binary" extension is present but not used because no binary formats are exposed.
Talos: /home/vedranm/workspace/llvm/include/llvm/ADT/ilist_iterator.h:126: llvm::ilist_iterator<OptionsT, IsReverse, IsConst>::reference llvm::ilist_iterator<OptionsT, IsReverse, IsConst>::operator*() const [with OptionsT = llvm::ilist_detail::node_options<llvm::MachineInstr, true, true, void>; bool IsReverse = false; bool IsConst = true; llvm::ilist_iterator<OptionsT, IsReverse, IsConst>::reference = const llvm::MachineInstr&]: Assertion `!NodePtr->isKnownSentinel()' failed.
INF:  Crash! (Aborted)
DBG:  
DBG:  //=====================================================
DBG:  Report generated at: unsupported unsupported
DBG:  Version: $Version: Talos_PC_distro; Talos_Executables-Linux-Final; 267252 2016-07-28 13:49:22 @builderl01; Linux-x64-Static-Final-Default$
DBG:  Build type: Linux-x64-Static-Final-Default
DBG:  Dump type: Crash
DBG:  
DBG:  Received signal 6 (Aborted).
DBG:  
DBG:  Dumping registers:
DBG:  RAX:0000000000000000
DBG:  RBX:00007FC7698CF000
DBG:  RCX:00007FC76884292F
DBG:  RDX:0000000000000000
DBG:  RSP:00007FC752728C48
DBG:  RBP:00007FC7594FBFAF
DBG:  
DBG:  RSI:00007FC752728BD0
DBG:  RDI:0000000000000002
DBG:  R08:0000000000000000
DBG:  R09:00007FC752728BD0
DBG:  R10:0000000000000008
DBG:  R11:0000000000000246
DBG:  R12:000000000000007E
DBG:  R13:00007FC7594FC980
DBG:  
DBG:  R14:0000000000000001
DBG:  R15:00007FC7340652B0
DBG:  
DBG:  
DBG:  RIP:00007FC76884292F
DBG:  Flags:00000007
DBG:  
DBG:  Dumping stack back trace:
DBG:  00007FC76884292F 00000001 $adr: "/lib64/libc.so.6" 0001:000000000003592F
DBG:  00007FC76884292F 00000001 $adr: "/lib64/libc.so.6" 0001:000000000003592F
DBG:  00007FC76884452A 00000001 $adr: "/lib64/libc.so.6" 0001:000000000003752A
DBG:  00007FC76883AE37 00000001 $adr: "/lib64/libc.so.6" 0001:000000000002DE37
DBG:  00007FC76883AEE2 00000001 $adr: "/lib64/libc.so.6" 0001:000000000002DEE2
DBG:  00007FC7593DFB5D 00000001 $adr: "/usr/local/lib64/libLLVMAMDGPUCodeGen.so" 0001:0000000000132B5D
DBG:  00007FC7593DF8E4 00000001 $adr: "/usr/local/lib64/libLLVMAMDGPUCodeGen.so" 0001:00000000001328E4
DBG:  00007FC7594C97C1 00000001 $adr: "/usr/local/lib64/libLLVMAMDGPUCodeGen.so" 0001:000000000021C7C1
DBG:  00007FC7594CA02F 00000001 $adr: "/usr/local/lib64/libLLVMAMDGPUCodeGen.so" 0001:000000000021D02F
DBG:  00007FC7594C6778 00000001 $adr: "/usr/local/lib64/libLLVMAMDGPUCodeGen.so" 0001:0000000000219778
DBG:  00007FC7594CC6C5 00000001 $adr: "/usr/local/lib64/libLLVMAMDGPUCodeGen.so" 0001:000000000021F6C5
DBG:  00007FC7594CD854 00000001 $adr: "/usr/local/lib64/libLLVMAMDGPUCodeGen.so" 0001:0000000000220854
DBG:  00007FC7575A0E11 00000001 $adr: "/usr/local/lib64/libLLVMCodeGen.so" 0001:0000000000553E11
DBG:  00007FC7575A01F8 00000001 $adr: "/usr/local/lib64/libLLVMCodeGen.so" 0001:00000000005531F8
DBG:  00007FC7575162E9 00000001 $adr: "/usr/local/lib64/libLLVMCodeGen.so" 0001:00000000004C92E9
DBG:  00007FC754D4BD1F 00000001 $adr: "/usr/local/lib64/libLLVMCore.so" 0001:000000000031ED1F
DBG:  00007FC754D4BE96 00000001 $adr: "/usr/local/lib64/libLLVMCore.so" 0001:000000000031EE96
DBG:  00007FC754D4C1E3 00000001 $adr: "/usr/local/lib64/libLLVMCore.so" 0001:000000000031F1E3
DBG:  00007FC754D4C8B3 00000001 $adr: "/usr/local/lib64/libLLVMCore.so" 0001:000000000031F8B3
DBG:  00007FC754D4CAAB 00000001 $adr: "/usr/local/lib64/libLLVMCore.so" 0001:000000000031FAAB
DBG:  00007FC755F3F0A8 00000001 $adr: "/usr/local/lib64/libLLVMTarget.so" 0001:000000000001A0A8
DBG:  00007FC755F3F2A0 00000001 $adr: "/usr/local/lib64/libLLVMTarget.so" 0001:000000000001A2A0
DBG:  00007FC75A57BAB4 00000001 $adr: "/usr/local/lib64/dri/radeonsi_dri.so" 0001:000000000053EAB4
DBG:  00007FC75A4F39D6 00000001 $adr: "/usr/local/lib64/dri/radeonsi_dri.so" 0001:00000000004B69D6
DBG:  00007FC75A4F586C 00000001 $adr: "/usr/local/lib64/dri/radeonsi_dri.so" 0001:00000000004B886C
DBG:  00007FC75A50200B 00000001 $adr: "/usr/local/lib64/dri/radeonsi_dri.so" 0001:00000000004C500B
DBG:  00007FC75A3DF114 00000001 $adr: "/usr/local/lib64/dri/radeonsi_dri.so" 0001:00000000003A2114
DBG:  00007FC75A3DEF07 00000001 $adr: "/usr/local/lib64/dri/radeonsi_dri.so" 0001:00000000003A1F07
DBG:  00007FC7690F46CA 00000001 $adr: "/lib64/libpthread.so.0" 0001:00000000000076CA
DBG:  00007FC768914F6F 00000001 $adr: "/lib64/libc.so.6" 0001:0000000000107F6F
DBG:  00007FC7690F46CA 00000001 $adr: "/lib64/libpthread.so.0" 0001:00000000000076CA
DBG:  
DBG:  //=====================================================
DBG:  
DBG:

Will bisect.
Comment 1 Vedran Miletić 2016-09-25 03:20:15 UTC
6037e199c8a061b2e9cb22c434644a0eac659fb9 is the first bad commit
commit 6037e199c8a061b2e9cb22c434644a0eac659fb9
Author: Duncan P. N. Exon Smith <dexonsmith@apple.com>
Date:   Sun Sep 11 16:38:18 2016 +0000

    CodeGen: Turn on sentinel tracking for MachineInstr iterators
    
    This is a prep commit before fixing MachineBasicBlock::reverse_iterator
    invalidation semantics, ala r281167 for ilist::reverse_iterator.  This
    changes MachineBasicBlock::Instructions to track which node is the
    sentinel regardless of LLVM_ENABLE_ABI_BREAKING_CHECKS.
    
    There's almost no functionality change (aside from ABI).  However, in
    the rare configuration:
    
        #if !defined(NDEBUG) && !defined(LLVM_ENABLE_ABI_BREAKING_CHECKS)
    
    the isKnownSentinel() assertions in ilist_iterator<>::operator* suddenly
    have teeth for MachineInstr.  If these assertions start firing for your
    out-of-tree backend, have a look at the suggestions in the commit
    message for r279314, and at some of the commits leading up to it that
    avoid dereferencing the end() iterator.
    
    git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@281168 91177308-0d34-0410-b5e6-96231b3b80d8
Comment 2 Nicolai Hähnle 2016-09-26 19:04:31 UTC
Hi Vedran, please provide the output with R600_DEBUG=vs,tcs,tes,gs,ps,cs. From there, it should be possible to extract the crashing shader.
Comment 3 Vedran Miletić 2016-09-27 21:34:06 UTC
Created attachment 126816 [details]
Dump with R600_DEBUG=vs,tcs,tes,gs,ps,cs,sisched

Interesting, doesn't crash without sisched. With R600_DEBUG=vs,tcs,tes,gs,ps,cs,sisched I get the following.
Comment 4 Vedran Miletić 2016-09-27 21:40:24 UTC
Reproducible with glxgears, not Talos-specific.
Comment 5 Nicolai Hähnle 2016-09-28 10:31:04 UTC
I suspect sisched needs to be updated for recent changes in LLVM to the control flow lowering. Trying to ping Axel Davy...
Comment 6 Vedran Miletić 2017-01-25 19:41:57 UTC
Fixed by https://reviews.llvm.org/D27844 LLVM r290347

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.