dart-lang / sdk

The Dart SDK, including the VM, JS and Wasm compilers, analysis, core libraries, and more.
https://dart.dev
BSD 3-Clause "New" or "Revised" License
10.26k stars 1.58k forks source link

dart fix crash in _StringCanonicalizer@493157753.canonicalizeString+0x14e #55831

Closed Hixie closed 5 months ago

Hixie commented 5 months ago

Got the following failure on Flutter CI:

full logs before crash ``` ▌11:52:54▐ STARTING ANALYSIS ▌11:52:54▐ SHARD=customer_testing ▌11:52:54▐ Running customer testing RUNNING: cd .; git fetch origin master workingDirectory: /b/s/w/ir/x/w/flutter, executable: git, arguments: [fetch, origin, master] From https://github.com/flutter/flutter * branch master -> FETCH_HEAD * [new branch] master -> origin/master ELAPSED TIME: 0.652s for git fetch origin master in /b/s/w/ir/x/w/flutter RUNNING: cd .; git branch -f master origin/master workingDirectory: /b/s/w/ir/x/w/flutter, executable: git, arguments: [branch, -f, master, origin/master] branch 'master' set up to track 'origin/master'. ELAPSED TIME: 0.034s for git branch -f master origin/master in /b/s/w/ir/x/w/flutter RUNNING: cd .; git checkout 28f68a081c578424a698b0e14f18a933f4c36efa workingDirectory: /b/s/w/ir/x/w/flutter, executable: git, arguments: [checkout, 28f68a081c578424a698b0e14f18a933f4c36efa] HEAD is now at 28f68a081c Remove hidden dependency on ABI. ELAPSED TIME: 0.434s for git checkout 28f68a081c578424a698b0e14f18a933f4c36efa in /b/s/w/ir/x/w/flutter RUNNING: cd dev/customer_testing; ../../ci.sh workingDirectory: /b/s/w/ir/x/w/flutter/dev/customer_testing, executable: ./ci.sh, arguments: [] + dart pub get Resolving dependencies... Downloading packages... meta 1.14.0 (1.15.0 available) shelf_web_socket 1.0.4 (2.0.0 available) web_socket_channel 2.4.5 (3.0.0 available) Got dependencies! 3 packages have newer versions incompatible with dependency constraints. Try `dart pub outdated` for more information. + cd ../tools + dart pub get Resolving dependencies... Downloading packages... archive 3.3.2 (affected by advisories: [^0], [^1], 3.6.0 available) http 0.13.6 (1.2.1 available) meta 1.14.0 (1.15.0 available) shelf_web_socket 1.0.4 (2.0.0 available) web_socket_channel 2.4.5 (3.0.0 available) Got dependencies! Dependencies are affected by security advisories: [^0]: https://github.com/advisories/GHSA-9v85-q87q-g4vg [^1]: https://github.com/advisories/GHSA-r285-q736-9v95 5 packages have newer versions incompatible with dependency constraints. Try `dart pub outdated` for more information. + rm -rf ../../bin/cache/pkg/tests + git clone https://github.com/flutter/tests.git ../../bin/cache/pkg/tests Cloning into '../../bin/cache/pkg/tests'... ++ dart --enable-asserts ../tools/bin/find_commit.dart . master ../../bin/cache/pkg/tests main + git -C ../../bin/cache/pkg/tests checkout 54cc35f9f82e3ba2bee708411af38dccd9a3cbb3 HEAD is now at 54cc35f Add zulip.test (#368) + dart --enable-asserts run_tests.dart --skip-on-fetch-failure --skip-template ../../bin/cache/pkg/tests/registry/assorted_layout_widgets.test ../../bin/cache/pkg/tests/registry/DanTup_tiler.test ../../bin/cache/pkg/tests/registry/dart_rfb.test ../../bin/cache/pkg/tests/registry/flutter_cocoon.test ../../bin/cache/pkg/tests/registry/flutter_devtools.test ../../bin/cache/pkg/tests/registry/flutter_packages.test ../../bin/cache/pkg/tests/registry/flutter_portal.test ../../bin/cache/pkg/tests/registry/flutter_rfb.test ../../bin/cache/pkg/tests/registry/flutter_svg.test ../../bin/cache/pkg/tests/registry/macos_ui.test ../../bin/cache/pkg/tests/registry/provider.test ../../bin/cache/pkg/tests/registry/super_editor.test ../../bin/cache/pkg/tests/registry/super_sliver_list.test ../../bin/cache/pkg/tests/registry/template.test ../../bin/cache/pkg/tests/registry/zulip.test ```

crash:

Processing ./../../bin/cache/pkg/tests/registry/super_sliver_list.test...
>> dart fix --apply
| Computing fixes in tests...
|
| ===== CRASH =====
| si_signo=Segmentation fault(11), si_code=SEGV_MAPERR(1), si_addr=0x1
| version=3.5.0-180.0.dev (dev) (Wed May 22 09:05:11 2024 -0700) on "linux_x64"
| pid=35868, thread=35899, isolate_group=main(0x55a6e2637550), isolate=main(0x55a6e263af80)
| os=linux, arch=x64, comp=no, sim=no
| isolate_instructions=7f596581b000, vm_instructions=55a6e2070240
| fp=7f595c1fb500, sp=7f595c1fb4b8, pc=7f5965831f4e
|   pc 0x00007f5965831f4e fp 0x00007f595c1fb500 [Optimized] _StringCanonicalizer@493157753.canonicalizeString+0x14e
|   pc 0x00007f594bfe410b fp 0x00007f595c1fb550 [Optimized] SummaryDataReader.readStringUtf8+0x18b
|   pc 0x00007f594bfffcc8 fp 0x00007f595c1fb5c8 [Optimized] new _InfoClassDeclaration@779288756..<anonymous closure>+0x98
|   pc 0x00007f592e58073f fp 0x00007f595c1fb6b0 [Optimized] new _InfoClassDeclaration@779288756.+0x6af
|   pc 0x00007f594bfed4de fp 0x00007f595c1fb6f0 [Optimized] new _InfoUnit@779288756..<anonymous closure>+0x4e
|   pc 0x00007f592e58212a fp 0x00007f595c1fb808 [Optimized] new _InfoUnit@779288756.+0x8ba
|   pc 0x00007f591e114fd1 fp 0x00007f595c1fb880 [Optimized] InformativeDataApplier.applyToUnit+0xc1
|   pc 0x00007f5965d5e863 fp 0x00007f595c1fb8f0 [Unoptimized] InformativeDataApplier.applyTo+0x333
|   pc 0x00007f591e121898 fp 0x00007f595c1fb990 [Optimized] LibraryReader.readElement+0xa88
|   pc 0x00007f5965d41d81 fp 0x00007f595c1fba08 [Unoptimized] LinkedElementFactory.createLibraryElementForReading+0x821
|   pc 0x00007f592e6d7ddc fp 0x00007f595c1fba60 [Optimized] LinkedElementFactory.elementOfReference+0x1ac
|   pc 0x00007f5965d80bcb fp 0x00007f595c1fbaa8 [Unoptimized] LinkedElementFactory.libraryOfUri+0xdb
|   pc 0x00007f5965d814a7 fp 0x00007f595c1fbaf0 [Unoptimized] LinkedElementFactory.libraryOfUri2+0x97
|   pc 0x00007f594bfe3c87 fp 0x00007f595c1fbb30 [Unoptimized] ResolutionReader.libraryOfUri+0xa7
|   pc 0x00007f594bfe380e fp 0x00007f595c1fbbb0 [Unoptimized] LibraryElementLinkedData._readLibraryOrAugmentation@816235580+0x51e
|   pc 0x00007f594bfe2aa5 fp 0x00007f595c1fbc10 [Unoptimized] LibraryElementLinkedData._read@816235580+0x165
|   pc 0x00007f592e6f2c49 fp 0x00007f595c1fbc70 [Optimized] ElementLinkedData.read+0x319
|   pc 0x00007f592e585a2d fp 0x00007f595c1fbcd0 [Optimized] LibraryElementImpl.isFromDeprecatedExport+0x21d
|   pc 0x00007f59662d89be fp 0x00007f595c1fbd80 [Optimized] new PrefixScope.+0x40e
|   pc 0x00007f59662db8a5 fp 0x00007f595c1fbdd0 [Unoptimized] new _LibraryOrAugmentationImportScope@837257398.+0x125
|   pc 0x00007f5965b8386e fp 0x00007f595c1fbe18 [Unoptimized] new LibraryOrAugmentationScope.+0x6e
|   pc 0x00007f5965b84c55 fp 0x00007f595c1fbe78 [Unoptimized] LibraryOrAugmentationElementImpl.get:scope+0xd5
|   pc 0x00007f5965dfde38 fp 0x00007f595c1fbeb0 [Unoptimized] new ReferenceResolver.+0x2a8
|   pc 0x00007f5965dfe12b fp 0x00007f595c1fbf20 [Unoptimized] LibraryBuilder.resolveTypes+0x18b
|   pc 0x00007f5965dfe686 fp 0x00007f595c1fbf78 [Unoptimized] Linker._resolveTypes@817299033+0x186
|   pc 0x00007f5965dff178 fp 0x00007f595c1fbfe0 [Unoptimized] Linker._buildOutlines@817299033+0x208
|   pc 0x00007f596641c3e6 fp 0x00007f595c1fc028 [Optimized] _SuspendState@4048458._createAsyncCallbacks@4048458.thenCallback+0x56
|   pc 0x00007f591e1483e9 fp 0x00007f595c1fc0c0 [Optimized] _rootRunUnary@4048458+0xd9
|   pc 0x00007f591e13b8f2 fp 0x00007f595c1fc118 [Optimized] _rootRunUnary@4048458+0x92
|   pc 0x00007f591e143119 fp 0x00007f595c1fc1a8 [Optimized] _FutureListener@4048458.handleValue+0x1d9
|   pc 0x00007f59663d9066 fp 0x00007f595c1fc228 [Optimized] _Future@4048458._propagateToListeners@4048458.handleValueCallback+0xb6
|   pc 0x00007f59663d8943 fp 0x00007f595c1fc290 [Optimized] _Future@4048458._propagateToListeners@4048458+0x313
|   pc 0x00007f596641d3d0 fp 0x00007f595c1fc2d0 [Optimized] _SuspendState@4048458._returnAsync@4048458+0x1b0
|   pc 0x00007f5965208e8e fp 0x00007f595c1fc300 [Stub] ReturnAsync+0x3e
|   pc 0x00007f596641c3e6 fp 0x00007f595c1fc348 [Optimized] _SuspendState@4048458._createAsyncCallbacks@4048458.thenCallback+0x56
|   pc 0x00007f591e1483e9 fp 0x00007f595c1fc3e0 [Optimized] _rootRunUnary@4048458+0xd9
|   pc 0x00007f591e13b8f2 fp 0x00007f595c1fc438 [Optimized] _rootRunUnary@4048458+0x92
|   pc 0x00007f591e143119 fp 0x00007f595c1fc4c8 [Optimized] _FutureListener@4048458.handleValue+0x1d9
|   pc 0x00007f59663d9066 fp 0x00007f595c1fc548 [Optimized] _Future@4048458._propagateToListeners@4048458.handleValueCallback+0xb6
|   pc 0x00007f59663d8943 fp 0x00007f595c1fc5b0 [Optimized] _Future@4048458._propagateToListeners@4048458+0x313
|   pc 0x00007f596641d3d0 fp 0x00007f595c1fc5f0 [Optimized] _SuspendState@4048458._returnAsync@4048458+0x1b0
|   pc 0x00007f5965208e8e fp 0x00007f595c1fc620 [Stub] ReturnAsync+0x3e
|   pc 0x00007f596641c3e6 fp 0x00007f595c1fc668 [Optimized] _SuspendState@4048458._createAsyncCallbacks@4048458.thenCallback+0x56
|   pc 0x00007f591e1483e9 fp 0x00007f595c1fc700 [Optimized] _rootRunUnary@4048458+0xd9
|   pc 0x00007f591e13b8f2 fp 0x00007f595c1fc758 [Optimized] _rootRunUnary@4048458+0x92
|   pc 0x00007f591e143119 fp 0x00007f595c1fc7e8 [Optimized] _FutureListener@4048458.handleValue+0x1d9
|   pc 0x00007f59663d9066 fp 0x00007f595c1fc868 [Optimized] _Future@4048458._propagateToListeners@4048458.handleValueCallback+0xb6
|   pc 0x00007f59663d8943 fp 0x00007f595c1fc8d0 [Optimized] _Future@4048458._propagateToListeners@4048458+0x313
|   pc 0x00007f596641d3d0 fp 0x00007f595c1fc910 [Optimized] _SuspendState@4048458._returnAsync@4048458+0x1b0
|   pc 0x00007f5965208e8e fp 0x00007f595c1fc940 [Stub] ReturnAsync+0x3e
|   pc 0x00007f596641c3e6 fp 0x00007f595c1fc988 [Optimized] _SuspendState@4048458._createAsyncCallbacks@4048458.thenCallback+0x56
|   pc 0x00007f591e1483e9 fp 0x00007f595c1fca20 [Optimized] _rootRunUnary@4048458+0xd9
|   pc 0x00007f591e13b8f2 fp 0x00007f595c1fca78 [Optimized] _rootRunUnary@4048458+0x92
|   pc 0x00007f591e143119 fp 0x00007f595c1fcb08 [Optimized] _FutureListener@4048458.handleValue+0x1d9
|   pc 0x00007f59663d9066 fp 0x00007f595c1fcb88 [Optimized] _Future@4048458._propagateToListeners@4048458.handleValueCallback+0xb6
|   pc 0x00007f59663d8943 fp 0x00007f595c1fcbf0 [Optimized] _Future@4048458._propagateToListeners@4048458+0x313
|   pc 0x00007f596641d3d0 fp 0x00007f595c1fcc30 [Optimized] _SuspendState@4048458._returnAsync@4048458+0x1b0
|   pc 0x00007f5965208e8e fp 0x00007f595c1fcc60 [Stub] ReturnAsync+0x3e
|   pc 0x00007f596641c3e6 fp 0x00007f595c1fcca8 [Optimized] _SuspendState@4048458._createAsyncCallbacks@4048458.thenCallback+0x56
|   pc 0x00007f591e1483e9 fp 0x00007f595c1fcd40 [Optimized] _rootRunUnary@4048458+0xd9
|   pc 0x00007f591e13b8f2 fp 0x00007f595c1fcd98 [Optimized] _rootRunUnary@4048458+0x92
|   pc 0x00007f591e143119 fp 0x00007f595c1fce28 [Optimized] _FutureListener@4048458.handleValue+0x1d9
|   pc 0x00007f59663d9066 fp 0x00007f595c1fcea8 [Optimized] _Future@4048458._propagateToListeners@4048458.handleValueCallback+0xb6
|   pc 0x00007f59663d8943 fp 0x00007f595c1fcf10 [Optimized] _Future@4048458._propagateToListeners@4048458+0x313
|   pc 0x00007f596641d3d0 fp 0x00007f595c1fcf50 [Optimized] _SuspendState@4048458._returnAsync@4048458+0x1b0
|   pc 0x00007f5965208e8e fp 0x00007f595c1fcf80 [Stub] ReturnAsync+0x3e
|   pc 0x00007f596641c3e6 fp 0x00007f595c1fcfc8 [Optimized] _SuspendState@4048458._createAsyncCallbacks@4048458.thenCallback+0x56
|   pc 0x00007f591e1483e9 fp 0x00007f595c1fd060 [Optimized] _rootRunUnary@4048458+0xd9
|   pc 0x00007f591e13b8f2 fp 0x00007f595c1fd0b8 [Optimized] _rootRunUnary@4048458+0x92
|   pc 0x00007f596641b64a fp 0x00007f595c1fd148 [Optimized] _SuspendState@4048458._awaitCompletedFuture@4048458.run+0x10a
|   pc 0x00007f591e101cfc fp 0x00007f595c1fd1d8 [Optimized] _rootRun@4048458+0xfc
|   pc 0x00007f591e13b409 fp 0x00007f595c1fd228 [Optimized] _rootRun@4048458+0x89
|   pc 0x00007f591e12030a fp 0x00007f595c1fd2d8 [Optimized] _CustomZone@4048458.runGuarded+0x13a
|   pc 0x00007f591e1482d4 fp 0x00007f595c1fd310 [Optimized] _CustomZone@4048458.bindCallbackGuarded.<anonymous closure>+0x44
|   pc 0x00007f59663d5146 fp 0x00007f595c1fd350 [Optimized] _microtaskLoop@4048458+0x56
|   pc 0x00007f59663d7435 fp 0x00007f595c1fd390 [Unoptimized] _startMicrotaskLoop@4048458+0x95
|   pc 0x00007f59663d7603 fp 0x00007f595c1fd3b8 [Optimized] _startMicrotaskLoop@4048458+0x33
|   pc 0x00007f58d72cc2c3 fp 0x00007f595c1fd4a0 [Optimized] _Timer@1026248._runTimers@1026248+0x483
|   pc 0x00007f59664030cb fp 0x00007f595c1fd4d0 [Optimized] _Timer@1026248._handleMessage@1026248+0x6b
|   pc 0x00007f59659178bd fp 0x00007f595c1fd5b8 [Optimized] _Closure@0150898.dyn:call+0x15d
|   pc 0x00007f596641f530 fp 0x00007f595c1fd618 [Optimized] _RawReceivePort@1026248._handleMessage@1026248+0x440
|   pc 0x00007f5965203216 fp 0x00007f595c1fd690 [Stub] InvokeDartCode+0x96
|   pc 0x000055a6e21b22f5 fp 0x00007f595c1fd6f0 dart::DartEntry::InvokeFunction+0x165
|   pc 0x000055a6e21b3cf3 fp 0x00007f595c1fd730 dart::DartLibraryCalls::HandleMessage+0x123
|   pc 0x000055a6e21d0cdf fp 0x00007f595c1fdcc0 dart::IsolateMessageHandler::HandleMessage+0x2bf
|   pc 0x000055a6e21f3179 fp 0x00007f595c1fdd30 dart::MessageHandler::HandleMessages+0x119
|   pc 0x000055a6e21f3568 fp 0x00007f595c1fdd80 dart::MessageHandler::TaskCallback+0x1e8
|   pc 0x000055a6e22f1537 fp 0x00007f595c1fde00 dart::ThreadPool::WorkerLoop+0x137
|   pc 0x000055a6e22f17c2 fp 0x00007f595c1fde30 dart::ThreadPool::Worker::Main+0x72
|   pc 0x000055a6e227a9f6 fp 0x00007f595c1fdef0 dart::ThreadStart+0xd6
| -- End of DumpStackTrace
| Bad state: The analysis server crashed unexpectedly
|
| The analysis server shut down unexpectedly.
| Please report this at dartbug.com.
Processing ./../../bin/cache/pkg/tests/registry/super_sliver_list.test...
ERROR: Could not run "dart fix" in ., which was specified as an update directory.
Contact: matej.knopp@gmail.com

1 failure.
╔═╡ERROR #1╞════════════════════════════════════════════════════════════════════
║ Command: ../../ci.sh 
║ Command exited with exit code 1 but expected zero exit code.
║ Working directory: /b/s/w/ir/x/w/flutter/dev/customer_testing
╚═══════════════════════════════════════════════════════════════════════════════
▌12:18:24▐ Test failed.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
For your convenience, the error messages reported above are repeated here:
  🙙  🙛  
Command: ../../ci.sh 
Command exited with exit code 1 but expected zero exit code.
Working directory: /b/s/w/ir/x/w/flutter/dev/customer_testing
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
You may find the errors by searching for "╡ERROR #" in the logs.
bwilkerson commented 5 months ago

I'm assuming that normal Dart code shouldn't be able to cause a Segmentation fault. If I'm wrong, any help you can provide in figuring out exactly where in the method the problem occurred would be appreciated.

mraleph commented 5 months ago

Given the timing I think this is caused by now reverted change in the GC (commit https://github.com/dart-lang/sdk/commit/9077bf991f3471d61c8c3b3584c8ac11a7a40bcd revert https://github.com/dart-lang/sdk/commit/b732c96e8a0c704261e61de75af89c7b315809ec).

I am going to close this but please reopen if you encounter it again.

FYI @rmacnak-google - this might help you to reproduce the issue