Skip to content
This repository was archived by the owner on Feb 25, 2025. It is now read-only.

[Windows] Fix crash if the Dart entry point is null #38173

Merged
merged 1 commit into from
Dec 12, 2022

Conversation

loic-sharma
Copy link
Member

@loic-sharma loic-sharma commented Dec 10, 2022

The Windows Flutter engine crashes if it is launched with a nullptr Dart entry point:

strlen()
std::_Narrow_char_traits<char,int>::length
std::basic_string_view<char,std::char_traits<char>>::basic_string_view
FlutterDesktopEngineRun
flutter::FlutterEngine::Run(const char*)
flutter::FlutterEngine::Run()
wWinMain

This is needed for scenarios like headless mode with no views. Fixes flutter/flutter#116753

I'll prepare a cherry pick after this is merged.

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.

Copy link
Contributor

@yaakovschectman yaakovschectman left a comment

Choose a reason for hiding this comment

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

lgtm

Copy link
Member

@cbracken cbracken left a comment

Choose a reason for hiding this comment

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

Ouch! Thanks for fixing!

LGTM stamp from a Japanese personal seal

@loic-sharma loic-sharma added the autosubmit Merge PR when tree becomes green via auto submit App label Dec 12, 2022
@auto-submit auto-submit bot merged commit 2148fc0 into flutter:main Dec 12, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 12, 2022
engine-flutter-autoroll added a commit to engine-flutter-autoroll/flutter that referenced this pull request Dec 12, 2022
auto-submit bot pushed a commit to flutter/flutter that referenced this pull request Dec 12, 2022
…116920)

* d72975724 Roll Skia from 0cb546781e89 to 833bfcb2b52f (1 revision) (flutter/engine#38218)

* c7a95c510 Roll Dart SDK from 21f2997a8fc6 to 6334e84d6956 (4 revisions) (flutter/engine#38187)

* d945c155c Roll Skia from 833bfcb2b52f to bb9378b61c4f (5 revisions) (flutter/engine#38221)

* 8fe61bc32 Roll Dart SDK from 6334e84d6956 to f32c7b011906 (3 revisions) (flutter/engine#38223)

* 2148fc003 [Windows] Fix headless mode crash (flutter/engine#38173)
loic-sharma added a commit to loic-sharma/flutter-engine that referenced this pull request Dec 12, 2022
loic-sharma added a commit to loic-sharma/flutter-engine that referenced this pull request Dec 16, 2022
loic-sharma added a commit to loic-sharma/flutter-engine that referenced this pull request Jan 3, 2023
gspencergoog pushed a commit to gspencergoog/flutter that referenced this pull request Jan 19, 2023
…lutter#116920)

* d72975724 Roll Skia from 0cb546781e89 to 833bfcb2b52f (1 revision) (flutter/engine#38218)

* c7a95c510 Roll Dart SDK from 21f2997a8fc6 to 6334e84d6956 (4 revisions) (flutter/engine#38187)

* d945c155c Roll Skia from 833bfcb2b52f to bb9378b61c4f (5 revisions) (flutter/engine#38221)

* 8fe61bc32 Roll Dart SDK from 6334e84d6956 to f32c7b011906 (3 revisions) (flutter/engine#38223)

* 2148fc003 [Windows] Fix headless mode crash (flutter/engine#38173)
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
autosubmit Merge PR when tree becomes green via auto submit App platform-windows
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Access violation in flutter_windows.dll when calling FlutterEngine::Run
3 participants