Skip to content

Access violation in flutter_windows.dll when calling FlutterEngine::Run #116753

@fertrig

Description

@fertrig

This Windows error happens on Flutter beta version 3.7.0-1.1.pre.

When calling method FlutterEngine::Run, I get this error:

Exception thrown at 0x00007FFA8192BEA1 (flutter_windows.dll) in cherish.exe: 0xC0000005: Access violation reading location 0x0000000000000000.

Stack trace:

  flutter_windows.dll!00007ffa8192bea1()	Unknown
  flutter_windows.dll!00007ffa80a724a3()	Unknown
> cherish.exe!flutter::FlutterEngine::Run(const char * entry_point) Line 57	C++
  cherish.exe!flutter::FlutterEngine::Run() Line 46	C++
  cherish.exe!wWinMain(HINSTANCE__ * instance, HINSTANCE__ * prev, wchar_t * command_line, int show_command) Line 39	C++
  [External Code]		

Line 57 above is a call to FlutterDesktopEngineRun in flutter_windows.h.

In previous versions of Flutter, calling method FlutterEngine::Run runs the engine as expected and it doesn't generate the access violation exception.

Steps to reproduce

Using flutter beta version 3.7.0-1.1.pre:

flutter create cherish
cd cherish
flutter run -d windows

Then edit windows\runner\main.cpp with these contents:

int APIENTRY wWinMain(...) {
  ...
  window.SetQuitOnClose(true);

  flutter::FlutterEngine engine(project);  // add this line to reproduce
  engine.Run();  // add this line to reproduce

  ::MSG msg;
  ...
}

Run flutter run -d windows, the process will end and you will get an error like Error connecting to the service protocol: failed to connect to http://127.0.0.1:61313/9siaEbAyD0c=/.

Open Visual Studio solution file build\windows\cherish.sln to get the actual error. Set the cherish project as the startup project. Then hit F5 or Start Debugging. You should get the access violation exception:

Exception thrown at 0x00007FFA8192BEA1 (flutter_windows.dll) in cherish.exe: 0xC0000005: Access violation reading location 0x0000000000000000.

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work lista: desktopRunning on desktopc: crashStack traces logged to the consolec: fatal crashCrashes that terminate the processc: regressionIt was better in the past than it is nowengineflutter/engine related. See also e: labels.found in release: 3.7Found to occur in 3.7has reproducible stepsThe issue has been confirmed reproducible and is ready to work onplatform-windowsBuilding on or for Windows specificallyr: fixedIssue is closed as already fixed in a newer version

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions