You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.crashProcess exits with SIGSEGV, SIGABRT, etc. An unhandled exception is not a crash.P1A high priority bug; for example, a single project is unusable or has many test failures
The code below causes a segfault for us on Android/ios arm devices. We encountered this when running a release build of a Flutter app on an arm Android device (built on Windows). We first noticed it in Flutter 1.22.0 / Dart 2.10.1. Issue did not occur when tested with Flutter 1.20.4 / Dart 2.9.2.
import 'dart:typed_data';
class BaseClass {
BaseClass({this.data});
final ByteData data;
int get value => null;
}
class Class1 extends BaseClass {
static const int VALUE = 0x01;
Class1({ByteData data}) : super(data: data);
@override int get value => VALUE;
}
class Class2 extends BaseClass {
static const int VALUE = 0x02;
Class2({ByteData data}) : super(data: data);
@override int get value => VALUE;
}
class Class3 extends BaseClass {
static const int VALUE = 0x03;
Class3({ByteData data}) : super(data: data);
@override int get value => VALUE;
}
class Class4 extends BaseClass {
static const int VALUE = 0x04;
Class4({ByteData data}) : super(data: data);
@override int get value => VALUE;
}
class ClassResolver {
ClassResolver._();
static BaseClass resolveClass(int value, ByteData data) {
var klass = BaseClass(data: data);
switch(value) {
case 0x100001: print("A"); klass = Class1(data: data); break;
case 0x100000: print("B"); klass = Class2(data: data); break;
case 0x110001: print("C"); klass = Class3(data: data); break;
case 0x110000: print("D"); klass = Class4(data: data); break;
default: throw Exception("Failed to resolve class.");
}
print("Z");
print(klass.value); // <-- SEGV_MAPERR at this line
return klass;
}
}
void main() {
var data = Uint8List.fromList([0, 1, 2, 3, 4]).buffer.asByteData();
ClassResolver.resolveClass(0x100001, data);
ClassResolver.resolveClass(0x100000, data);
ClassResolver.resolveClass(0x110001, data);
ClassResolver.resolveClass(0x110000, data);
}
The text was updated successfully, but these errors were encountered:
srawlins
added
the
area-vm
Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends.
label
Dec 29, 2020
mkustermann
added
crash
Process exits with SIGSEGV, SIGABRT, etc. An unhandled exception is not a crash.
P1
A high priority bug; for example, a single project is unusable or has many test failures
labels
Dec 31, 2020
The problem is that unboxing information was not attached to BaseClass.value because its body is unreachable.
So compiler treated result of dispatch table call to BaseClass.value as boxed, while all its implementations in sub-classes actually return unboxed value:
class BaseClass extends core::Object {
[@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasNonThisUses:false,hasTearOffUses:false,getterSelectorId:1] [@vm.unreachable.metadata=] get value() → core::int*
throw "Attempt to execute method removed by Dart AOT compiler (TFA)";
}
class Class1 extends tes::BaseClass {
[@vm.procedure-attributes.metadata=methodOrSetterCalledDynamically:false,getterCalledDynamically:false,hasThisUses:false,hasNonThisUses:false,hasTearOffUses:false,getterSelectorId:1] [@vm.unboxing-info.metadata=()->i] @#C1
get value() → core::int*
return #C2;
}
Unreachable members could be used as interface targets of dispatch
table calls, so they should have correct unboxing metadata.
This change fixes attaching unboxing info to such members.
TEST=runtime/tests/vm/dart/regress_44563_test.dart
Fixes#44563
Change-Id: I5da6a8d07048904eb94b05bfba11bdf72d655e12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177621
Reviewed-by: Aske Simon Christensen <[email protected]>
Reviewed-by: Martin Kustermann <[email protected]>
Commit-Queue: Alexander Markov <[email protected]>
Unreachable members could be used as interface targets of dispatch
table calls, so they should have correct unboxing metadata.
This change fixes attaching unboxing info to such members.
TEST=runtime/tests/vm/dart/regress_44563_test.dart
Fixes#44563
Change-Id: I5da6a8d07048904eb94b05bfba11bdf72d655e12
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/177621
Reviewed-by: Aske Simon Christensen <[email protected]>
Reviewed-by: Martin Kustermann <[email protected]>
Commit-Queue: Alexander Markov <[email protected]>
area-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.crashProcess exits with SIGSEGV, SIGABRT, etc. An unhandled exception is not a crash.P1A high priority bug; for example, a single project is unusable or has many test failures
The code below causes a segfault for us on Android/ios arm devices. We encountered this when running a release build of a Flutter app on an arm Android device (built on Windows). We first noticed it in Flutter 1.22.0 / Dart 2.10.1. Issue did not occur when tested with Flutter 1.20.4 / Dart 2.9.2.
A minimal Flutter app that reproduces the issue can also be seen here.
Code
Segfault on Pixel 3
The text was updated successfully, but these errors were encountered: