From mboxrd@z Thu Jan 1 00:00:00 1970
From: bugzilla-daemon@freedesktop.org
Subject: [Bug 106928] When starting a match Rocket League crashes on "Go"
Date: Fri, 29 Jun 2018 07:16:24 +0000
Message-ID:
References:
Mime-Version: 1.0
Content-Type: multipart/mixed; boundary="===============2121170950=="
Return-path:
Received: from culpepper.freedesktop.org (culpepper.freedesktop.org
[IPv6:2610:10:20:722:a800:ff:fe98:4b55])
by gabe.freedesktop.org (Postfix) with ESMTP id 3C2EE6EF36
for ; Fri, 29 Jun 2018 07:16:24 +0000 (UTC)
In-Reply-To:
List-Unsubscribe: ,
List-Archive:
List-Post:
List-Help:
List-Subscribe: ,
Errors-To: dri-devel-bounces@lists.freedesktop.org
Sender: "dri-devel"
To: dri-devel@lists.freedesktop.org
List-Id: dri-devel@lists.freedesktop.org
--===============2121170950==
Content-Type: multipart/alternative; boundary="15302565841.9fb90.18457"
Content-Transfer-Encoding: 7bit
--15302565841.9fb90.18457
Date: Fri, 29 Jun 2018 07:16:24 +0000
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://bugs.freedesktop.org/
Auto-Submitted: auto-generated
https://bugs.freedesktop.org/show_bug.cgi?id=3D106928
--- Comment #11 from ubizjak@gmail.com ---
(In reply to Roland Scheidegger from comment #9)
> (In reply to ubizjak from comment #7)
> > Please configure the build with:
> >=20
> > CXXFLAGS=3D"-Wp,-D_GLIBCXX_ASSERTIONS" ./autogen.sh
>=20
> That didn't do anything neither. However I figured out the problem more or
> less in the code, and some googling said that using -D_GLIBCXX_DEBUG shou=
ld
> make it trigger reliably, and indeed it does...
Great ;)
> The issue is that (you already showed that actually)
> src =3D std::vector of length 2, capacity 3 =3D {0x7f94d905d110, 0x7f94d9=
05cf70}}
> And trying to access element src[2].
> There's an early exit in the function if src.size() is < 3. Since this
> didn't hit, apparently fold_assoc() resized the vector. And indeed it can=
do
> that (there's an explicit n->src.resize(2) somewhere, and it would still
> return false in this case).
>=20
> I think something like this should do:
> diff --git a/src/gallium/drivers/r600/sb/sb_expr.cpp
> b/src/gallium/drivers/r600/sb/sb_expr.cpp
> index 1df78da660..c77b9f2d7d 100644
> --- a/src/gallium/drivers/r600/sb/sb_expr.cpp
> +++ b/src/gallium/drivers/r600/sb/sb_expr.cpp
> @@ -945,6 +945,8 @@ bool expr_handler::fold_alu_op3(alu_node& n) {
> if (!sh.safe_math && (n.bc.op_ptr->flags & AF_M_ASSOC)) {
> if (fold_assoc(&n))
> return true;
> + else if (n.src.size() < 3)
> + return fold_alu_op2(n);
> }
>=20=20
> value* v0 =3D n.src[0]->gvalue();
I wonder if we should fix expr_handler::fold_assoc instead. Digging through=
the
code, fold_assoc is called only from expr_handler::fold_alu_op2 and
expr_handler::fold_alu_op3. When true is returned, it triggers an early exit
from expr_handler::fold_alu_op{2,3} functions.
The part we are looking for in expr_handler::fold_assoc is:
} else { // MULADD =3D> ADD
n->src[0] =3D n->src[2];
n->bc.src[0] =3D n->bc.src[2];
n->src[1] =3D sh.get_const_value(cr);
memset(&n->bc.src[1], 0, sizeof(bc_alu_src));
n->src.resize(2);
n->bc.set_op(ALU_OP2_ADD);
}
So, let's call fold_alu_op2 here and return true to trigger early exit in
expr_handler::fold_alu_op3. This is what the code a couple of lines above t=
he
presented code does when an operand degenerates to mov.
The (effectively the same patch as yours) proposed patch would be:
diff --git a/src/gallium/drivers/r600/sb/sb_expr.cpp
b/src/gallium/drivers/r600/sb/sb_expr.cpp
index 7a5d62c8e8..a609d1377f 100644
--- a/src/gallium/drivers/r600/sb/sb_expr.cpp
+++ b/src/gallium/drivers/r600/sb/sb_expr.cpp
@@ -714,6 +714,8 @@ bool expr_handler::fold_assoc(alu_node *n) {
n->src.resize(2);
n->bc.set_op(ALU_OP2_ADD);
+ fold_alu_op2(*n);
+ return true;
}
} else if (last_arg >=3D 0) {
n->src[0] =3D a->src[last_arg];
WDYT?
On a side note, maybe -D_GLIBCXX_ASSERTIONS should be added to mesa testsui=
te.
This is the flag that Fedora 28 builds use by default now, so it would be
beneficial to catch these bugs early in the development cycle, before they
reach users.
--=20
You are receiving this mail because:
You are the assignee for the bug.=
--15302565841.9fb90.18457
Date: Fri, 29 Jun 2018 07:16:24 +0000
MIME-Version: 1.0
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
X-Bugzilla-URL: http://bugs.freedesktop.org/
Auto-Submitted: auto-generated
Comme=
nt # 11
on bug 10692=
8
from ubizjak@gmail.co=
m
(In reply to Roland Scheidegger from comment #9)
> (In reply to ubizjak from comment #7)
> > Please configure the build with:
> >=20
> > CXXFLAGS=3D"-Wp,-D_GLIBCXX_ASSERTIONS" ./autogen.sh
>=20
> That didn't do anything neither. However I figured out the problem mor=
e or
> less in the code, and some googling said that using -D_GLIBCXX_DEBUG s=
hould
> make it trigger reliably, and indeed it does...
Great ;)
> The issue is that (you already showed that actua=
lly)
> src =3D std::vector of length 2, capacity 3 =3D {0x7f94d905d110, 0x7f9=
4d905cf70}}
> And trying to access element src[2].
> There's an early exit in the function if src.size() is < 3. Since t=
his
> didn't hit, apparently fold_assoc() resized the vector. And indeed it =
can do
> that (there's an explicit n->src.resize(2) somewhere, and it would =
still
> return false in this case).
>=20
> I think something like this should do:
> diff --git a/src/gallium/drivers/r600/sb/sb_expr.cpp
> b/src/gallium/drivers/r600/sb/sb_expr.cpp
> index 1df78da660..c77b9f2d7d 100644
> --- a/src/gallium/drivers/r600/sb/sb_expr.cpp
> +++ b/src/gallium/drivers/r600/sb/sb_expr.cpp
> @@ -945,6 +945,8 @@ bool expr_handler::fold_alu_op3(al=
u_node& n) {
> if (!sh.safe_math && (n.bc.op_ptr->flags & AF_M=
_ASSOC)) {
> if (fold_assoc(&n))
> return true;
> + else if (n.src.size() < 3)
> + return fold_alu_op2(n);
> }
>=20=20
> value* v0 =3D n.src[0]->gvalue();
I wonder if we should fix expr_handler::fold_assoc instead. Digging through=
the
code, fold_assoc is called only from expr_handler::fold_alu_op2 and
expr_handler::fold_alu_op3. When true is returned, it triggers an early exit
from expr_handler::fold_alu_op{2,3} functions.
The part we are looking for in expr_handler::fold_assoc is:
} else { // MULADD =3D> ADD
n->src[0] =3D n->src[2];
n->bc.src[0] =3D n->bc.src[2];
n->src[1] =3D sh.get_const_value(cr);
memset(&n->bc.src[1], 0, sizeof(bc_alu_src));
n->src.resize(2);
n->bc.set_op(ALU_OP2_ADD);
}
So, let's call fold_alu_op2 here and return true to trigger early exit in
expr_handler::fold_alu_op3. This is what the code a couple of lines above t=
he
presented code does when an operand degenerates to mov.
The (effectively the same patch as yours) proposed patch would be:
diff --git a/src/gallium/drivers/r600/sb/sb_expr.cpp
b/src/gallium/drivers/r600/sb/sb_expr.cpp
index 7a5d62c8e8..a609d1377f 100644
--- a/src/gallium/drivers/r600/sb/sb_expr.cpp
+++ b/src/gallium/drivers/r600/sb/sb_expr.cpp
@@ -714,6 +714,8 @@ bool expr_handler::fold_assoc(alu_node =
*n) {
n->src.resize(2);
n->bc.set_op(ALU_OP2_ADD);
+ fold_alu_op2(*n);
+ return true;
}
} else if (last_arg >=3D 0) {
n->src[0] =3D a->src[last_arg];
WDYT?
On a side note, maybe -D_GLIBCXX_ASSERTIONS should be added to mesa testsui=
te.
This is the flag that Fedora 28 builds use by default now, so it would be
beneficial to catch these bugs early in the development cycle, before they
reach users.
You are receiving this mail because:
- You are the assignee for the bug.
=
--15302565841.9fb90.18457--
--===============2121170950==
Content-Type: text/plain; charset="utf-8"
MIME-Version: 1.0
Content-Transfer-Encoding: base64
Content-Disposition: inline
X19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX19fX18KZHJpLWRldmVs
IG1haWxpbmcgbGlzdApkcmktZGV2ZWxAbGlzdHMuZnJlZWRlc2t0b3Aub3JnCmh0dHBzOi8vbGlz
dHMuZnJlZWRlc2t0b3Aub3JnL21haWxtYW4vbGlzdGluZm8vZHJpLWRldmVsCg==
--===============2121170950==--