Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Linux] NativeWindow creation cause crash without adl in some cases #3203

Closed
itlancer opened this issue Apr 24, 2024 · 3 comments
Closed

[Linux] NativeWindow creation cause crash without adl in some cases #3203

itlancer opened this issue Apr 24, 2024 · 3 comments
Labels

Comments

@itlancer
Copy link

Problem Description

NativeWindow creation cause crash without adl usage in some cases for some Linux devices.
I can reproduce it with making main window visible, turn it to fullscreen and launching Worker before. Sample below. Happens in 25-50% of launches.

Reproduced with AIR 50.2.4.5 with multiple different Ubuntu 22.04.1 LTS x86_64 devices with different applications.
Cannot test with AIR 50.2.5.1 because of #3195
There is no such issue when launch app via adl. Crash happens only with bundled application.
There is no such issue with Ubuntu 20.10 x86_64 devices.
There is no such issue using 51.0.0.4 (but in 5-10% cases there is another crash, see below).
There is no such issue with Windows.

Related issues:
#3166
#3195
#2523
#2548

Steps to Reproduce

Package application with code below (as bundled app, without adl!), launch on any Ubuntu 22.04.1 LTS x86_64 device and click anywhere on stage.

Application example with sources and crash logs attached.
linux_create_nativewindow_crash.zip

package {
	import flash.display.Sprite;
	import flash.events.Event;
	import flash.events.MouseEvent;
	import flash.display.NativeWindowInitOptions;
	import flash.display.NativeWindow;
	import flash.display.StageDisplayState;
	import flash.system.Worker;
	import flash.system.WorkerDomain;
	
	public class LinuxCreateNativeWindowCrash extends Sprite {
		
		public function LinuxCreateNativeWindowCrash() {
			if (Worker.current.isPrimordial) {
				addEventListener(Event.ADDED_TO_STAGE, addedToStage);
			} else {
				trace("worker");
			}
		}
		
		private function addedToStage(e:Event):void {
			removeEventListener(Event.ADDED_TO_STAGE, addedToStage);
			var window:NativeWindow = stage.nativeWindow;
			window.visible = true;
			stage.displayState = StageDisplayState.FULL_SCREEN_INTERACTIVE;
			
			var worker:Worker = WorkerDomain.current.createWorker(this.loaderInfo.bytes);
			worker.start();
			
			stage.addEventListener(MouseEvent.CLICK, click);
		}
		
		private function click(e:MouseEvent):void {
			trace("click");
			var windowOptions:NativeWindowInitOptions = new NativeWindowInitOptions();
			new NativeWindow(windowOptions);//This line cause crash
		}

	}
}

Actual Result:
With AIR 50.2.4.5 application crash in 25-50% of launches (full crash log crash_50.2.4.5.log in zip archive above):

(linux_create_nativewindow_crash:31161): GLib-CRITICAL **: 22:11:08.737: Source ID 15 was not found when attempting to remove it
Application crashed with an unhandled SIGSEGV

With AIR 51.0.0.4 application crash in 5-10% of launches just after start (without click) (full crash log crash_51.0.0.4.log in zip archive above):

(linux_create_nativewindow_crash:31254): GLib-CRITICAL **: 22:12:22.705: Source ID 15 was not found when attempting to remove it
[xcb] Unknown request in queue while dequeuing
[xcb] Most likely this is a multi-threaded client and XInitThreads has not been called
[xcb] Aborting, sorry about that.
linux_create_nativewindow_crash: ../../src/xcb_io.c:175: dequeue_pending_request: Assertion `!xcb_xlib_unknown_req_in_deq' failed.
Application crashed with an unhandled SIGABRT

Expected Result:
NativeWindow will be created (without activation) without crash.

Known Workarounds

none

@itlancer
Copy link
Author

itlancer commented May 6, 2024

@ajwfrost
With AIR 51.0.1.1 crash like was with AIR 50.2.4.5 still exists but happens only with more complex applications for Linux. I still try to find new test case for reproduction. But it definitely happens only using Worker.
Also right now I can reproduce it even with ADL.

@ajwfrost
Copy link
Collaborator

ajwfrost commented May 7, 2024

Okay so I just mentioned (separately) that we had missed the inclusion of the recent fix from 50.2.5.1 for this .. but checking again, it turns out we had made that same code update at the start of March as part of the ARM64 updates... so perhaps this is something else!

Will double-check here..

@itlancer
Copy link
Author

Fixed. Tested with latest AIR 51.0.1.4.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants