flutterfire icon indicating copy to clipboard operation
flutterfire copied to clipboard

๐Ÿ› [cloud_firestore] Windows app crashes with `Unhandled exception at 0x00007FF637C02EEA in my_app.exe: 0xC000001D: Illegal Instruction`

Open sharathGowda12 opened this issue 1 year ago โ€ข 7 comments

Bug report

Describe the bug As the title says.

Steps to reproduce

Steps to reproduce the behavior:

  1. Call await FirebaseFirestore.instance.collection('anyCollection').doc('anyId').get();(where, whereIn also generate the same crash) from the example app.
  2. The app crashes with the Lost Connection to device with no error logs in the terminal. However, if you generate the .sln file (Thanks to) and run the app with the Visual Studio you could see the crash with message Unhandled exception at 0x00007FF637C02EEA in my_app.exe: 0xC000001D: Illegal Instruction.

Following is the Disassembly generated by the Visual Studio Disassembly.md

Expected behavior

App shouldn't crash

Sample project

flutterfire example project with a live firebase project details will create the same crash.


Additional context

OS - Windows 10 Pro Processor - Intel(R) Core(TM) i5-3340M CPU @ 2.70GHz, 2701 Mhz, 2 Core(s), 4 Logical Processor(s) System Model - Dell Latitude E5430 non-vPro


Flutter doctor

Run flutter doctor and paste the output below:

Click To Expand
[โˆš] Flutter (Channel stable, 3.16.9, on Microsoft Windows [Version 10.0.19045.3930], locale en-IN)
[โˆš] Windows Version (Installed version of Windows is version 10 or higher)
[X] Android toolchain - develop for Android devices
    X Unable to locate Android SDK.
      Install Android Studio from: https://developer.android.com/studio/index.html
      On first launch it will assist you in installing the Android SDK components.
      (or visit https://flutter.dev/docs/get-started/install/windows#android-setup for detailed instructions).
      If the Android SDK has been installed to a custom location, please use
      `flutter config --android-sdk` to update to that location.

[X] Chrome - develop for the web (Cannot find Chrome executable at .\Google\Chrome\Application\chrome.exe)
    ! Cannot find Chrome. Try setting CHROME_EXECUTABLE to a Chrome executable.
[โˆš] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.8.4)
[!] Android Studio (not installed)
[โˆš] VS Code (version 1.85.2)
[โˆš] Connected device (2 available)
[โˆš] Network resources

! Doctor found issues in 3 categories.

Flutter dependencies

Run flutter pub deps -- --style=compact and paste the output below:

Click To Expand
Dart SDK 3.2.6
Flutter SDK 3.16.9
cloud_firestore_example 0.0.0

dependencies:
- cloud_firestore 4.14.0 [cloud_firestore_platform_interface cloud_firestore_web collection firebase_core firebase_core_platform_interface flutter meta]      
- firebase_core 2.24.2 [firebase_core_platform_interface firebase_core_web flutter meta]
- flutter 0.0.0 [characters collection material_color_utilities meta vector_math web sky_engine]
- http 1.2.0 [async http_parser meta web]

dev dependencies:
- flutter_test 0.0.0 [flutter test_api matcher path fake_async clock stack_trace vector_math async boolean_selector characters collection material_color_utilities meta source_span stream_channel string_scanner term_glyph web]
- integration_test 0.0.0 [flutter flutter_driver flutter_test path vm_service async boolean_selector characters clock collection fake_async file matcher material_color_utilities meta source_span stack_trace stream_channel string_scanner sync_http term_glyph test_api vector_math web webdriver]

transitive dependencies:
- _flutterfire_internals 1.3.16 [collection firebase_core firebase_core_platform_interface flutter meta]
- async 2.11.0 [collection meta]
- boolean_selector 2.1.1 [source_span string_scanner]
- characters 1.3.0
- clock 1.1.1
- cloud_firestore_platform_interface 6.1.0 [_flutterfire_internals collection firebase_core flutter meta plugin_platform_interface]
- cloud_firestore_web 3.9.0 [_flutterfire_internals cloud_firestore_platform_interface collection firebase_core firebase_core_web flutter flutter_web_plugins 
js]
- collection 1.18.0
- fake_async 1.3.1 [clock collection]
- file 6.1.4 [meta path]
- firebase_core_platform_interface 5.0.0 [collection flutter flutter_test meta plugin_platform_interface]
- firebase_core_web 2.10.0 [firebase_core_platform_interface flutter flutter_web_plugins js meta]
- flutter_driver 0.0.0 [file flutter flutter_test fuchsia_remote_debug_protocol path meta vm_service webdriver async boolean_selector characters clock collection matcher material_color_utilities platform process source_span stack_trace stream_channel string_scanner sync_http term_glyph test_api vector_math web]    
- flutter_web_plugins 0.0.0 [flutter characters collection material_color_utilities meta vector_math web]
- fuchsia_remote_debug_protocol 0.0.0 [process vm_service file meta path platform]
- http_parser 4.0.2 [collection source_span string_scanner typed_data]
- js 0.6.7 [meta]
- matcher 0.12.16 [async meta stack_trace term_glyph test_api]
- material_color_utilities 0.5.0 [collection]
- meta 1.10.0
- path 1.8.3
- platform 3.1.2
- plugin_platform_interface 2.1.8 [meta]
- process 4.2.4 [file path platform]
- sky_engine 0.0.99
- source_span 1.10.0 [collection path term_glyph]
- stack_trace 1.11.1 [path]
- stream_channel 2.1.2 [async]
- string_scanner 1.2.0 [source_span]
- sync_http 0.3.1
- term_glyph 1.2.1
- test_api 0.6.1 [async boolean_selector collection meta source_span stack_trace stream_channel string_scanner term_glyph]
- typed_data 1.3.2 [collection]
- vector_math 2.1.4
- vm_service 11.10.0
- web 0.3.0
- webdriver 3.0.2 [matcher path stack_trace sync_http]

sharathGowda12 avatar Jan 30 '24 06:01 sharathGowda12

Hi @sharathGowda12, I can't seem to reproduce the crash using the plugin example app.

What actions do you perform in the app and is there any additional information that you can provide?

danagbemava-nc avatar Jan 30 '24 11:01 danagbemava-nc

Any call to cloud_firestore crashes the app.

I think, it happens only in few devices, as reported earlier here, so might not be able to reproduce in you system.

sharathGowda12 avatar Jan 30 '24 11:01 sharathGowda12

That would likely explain it. I tried several calls to firestore but it did not crash on my device.

Dell XPS 13 7390 running windows 11 home

Labeling based on the information provided above.

cc @Lyokone

danagbemava-nc avatar Jan 31 '24 10:01 danagbemava-nc

Same issue! it happens only in few devices

patricknicolosi avatar Feb 04 '24 14:02 patricknicolosi

I am also facing this issue, it is a major blocker for our team. We are building a cross-platform application, and we require firestore support for our application on windows, as most of our customer base is on windows only.

vishnuagbly avatar Feb 10 '24 19:02 vishnuagbly

I have similar issue, it worked once on old sdk version 2.18.0 but after upgrading to latest sdk, it just crashes with no errors.

ekrem-qb avatar Feb 10 '24 19:02 ekrem-qb

Same here. My Flutter windows app crashes on some devices because of firestore. Any solution or firestore version that works?

jeedy20 avatar Feb 12 '24 18:02 jeedy20

Same here. The app crashes on one customer desktop only due to firebase.

ahmed951 avatar Feb 27 '24 13:02 ahmed951

Any updates?

patricknicolosi avatar Feb 28 '24 16:02 patricknicolosi

Hello, couldn't reproduce this issue using my the example app with those:

  // Get document
  final doc = await FirebaseFirestore.instance
      .collection('firestore-example-app')
      .doc('movie')
      .get();

  print(doc.data());


// Use where in
  final querySnapshot = await FirebaseFirestore.instance
      .collection('firestore-example-app')
      .where('genre', arrayContainsAny: ['fantasy'])
      .get();

  print(querySnapshot.docs.length);

Lyokone avatar Feb 29 '24 08:02 Lyokone

Hey @sharathGowda12. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot avatar Mar 11 '24 01:03 google-oss-bot

@google-oss-bot I don't think, there is more information, I could possibly provide. This is such an issue, that happens only on a few devices (probably older PCs which support Windows 10). And it is confirmed by other commentators too.

If the Firebase team is checking it only on newer models, I don't think, there is a possibility to reproduce this bug.

sharathGowda12 avatar Mar 11 '24 03:03 sharathGowda12

Hello @sharathGowda12, if the issue is only happening on older device, it's probably due to the underlying C++ SDK, you can report the issue here with: https://github.com/firebase/firebase-cpp-sdk

Lyokone avatar Mar 11 '24 08:03 Lyokone

In my experience, the problem occurs not only in older devices. I think this problem should not be overlooked. Several users of my app in production can no longer use the program with relatively new PCs

patricknicolosi avatar Mar 13 '24 16:03 patricknicolosi

Hey @sharathGowda12. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot avatar Mar 22 '24 01:03 google-oss-bot

Hello, couldn't reproduce this issue using my the example app with those:

Hi @Lyokone, Please try with below code it is crashing on Windows 11

// Use whereNotIn
  final querySnapshot = await FirebaseFirestore.instance
      .collection('firestore-example-app')
      .where('genre', whereNotIn: ['fantasy'])
      .get();

  print(querySnapshot.docs.length);

MominRaza avatar Mar 31 '24 20:03 MominRaza

Same here, but no firebase.

rustdesk avatar Apr 01 '24 02:04 rustdesk

The issue 0xc000001d means that Flutter uses some CPU instruction from an instruction set (AVX, FMA3, SSE, MMX, ...) which the CPU does not support. The correct way is to check the supported CPU instruction sets first, before running instructions from that instruction set - or if the instruction is mandatory and critical - mark the CPU as unsupported.

This seems to be a bug in Flutter itself.

RustDesk crashes with the following CPU if Flutter 3.16.9 is used (3.10.6 worked fine): AMD Phenom(tm) II X4 955 Processor which supports the following instruction sets:

  • MMX instructions
  • Extensions to MMX
  • 3DNow! technology
  • Extensions to 3DNow!
  • SSE / Streaming SIMD Extensions
  • SSE2 / Streaming SIMD Extensions 2
  • SSE3 / Streaming SIMD Extensions 3
  • SSE4a
  • AMD64 / AMD 64-bit technology
  • AMD-V / AMD Virtualization technology

Important question to the people having the same issue here in flutterfire: Can you please post which CPUs you are having on the systems which crash? Maybe you could even find the exact instruction using WinDbg or any possibility to see a stack trace to machine code.

danielmarschall avatar Apr 01 '24 11:04 danielmarschall

I am facing this issue on a hp laptop, with i7 8th generation intel processor

On Mon, 1 Apr 2024, 4:45 pm Daniel Marschall, @.***> wrote:

The issue 0xc000001d means that Flutter uses some CPU instruction from an instruction set (AVX, FMA3, SSE, MMX, ...) which the CPU does not support. The correct way is to check the supported CPU instruction sets first, before running instructions from that instruction set - or if the instruction is mandatory and critical - mark the CPU as unsupported.

This seems to be a bug in Flutter itself.

RustDesk crashes with the following CPU if Flutter 3.16.9 is used (3.10.6 worked fine): AMD Phenom(tm) II X4 955 Processor https://www.cpu-world.com/CPUs/K10/AMD-Phenom%20II%20X4%20955%20-%20HDX955WFK4DGM.html which supports the following instruction sets:

  • MMX instructions
  • Extensions to MMX
  • 3DNow! technology
  • Extensions to 3DNow!
  • SSE / Streaming SIMD Extensions
  • SSE2 / Streaming SIMD Extensions 2
  • SSE3 / Streaming SIMD Extensions 3
  • SSE4a
  • AMD64 / AMD 64-bit technology
  • AMD-V / AMD Virtualization technology

Important question to the people having the same issue here in flutterfire: Can you please post which CPUs you are having on the systems which crash? Maybe you could even find the exact instruction using WinDbg or any possibility to see a stack trace to machine code.

โ€” Reply to this email directly, view it on GitHub https://github.com/firebase/flutterfire/issues/12216#issuecomment-2029601981, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMWY3GSPQL32UQDGXJRNUPTY3E6VLAVCNFSM6AAAAABCQVW7Y6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRZGYYDCOJYGE . You are receiving this because you commented.Message ID: @.***>

vishnuagbly avatar Apr 01 '24 11:04 vishnuagbly

Thank you for the quick reply. Can you please send me the exact name of the CPU as shown in the Windows "system information" tool?

danielmarschall avatar Apr 01 '24 11:04 danielmarschall

I currently do not have the laptop in my possession, but here is the exact model: HP Pavilion x360 Convertible Laptop PC 14-dh0045tx

On Mon, 1 Apr 2024 at 17:14, Daniel Marschall @.***> wrote:

Thank you for the quick reply. Can you please send me the exact name of the CPU as shown in the Windows "system information" tool?

โ€” Reply to this email directly, view it on GitHub https://github.com/firebase/flutterfire/issues/12216#issuecomment-2029633292, or unsubscribe https://github.com/notifications/unsubscribe-auth/AMWY3GQ5IX4UCEWBW42WFJDY3FCCJAVCNFSM6AAAAABCQVW7Y6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMRZGYZTGMRZGI . You are receiving this because you commented.Message ID: @.***>

vishnuagbly avatar Apr 01 '24 16:04 vishnuagbly

Ok, in this case, the CPU seems to be "Intelยฎ Coreโ„ข i7 8565U" which DOES supports SSE 4.1 .

There is a very recently discovered bug in Flutter/Dart which causes Flutter to crash on old CPUs which DO NOT support SSE 4.1 . Although your CPU is newer (so you might not be affected by this bug), you might still want to try the new Flutter version once you have the ability.

danielmarschall avatar Apr 02 '24 20:04 danielmarschall

Hey @sharathGowda12. We need more information to resolve this issue but there hasn't been an update in 7 weekdays. I'm marking the issue as stale and if there are no new updates in the next 7 days I will close it automatically.

If you have more information that will help us get to the bottom of this, just add a comment!

google-oss-bot avatar Apr 11 '24 01:04 google-oss-bot

Since there haven't been any recent updates here, I am going to close this issue.

@sharathGowda12 if you're still experiencing this problem and want to continue the discussion just leave a comment here and we are happy to re-open this.

google-oss-bot avatar Apr 22 '24 01:04 google-oss-bot

This bug seems to happen only on debug mode, I have my app crash right after access a firebase document, but when i release the app to store and run it on the same device, the bug no longer happens.

tranhuudang avatar Apr 30 '24 07:04 tranhuudang

Same issue Windows 10 CPU i7-3740QM bug in debug and release mode. SDK 3.3.4

Nimo11 avatar May 01 '24 06:05 Nimo11

@tranhuudang @Nimo11, this issue is closed. Please open new issues or upvote (by adding a ๐Ÿ‘) on issue #12707 if it matches your problem.

TarekkMA avatar May 02 '24 07:05 TarekkMA