build failure on linux & windows with crashpad enabled
Platform
Flutter Desktop Linux
Obfuscation
Enabled
Debug Info
Enabled
Doctor
I have checked out a specific tag in the flutter repo. Thats why the following warnings appear. This has never been a problem.
[!] Flutter (Channel [user-branch], 3.32.5, on openSUSE Leap 16.0 6.12.0-160000.5-default, locale de_DE.UTF-8) [170ms]
! Flutter version 3.32.5 on channel [user-branch] at /home/robert/flutter
Currently on an unknown channel. Run `flutter channel` to switch to an official channel.
If that doesn't fix the issue, reinstall Flutter by following instructions at https://flutter.dev/setup.
! Upstream repository unknown source is not a standard remote.
Set environment variable "FLUTTER_GIT_URL" to unknown source to dismiss this error.
• Framework revision fcf2c11572 (vor 4 Monaten), 2025-06-24 11:44:07 -0700
• Engine revision dd93de6fb1
• Dart version 3.8.1
• DevTools version 2.45.1
• If those were intentional, you can disregard the above warnings; however it is recommended to use "git" directly to perform update checks and upgrades.
[!] Android toolchain - develop for Android devices (Android SDK version 36.1.0) [2,5s]
• Android SDK at /home/robert/Android/Sdk
• Platform android-36, build-tools 36.1.0
• Java binary at: /home/robert/.local/share/JetBrains/Toolbox/apps/android-studio/jbr/bin/java
This is the JDK bundled with the latest Android Studio installation on this machine.
To manually set the JDK path, use: `flutter config --jdk-dir="path/to/jdk"`.
• Java version OpenJDK Runtime Environment (build 21.0.8+-14196175-b1038.72)
! Some Android licenses not accepted. To resolve this, run: flutter doctor --android-licenses
[✓] Chrome - develop for the web [91ms]
• CHROME_EXECUTABLE = /usr/bin/chromium
[✓] Linux toolchain - develop for Linux desktop [279ms]
• clang version 19.1.7
• cmake version 3.31.7
• ninja version 1.12.1
• pkg-config version 2.2.0
• OpenGL core renderer: AMD Radeon RX 7800 XT (radeonsi, navi32, LLVM 19.1.7, DRM 3.61, 6.12.0-160000.5-default)
• OpenGL core version: 4.6 (Core Profile) Mesa 24.3.3
• OpenGL core shading language version: 4.60
• OpenGL ES renderer: AMD Radeon RX 7800 XT (radeonsi, navi32, LLVM 19.1.7, DRM 3.61, 6.12.0-160000.5-default)
• OpenGL ES version: OpenGL ES 3.2 Mesa 24.3.3
• OpenGL ES shading language version: OpenGL ES GLSL ES 3.20
• GL_EXT_framebuffer_blit: yes
• GL_EXT_texture_format_BGRA8888: yes
[✓] Android Studio (version 2025.2.1) [89ms]
• Android Studio at /home/robert/.local/share/JetBrains/Toolbox/apps/android-studio
• Flutter plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/9212-flutter
• Dart plugin can be installed from:
🔨 https://plugins.jetbrains.com/plugin/6351-dart
• Java version OpenJDK Runtime Environment (build 21.0.8+-14196175-b1038.72)
[✓] IntelliJ IDEA Ultimate Edition (version 2025.2) [88ms]
• IntelliJ at /home/robert/.local/share/JetBrains/Toolbox/apps/intellij-idea-ultimate
• Flutter plugin version 88.0.0
• Dart plugin version 252.25557.23
[✓] Connected device (2 available) [104ms]
• Linux (desktop) • linux • linux-x64 • openSUSE Leap 16.0 6.12.0-160000.5-default
• Chrome (web) • chrome • web-javascript • Chromium 141.0.7390.122 stable
[✓] Network resources [276ms]
• All expected network resources are available.
Version
9.1.0
Steps to Reproduce
- Add
sentry_flutteras a dependency - Use in code (e.g.
Sentry.captureException(..)) - Build Linux Desktop
- Error about missing JVM, JAVA_HOME, etc.
- Install open-jdk-21-dev
- Build Linux Desktop again (previous errors not shown anymore)
- Unable to build because of mentioned error
Expected Result
Building for linux desktop continues to work
Actual Result
Launching lib/main.dart on Linux in debug mode...
Building Linux application...
/usr/bin/ld: warning: crashpad_info_note.S.o: missing .note.GNU-stack section implies executable stack
/usr/bin/ld: warning: crashpad_info_note.S.o: missing .note.GNU-stack section implies executable stack
✓ Built build/linux/x64/debug/bundle/client
/home/robert/.../client/build/linux/x64/debug/bundle/client: error while loading shared libraries: libsentry.so: cannot enable executable stack as shared object requires: Permission denied
Error waiting for a debug connection: The log reader stopped unexpectedly, or never started.
Error launching application on Linux.
Are you willing to submit a PR?
None
Other projects had similar issues: https://github.com/MolecularAI/aizynthfinder/issues/194 .
When using execstack to check the executable stack flag for the library, an X is present:
$ execstack -q /home/robert/.../client/build/linux/x64/debug/bundle/lib/libsentry.so
X /home/robert/.../client/build/linux/x64/debug/bundle/lib/libsentry.so
From the man page of execstack:
-q: Query executable stack marking of binaries and shared libraries. For each file it prints either-when executable stack is not required,Xwhen executable stack is required or?when it is unknown whether the object requires or doesn't require executable stack (the marking is missing).
However, removing the executable flag does not fix the issue:
-
flutter clean -
flutter pub get -
flutter build linux --debug
/usr/bin/ld: warning: crashpad_info_note.S.o: missing .note.GNU-stack section implies executable stack
/usr/bin/ld: warning: crashpad_info_note.S.o: missing .note.GNU-stack section implies executable stack
Building Linux application...
✓ Built build/linux/x64/debug/bundle/client
-
execstack -c /home/robert/.../client/build/linux/x64/debug/bundle/lib/libsentry.so(-cremoves the flag) -
flutter run
Launching lib/main.dart on Linux in debug mode...
Building Linux application...
✓ Built build/linux/x64/debug/bundle/client
/home/robert/.../client/build/linux/x64/debug/bundle/client: error while loading shared libraries: libsentry.so: cannot enable executable stack as shared object requires: Permission denied
Error waiting for a debug connection: The log reader stopped unexpectedly, or never started.
Error launching application on Linux.
fails, because the executable stack flag is added again
However, the two errors
/usr/bin/ld: warning: crashpad_info_note.S.o: missing .note.GNU-stack section implies executable stack
/usr/bin/ld: warning: crashpad_info_note.S.o: missing .note.GNU-stack section implies executable stack
disappeared after removing the executable stack flag
cc @vaind maybe you have more info here
Not really, looks like some hardening config specific to newer setups. Might necessitate changes upstream, let's move to sentry-native
I just tried to run our application on windows and ran into issues there as well that were only happening because of the inclusion of the sentry_flutter package. I wanted to make sure I didn't skip on some setup-step thats mentioned in the docs, so I searched around a bit. In the Migration Guide for Flutter Desktop I found that native crash handling is now done with crashpad and can be disabled.
If I disable crashpad everything builds and runs just fine. These errors are only happening because of crashpad.
- linux:
SENTRY_NATIVE_BACKEND=none flutter run --debug --device-id linux - windows powershell:
$env:SENTRY_NATIVE_BACKEND="none"; flutter run --debug --device-id windows
Note that flutter run --debug --device-id linux --dart-define=SENTRY_NATIVE_BACKEND=none does not work.
These are the errors I get when trying to run our flutter app for windows with crashpad enabled (flutter run --debug --device-id windows)
Launching lib\main.dart on Windows in debug mode...
Building Windows application...
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: Der Befehl "setlocal [C:\Users\robert\development\client\build\windows\x64\INSTALL.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: "C:\Program Files\Microsoft Visual Studio\2022\Community\Common7\IDE\CommonExtensions\Microsoft\CMake\CMake\bin\cmake.exe" -DBUILD_TYPE=Debug -P cmake_install.cmake [C:\Users\robert\development\client\build\windows\x64\INSTALL.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: if %errorlevel% neq 0 goto :cmEnd [C:\Users\robert\development\client\build\windows\x64\INSTALL.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: :cmEnd [C:\Users\robert\development\client\build\windows\x64\INSTALL.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: endlocal & call :cmErrorLevel %errorlevel% & goto :cmDone [C:\Users\robert\development\client\build\windows\x64\INSTALL.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: :cmErrorLevel [C:\Users\robert\development\client\build\windows\x64\INSTALL.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: exit /b %1 [C:\Users\robert\development\client\build\windows\x64\INSTALL.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: :cmDone [C:\Users\robert\development\client\build\windows\x64\INSTALL.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: if %errorlevel% neq 0 goto :VCEnd [C:\Users\robert\development\client\build\windows\x64\INSTALL.vcxproj]
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(159,5): error MSB3073: :VCEnd" wurde mit dem Code 1 beendet. [C:\Users\robert\development\client\build\windows\x64\INSTALL.vcxproj]
Error: Build process failed.
System information from flutter doctor:
[√] Windows Version (11 Pro 64-bit, 24H2, 2009) [1.448ms]
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.3.5) [240ms]
• Visual Studio at C:\Program Files\Microsoft Visual Studio\2022\Community
• Visual Studio Community 2022 version 17.3.32922.545
• Windows 10 SDK version 10.0.19041.0
[√] Connected device (3 available) [339ms]
• Windows (desktop) • windows • windows-x64 • Microsoft Windows [Version 10.0.26100.6899]
Btw: android and web build just fine without any modifications (web is probably not sentry-native though). I can't test iOS right now
Just FYI: I am not sure if it is at the core of the Linux issue, but it certainly touches it: (upstream) crashpad has an assembly file that does not specify a GNU stack note, which will lead toolchains to mark stacks of resulting build-artifacts as executable:
https://groups.google.com/a/chromium.org/g/crashpad-dev/c/rqk3YjICT6M?pli=1 https://issues.chromium.org/issues/408656545
https://github.com/getsentry/crashpad/pull/139 adds the stack note, so if someone has insights and resources to test this in the Flutter context, this should be the first step on Linux.
The Windows issue seems unrelated, since the assembly file is only used in Linux builds.