bitsdojo_window
bitsdojo_window copied to clipboard
segfault on Linux within getAppWindowHandle
Sometimes the app segfaults on startup.
I managed to trace it to within getAppWindowHandle call.
I can also report that it does not manifest when running with GDB or when running a debug build.
AddressSanitizer reports errors too.
I have neither time nor knowledge to pursue this further. But I can provide more debug information if necessary.
An update.
While there may be noncritical leaks... This seems to be some sort of race condition.
The following code helps prevent the crash:
doWhenWindowReady(() {
const initialSize = Size(360, 720);
appWindow.minSize = initialSize;
appWindow.size = initialSize;
appWindow.alignment = Alignment.center;
sleep(Duration(milliseconds: 100)); // This buys enough time to prevent crash
appWindow.show();
});
Closed the issue too soon when testing it turns out that I built the app in debug mode.
Apparently this helps mitigate the race condition too:
runApp(MyApp(locale));
doWhenWindowReady(() {
const initialSize = Size(360, 720);
appWindow.minSize = initialSize;
appWindow.size = initialSize;
appWindow.alignment = Alignment.center;
appWindow.show();
});
sleep(Duration(milliseconds: 10));