On Tue, Nov 21, 2023 at 11:57:40PM +1100, Jonathan Gray wrote:
> On Tue, Nov 21, 2023 at 08:19:11PM +1100, Jonathan Gray wrote:
> > On Mon, Nov 20, 2023 at 09:19:45PM +0000, Edd Barrett wrote:
> > > Hi Jonathan,
> > > 
> > > On Mon, Nov 20, 2023 at 07:16:14PM +1100, Jonathan Gray wrote:
> > > > When it last worked, were you running Mesa 23.1 (snapshots since early
> > > > November)?  Did this start with LLVM 16 (last few days)?
> > > 
> > > Looking back in my messages.0.gz, it seems I hadn't updated in a while.
> > > 
> > > The last working snapshot I had installed was:
> > > OpenBSD 7.4-current (GENERIC.MP) #1403: Thu Oct 12 19:56:46 MDT 2023
> > > 
> > > Unfortunatley I don't know what Mesa I had at the time.
> > 
> > That would have been Mesa 22.3.7
> > 
> > With Mesa 22.3.7 on -current I can't reproduce the crash.
> 
> works with 23.1.9 after reverting
> https://gitlab.freedesktop.org/mesa/mesa/-/commit/244cc152d1b20592120ce1d5dd9627509b73d0b9

I committed a fix for this.  From Gert Wollny upstream:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/26420

Index: src/gallium/drivers/r600/sfn/sfn_optimizer.cpp
===================================================================
RCS file: 
/cvs/xenocara/lib/mesa/src/gallium/drivers/r600/sfn/sfn_optimizer.cpp,v
retrieving revision 1.1.1.2
diff -u -p -r1.1.1.2 sfn_optimizer.cpp
--- src/gallium/drivers/r600/sfn/sfn_optimizer.cpp      2 Nov 2023 04:32:35 
-0000       1.1.1.2
+++ src/gallium/drivers/r600/sfn/sfn_optimizer.cpp      1 Dec 2023 07:42:19 
-0000
@@ -373,7 +373,11 @@ CopyPropFwdVisitor::visit(AluInstr *inst
    auto ii = dest->uses().begin();
    auto ie = dest->uses().end();
 
-   while(ii != ie) {
+   /** libc++ seems to invalidate the end iterator too if a std::set is
+    *  made empty by an erase operation,
+    *  https://gitlab.freedesktop.org/mesa/mesa/-/issues/7931
+    */
+   while(ii != ie && !dest->uses().empty()) {
       auto i = *ii;
       ++ii;
       /* SSA can always be propagated, registers only in the same block

Reply via email to