Skip to content

vm: Bogus ConcurrentModificationError on _GrowableList.addAll #42011

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
rakudrama opened this issue May 21, 2020 · 0 comments
Closed

vm: Bogus ConcurrentModificationError on _GrowableList.addAll #42011

rakudrama opened this issue May 21, 2020 · 0 comments
Assignees
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-core

Comments

@rakudrama
Copy link
Member

This program crashes on VM but not other platforms:

main() {
  var a = [];
  a.addAll(a);
}

Crash:

Unhandled exception:
Concurrent modification during iteration: Instance(length:0) of '_GrowableList'.
#0      List.addAll (dart:core-patch/growable_array.dart:191:11)
#1      main (file://bug1b5g.dart:3:5)
#2      _startIsolate.<anonymous closure> (dart:isolate-patch/isolate_patch.dart:301:19)

DDC and dart2js only check for an unexpected length just after obtaining the element provided by the iterator.

This works on the VM which indicates that the _GrowableList.addAll(_GrowableList) path is incorrectly specialized:

import 'dart:collection';
main() {
  var a = [];
  a.addAll(UnmodifiableListView(a));
}
@rakudrama rakudrama added area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-core labels May 21, 2020
@sstrickl sstrickl self-assigned this Nov 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-vm Use area-vm for VM related issues, including code coverage, and the AOT and JIT backends. library-core
Projects
None yet
Development

No branches or pull requests

2 participants