Skip to content
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

[CP] Workaround iOS text input crash for emoji+Korean text #36621

Conversation

cyanglaz
Copy link
Contributor

@cyanglaz cyanglaz commented Oct 5, 2022

Hot fixing: flutter/flutter#111494
PR: #34508, #36295

CP issue: flutter/flutter#112963

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide and the C++, Objective-C, Java style guides.
  • I listed at least one issue that this PR fixes in the description above.
  • I added new tests to check the change I am making or feature I am adding, or Hixie said the PR is test-exempt. See testing the engine for instructions on
    writing and running engine tests.
  • I updated/added relevant documentation (doc comments with ///).
  • I signed the CLA.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

@flutter-dashboard
Copy link

This pull request was opened from and to a release candidate branch. This should only be done as part of the official Flutter release process. If you are attempting to make a regular contribution to the Flutter project, please close this PR and follow the instructions at Tree Hygiene for detailed instructions on contributing to Flutter.

Reviewers: Use caution before merging pull requests to release branches. Ensure the proper procedure has been followed.

@LongCatIsLooong
Copy link
Contributor

Changes LGTM. Are the tests supposed to pass without infra failures?

@jmagman
Copy link
Member

jmagman commented Oct 6, 2022

https://fuchsia.googlesource.com/third_party clones failed? @CaseyHillers what's up here?

Copy link
Member

@jmagman jmagman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@CaseyHillers
Copy link
Contributor

I don't understand either. It looks related to #34720, possibly a corrupted bot cache. I'll retry the linux builds.

@CaseyHillers
Copy link
Contributor

nit: Can we update the PR title to be something more desciptive? A common format is [CP] $originalPrTitle

@itsjustkevin itsjustkevin changed the title [CP] ba1c87a to flutter-3.2-candidate.5 [CP] Workaround iOS text input crash for emoji+Korean text Oct 6, 2022
@ghost
Copy link

ghost commented Oct 11, 2022

@cyanglaz Hello. Thanks a lot for the fix and sorry to bother again 🙏 This issue is getting serious in my country, South Korea. Would there be timeline to merge this and release a hot-fix?

@zanderso
Copy link
Member

src/third_party/libcxx (ERROR)
----------------------------------------
[0:00:02] Started.
_____ src/third_party/libcxx at 7524ef50093a376f334a62a7e5cebf5d238d4c99
running "git cat-file -e 7524ef50093a376f334a62a7e5cebf5d238d4c99^{commit}" in "/b/s/w/ir/cache/git/fuchsia.googlesource.com-third_party-libcxx"
[0:00:02] fatal: Not a valid object name 7524ef50093a376f334a62a7e5cebf5d238d4c99^{commit}
[0:00:02] Commit with hash "7524ef50093a376f334a62a7e5cebf5d238d4c99" not found
[0:00:02] /b/s/w/ir/cache/git/fuchsia.googlesource.com-third_party-libcxx has 0 .pack files, re-bootstrapping if >50 or ==0
[0:00:02] running "git init --bare" in "/b/s/w/ir/cache/git/fuchsia.googlesource.com-third_party-libcxx"
[0:00:02] Reinitialized existing Git repository in /b/s/w/ir/cache/git/fuchsia.googlesource.com-third_party-libcxx/

@itsjustkevin
Copy link
Contributor

@cyanglaz could you push an empty commit to rerun tests.

@jmagman
Copy link
Member

jmagman commented Oct 11, 2022

@cyanglaz could you push an empty commit to rerun tests.

I re-ran manually 🤞

@skia-gold
Copy link

Gold has detected about 1 new digest(s) on patchset 2.
View them at https://flutter-engine-gold.skia.org/cl/github/36621

@jmagman
Copy link
Member

jmagman commented Oct 11, 2022

/Volumes/Work/s/w/ir/cache/goma/client/gomacc  ../../buildtools/mac-x64/clang/bin/clang++ -MD -MF obj/flutter/shell/platform/darwin/ios/framework/Source/flutter_framework_source.FlutterTextInputPlugin.o.d -DFLUTTER_FRAMEWORK=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DSHELL_ENABLE_SOFTWARE -DSHELL_ENABLE_GL -DSHELL_ENABLE_METAL -DSK_GL -DSK_METAL -DSK_SUPPORT_GPU=1 -DSK_CODEC_DECODES_JPEG -DSK_ENCODE_JPEG -DSK_CODEC_DECODES_PNG -DSK_ENCODE_PNG -DSK_CODEC_DECODES_WEBP -DSK_ENCODE_WEBP -DSK_HAS_WUFFS_LIBRARY -DSK_ENABLE_DUMP_GPU -DSK_DISABLE_AAA -DSK_PARAGRAPH_LIBTXT_SPACES_RESOLUTION -DSK_LEGACY_INNER_JOINS -DSK_LEGACY_IGNORE_DRAW_VERTICES_BLEND_WITH_NO_SHADER -DSK_DISABLE_LEGACY_SHADERCONTEXT -DSK_DISABLE_LOWP_RASTER_PIPELINE -DSK_FORCE_RASTER_PIPELINE_BLITTER -DSK_DISABLE_EFFECT_DESERIALIZATION -DSK_ENABLE_SKSL -DSK_ENABLE_PRECOMPILE -DSK_ASSUME_GL_ES=1 -DSK_ENABLE_API_AVAILABLE -DFLUTTER_RUNTIME_MODE_DEBUG=1 -DFLUTTER_RUNTIME_MODE_PROFILE=2 -DFLUTTER_RUNTIME_MODE_RELEASE=3 -DFLUTTER_RUNTIME_MODE_JIT_RELEASE=4 -DDART_LEGACY_API=\[\[deprecated\]\] -DFLUTTER_RUNTIME_MODE=1 -DFLUTTER_JIT_RUNTIME=1 -DVULKAN_HPP_NO_EXCEPTIONS=1 -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DUSE_CHROMIUM_ICU=1 -DU_ENABLE_TRACING=1 -DU_ENABLE_RESOURCE_TRACING=0 -DU_STATIC_IMPLEMENTATION -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE -DRAPIDJSON_HAS_STDSTRING -DRAPIDJSON_HAS_CXX11_RANGE_FOR -DRAPIDJSON_HAS_CXX11_RVALUE_REFS -DRAPIDJSON_HAS_CXX11_TYPETRAITS -DRAPIDJSON_HAS_CXX11_NOEXCEPT -DIMPELLER_SUPPORTS_PLATFORM=1 -DIMPELLER_SUPPORTS_RENDERING=1 -DIMPELLER_ENABLE_METAL=1 -DFLUTTER_API_SYMBOL_PREFIX=Embedder -DFLUTTER_NO_EXPORT -I../.. -Igen -I../../third_party/skia -I../../third_party/vulkan_memory_allocator/include -I../../third_party/vulkan-deps/vulkan-headers/src/include -I../../flutter/third_party -I../../flutter -I../../third_party/dart/runtime -I../../third_party/dart/runtime/include -I../../flutter/third_party/txt/src -I../../third_party/harfbuzz/src -I../../third_party/icu/source/common -I../../third_party/icu/source/i18n -I../../third_party/rapidjson -I../../third_party/rapidjson/include -Igen/flutter -I../../flutter/shell/platform/darwin/common/framework/Headers -I../../flutter/shell/platform/embedder -isysroot /Volumes/Work/s/w/ir/cache/osx_sdk/XCode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator15.0.sdk -mios-simulator-version-min=11.0 -fno-strict-aliasing -arch x86_64 -fcolor-diagnostics -Wall -Wextra -Wendif-labels -Werror -Wno-missing-field-initializers -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-deprecated-copy -Wno-psabi -Wno-unqualified-std-cast-call -Wno-non-c-typedef-for-linkage -Wno-range-loop-construct -Wunguarded-availability -Wno-deprecated-declarations -fvisibility=hidden -stdlib=libc++ -Wstring-conversion -Wnewline-eof -Os -fno-ident -fdata-sections -ffunction-sections -g2  -Werror=overriding-method-mismatch -Werror=undeclared-selector -fvisibility-inlines-hidden -fobjc-call-cxx-cdtors -std=c++17 -fno-rtti -fno-exceptions -nostdinc++ -isystem /Volumes/Work/s/w/ir/cache/osx_sdk/XCode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1  -c ../../flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm -o obj/flutter/shell/platform/darwin/ios/framework/Source/flutter_framework_source.FlutterTextInputPlugin.o
../../flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm:76:3: error: unknown type name 'UChar32'
  UChar32 codePoint;
  ^
../../flutter/shell/platform/darwin/ios/framework/Source/FlutterTextInputPlugin.mm:84:57: error: use of undeclared identifier 'UCHAR_EMOJI'
  return gotCodePoint && u_hasBinaryProperty(codePoint, UCHAR_EMOJI);

@cyanglaz this doesn't build, does this also need to cherry-pick #34508? Can you validate the fix on the candidate branch?

@jmagman
Copy link
Member

jmagman commented Oct 11, 2022

does this also need to cherry-pick #34508?

Or at least the #include "unicode/uchar.h"

@cyanglaz
Copy link
Contributor Author

Having some issue with local build and im trying to fix it. Meanwhile, im pushing the #include "unicode/uchar.h" to wait for ci

@skia-gold
Copy link

Gold has detected about 4 new digest(s) on patchset 3.
View them at https://flutter-engine-gold.skia.org/cl/github/36621

@cyanglaz
Copy link
Contributor Author

cyanglaz commented Oct 12, 2022

2022-10-11 16:54:34.354889-0700 IosUnitTests[39515:758479] Failed to find assets path for "Frameworks/App.framework/flutter_assets"
2022-10-11 16:54:34.378126-0700 IosUnitTests[39515:760334] [VERBOSE-2:engine.cc(200)] Engine run configuration was invalid.
2022-10-11 16:54:34.379990-0700 IosUnitTests[39515:760334] [VERBOSE-2:shell.cc(604)] Could not launch engine with configuration.
2022-10-11 16:54:34.510220-0700 IosUnitTests[39515:760354] flutter: The Dart VM service is listening on http://127.0.0.1:63572/RlYhrgW4nqo=/
Test Case '-[FlutterTextInputPluginTest testCachedComposedCharacterClearedAtKeyboardInteraction]' failed (0.224 seconds).

I'm not sure what this failure is.

Still trying to build local engine from the release branch, got:

FAILED: clang_arm64/obj/third_party/dart/runtime/vm/compiler/backend/libdart_compiler_precompiler.redundancy_elimination.o 
../../buildtools/mac-x64/clang/bin/clang++ -MD -MF clang_arm64/obj/third_party/dart/runtime/vm/compiler/backend/libdart_compiler_precompiler.redundancy_elimination.o.d -DUSE_OPENSSL=1 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D_FORTIFY_SOURCE=2 -D_LIBCPP_DISABLE_AVAILABILITY=1 -D_LIBCPP_DISABLE_VISIBILITY_ANNOTATIONS -D_LIBCPP_ENABLE_THREAD_SAFETY_ANNOTATIONS -D_DEBUG -DTARGET_ARCH_X64 -DNDEBUG -DDART_TARGET_OS_MACOS -DDART_TARGET_OS_MACOS_IOS -DDART_PRECOMPILER -I../../third_party/dart/runtime -I../.. -Iclang_arm64/gen -I../../third_party/libcxx/include -I../../third_party/libcxxabi/include -I../../third_party/dart/runtime/include -isysroot /Applications/Xcode_14.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX12.3.sdk -mmacosx-version-min=10.11.0 -fno-strict-aliasing -fstack-protector-all -arch arm64 -fno-aligned-allocation -fcolor-diagnostics -Wall -Wextra -Wendif-labels -Werror -Wno-missing-field-initializers -Wno-unused-parameter -Wno-unused-but-set-parameter -Wno-unused-but-set-variable -Wno-implicit-int-float-conversion -Wno-c99-designator -Wno-deprecated-copy -Wno-psabi -Wno-unqualified-std-cast-call -Wno-non-c-typedef-for-linkage -Wno-range-loop-construct -Wunguarded-availability -Wno-deprecated-declarations -fvisibility=hidden -stdlib=libc++ -Wstring-conversion -Wnewline-eof -O0 -g2 -Werror -Wall -Wextra -Wno-unused-parameter -Wno-unused-private-field -Wnon-virtual-dtor -Wvla -Woverloaded-virtual -Wno-comments -g3 -ggdb3 -fno-rtti -fno-exceptions -Wimplicit-fallthrough -fno-strict-vtable-pointers -O3 -fvisibility-inlines-hidden -std=c++17 -fno-rtti -nostdinc++ -nostdinc++ -fvisibility=hidden -fno-exceptions  -c ../../third_party/dart/runtime/vm/compiler/backend/redundancy_elimination.cc -o clang_arm64/obj/third_party/dart/runtime/vm/compiler/backend/libdart_compiler_precompiler.redundancy_elimination.o
In file included from ../../third_party/dart/runtime/vm/compiler/backend/redundancy_elimination.cc:5:
In file included from ../../third_party/dart/runtime/vm/compiler/backend/redundancy_elimination.h:12:
In file included from ../../third_party/dart/runtime/vm/compiler/backend/flow_graph.h:13:
In file included from ../../third_party/dart/runtime/vm/compiler/backend/il.h:17:
In file included from ../../third_party/dart/runtime/vm/code_descriptors.h:12:
In file included from ../../third_party/dart/runtime/vm/runtime_entry.h:15:
In file included from ../../third_party/dart/runtime/vm/native_arguments.h:11:
../../third_party/dart/runtime/vm/simulator.h:12:2: error: Simulator not implemented.
#error Simulator not implemented.
 ^
1 error generated.

Not sure if i need to do something like flutter/flutter#96745

@ghost
Copy link

ghost commented Oct 12, 2022

Thanks for your hard work 👍 Just FYI: This issue still happens in 16.1 beta 5.

@jmagman
Copy link
Member

jmagman commented Oct 12, 2022

I didn't see error: Simulator not implemented error, what command are you running? I tried:

$  ./flutter/tools/gn --no-goma --unoptimized --ios --simulator && ninja -C out/ios_debug_sim_unopt  ios_test_flutter

Not sure why it's missing from the logs, but I reproduced the test failure locally:

FlutterTextInputPluginTest.mm:465 testCachedComposedCharacterClearedAtKeyboardInteraction: ((inputView.text) equal to (finalText)) failed: ("👨‍👩‍👧‍��아") is not equal to ("�아")
FlutterTextInputPluginTest.mm:424 testSystemOnlyAddingPartialComposedCharacter: ((inputView.text) equal to (@"👨‍👩‍👧‍👦아")) failed: ("👨‍👩‍👧‍��아") is not equal to ("👨‍👩‍👧‍👦아")
FlutterTextInputPluginTest.mm:435 testSystemOnlyAddingPartialComposedCharacter: ((inputView.text) equal to (@"👨‍👩‍👧‍👦😀아")) failed: ("👨‍👩‍👧‍����아") is not equal to ("👨‍👩‍👧‍👦😀아")
/FlutterTextInputPluginTest.mm:446 testSystemOnlyAddingPartialComposedCharacter: ((inputView.text) equal to (@"👨‍👩‍👧‍👦😀아")) failed: ("👨‍👩‍👧‍����아") is not equal to ("👨‍👩‍👧‍👦😀아")

When I cherry-picked in #34508 to see if --icu-data-file-path=Frameworks/Flutter.framework/icudtl.dat in the test scheme was needed but those failed as well:

FlutterTextInputPluginTest.mm:500 testCachedComposedCharacterClearedAtKeyboardInteraction: ((inputView.text) equal to (finalText)) failed: ("👨‍👩‍👧‍��아") is not equal to ("�아")
FlutterTextInputPluginTest.mm:459 testSystemOnlyAddingPartialComposedCharacter: ((inputView.text) equal to (@"👨‍👩‍👧‍👦아")) failed: ("👨‍👩‍👧‍��아") is not equal to ("👨‍👩‍👧‍👦아")
FlutterTextInputPluginTest.mm:470 testSystemOnlyAddingPartialComposedCharacter: ((inputView.text) equal to (@"👨‍👩‍👧‍👦😀아")) failed: ("👨‍👩‍👧‍����아") is not equal to ("👨‍👩‍👧‍👦😀아")
FlutterTextInputPluginTest.mm:481 testSystemOnlyAddingPartialComposedCharacter: ((inputView.text) equal to (@"👨‍👩‍👧‍👦😀아")) failed: ("👨‍👩‍👧‍����아") is not equal to ("👨‍👩‍👧‍👦😀아")
FlutterTextInputPluginTest.mm:424 testDeletingBackward: ((inputView.text) equal to (@"ឹ😀 text 🥰👨‍👩‍👧‍👦")) failed: ("ឹ😀 text 🥰👨‍👩‍👧‍👦🇺�") is not equal to ("ឹ😀 text 🥰👨‍👩‍👧‍👦")
FlutterTextInputPluginTest.mm:426 testDeletingBackward: ((inputView.text) equal to (@"ឹ😀 text 🥰")) failed: ("ឹ😀 text 🥰👨‍👩‍👧‍👦🇺") is not equal to ("ឹ😀 text 🥰")
FlutterTextInputPluginTest.mm:429 testDeletingBackward: ((inputView.text) equal to (@"ឹ😀 text ")) failed: ("ឹ😀 text 🥰👨‍👩‍👧‍👦�") is not equal to ("ឹ😀 text ")
FlutterTextInputPluginTest.mm:437 testDeletingBackward: ((inputView.text) equal to (@"ឹ😀")) failed: ("ឹ😀 text 🥰👨‍👩‍") is not equal to ("ឹ😀")
FlutterTextInputPluginTest.mm:439 testDeletingBackward: ((inputView.text) equal to (@"ឹ")) failed: ("ឹ😀 text 🥰👨‍👩") is not equal to ("ឹ")
FlutterTextInputPluginTest.mm:441 testDeletingBackward: ((inputView.text) equal to (@"")) failed: ("ឹ😀 text 🥰👨‍�") is not equal to ("")

@cyanglaz can you try to step through these and see why these tests are failing?

@godofredoc
Copy link
Contributor

@cyanglaz @jmagman I started preparing the release hotfix should we skip this CP?

@jmagman
Copy link
Member

jmagman commented Oct 17, 2022

@cyanglaz and I are actively debugging this right now, can we hold on the release hotfix until this is complete?

@godofredoc
Copy link
Contributor

godofredoc commented Oct 17, 2022

@cyanglaz and I are actively debugging this right now, can we hold on the release hotfix until this is complete?

Sounds good, please let me know when resolved to start the release.

@jmagman
Copy link
Member

jmagman commented Oct 17, 2022

When I cherry-picked in #34508 to see if --icu-data-file-path=Frameworks/Flutter.framework/icudtl.dat in the test scheme was needed but those failed as well:

I think I hadn't built the engine properly on both changes; it does seem to pass if #34508 is cherry-picked before #36295. However I don't have permission to push to your fork, @cyanglaz, can you try that?

@jmagman
Copy link
Member

jmagman commented Oct 17, 2022

However I don't have permission to push to your fork, @cyanglaz, can you try that?

Created #36807 to try the tests there.

@jmagman
Copy link
Member

jmagman commented Oct 17, 2022

The tests pass on #36807 which means it should also pass on this one https://ci.chromium.org/p/flutter/builders/try/Mac%20Unopt/19879 since they are now the same.

@cyanglaz
Copy link
Contributor Author

Closing in favor of #36807

@cyanglaz cyanglaz closed this Oct 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants