-
Notifications
You must be signed in to change notification settings - Fork 11
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
[AIR 50.2.1.1] Worker::terminate()
cause crash with ADL
#2523
Comments
Hmm.... so when I try this direct via ADL on a command line, it works fine. Will check on this... thanks |
Hi again Is this just happening with Animate? There is a request to terminate the runtime that's being received from the debugger i.e. Animate is receiving the notification that the worker has finished, and is responding by telling the application to exit. So it's not actually crashing, it's shutting down the application. I'm not sure if there's any workaround we can do here: it's not happening within a call stack that also has the worker exiting, so there's no definitive way to confirm that this request for exit isn't a valid one.. So I could perhaps just add this to the list of issues we're asking the Animate team to look at? About the only change that may help perhaps is if we make the exit here a cancelable one? i.e. change this for all situations, so that the runtime would fire off an 'exiting' event to the NativeApplication object, and you can then cancel this from the app side if you want. The debugger connection would drop though, so I'm not sure how useful this would be in the long run.. I had thought we could just prevent the 'worker terminated' event from going to the debugger, but this didn't actually help, and I can't see anything that's going from the runtime to the debugger to tell it to exit. |
Sorry, with Animate, VSCode and ADL (from console) it happens only with patched SDK file (with 4K cameras support): With release version of AIR 50.2.1.1 issue happens indeed only with Animate. Also I can see in Animate traces with AIR 50.2.1.1:
But with AIR 50.1.1.2 only one:
|
So this part:
That feels like it's the wrong way round..? Although maybe it's also dependent upon FDB. We had an earlier issue where workers didn't start/run properly when launched from Animate, (#399) and then put in a fix that went into 50.0.1.2: #399 (comment) So in 50.1.x it had the change in it to keep workers running when they are kicked off with a debugger connection, which should mean you see both traces (although perhaps there's a separate issue with this!). In 50.2 the change has gone which means you only see one line, unless you've got the updated FDB (per my initial response above where I couldn't reproduce this because I didn't have the updated FDB...) When you're trying with ADL from the command line, are you also running FDB in a separate console? And if so, what does that output as the ADL process shuts down? Just thinking, I should probably run this in a Release build here - currently I'm using a Debug build which means we also get debugger connections set up for all the built-in AS3 bootstrap code, that may be complicating things! thanks |
@ajwfrost
With released 50.2.1.1 (without patched dll) there is no issue with ADL. What do you mean "FDB in a separate console"? I didn't launch FDB directly by myself. |
Perfect, and that then matches what I'd expect to see from 50.2...
When we try this with our latest codebase using Animate, the request to shut down the player comes from FDB that Animate has kicked off. So if we're then trying to test this from ADL on the command line (rather than from Animate) we need to manually launch FDB using its command-line interface. Animate starts FDB going (using the direct java interfaces rather than the command-line) and then launches the app, and its interaction with FDB are what are causing all these issues in the first place (at least, from what we've seen of them). But if you're able to have a computer without any debugger running on it at all, and just launch your test app with ADL from a command prompt window, and click on the stage and have it close -> that implies something different is going on for you! I'm wondering whether that patched runtime with the updated camera sizes may have been built on an older codebase, what do the file properties say for it? When I try the 50.2.1.1 release, with ADL from a command line and FDB run up separately, I get:
But the app stays, running; then when I close it:
So that "Active worker has changed to worker 1" and "Set additional breakpoints as desired, and then type 'continue'" is where the earlier problem came: Animate wasn't handling that breakpoint request so the worker thread was just hanging waiting for the 'continue'. What I believe is happening currently is that Animate receives the first "UnloadSWF" message and then sends back a request to terminate the whole application. Actually, I don't see any "UnloadSWF" messages, so this is possibly the culprit -> whatever FDB is doing to detect this unload, it's passing it on to Animate but Animate interprets that as the final "unload" rather than realising it's related to a Worker. We can see then, whether this is something we can work around with a bit more hacking of FDB, but I'm also hoping to get some changes made in Animate here. thanks |
@ajwfrost With patched dll above 50.2.1.1 release with FDB and ADL launch I can observe the same logs as you described plus
So:
|
Great, thanks for the extra details there. Sounds like there are two things here then:
thanks |
I have a similar issue at my end too (on Windows but without Animate involved and it doesn't seem to only happen through ADL). I cannot manually terminate workers due to this crash. Therefore workers get accumulated in the background (I can see them running in the background in VSCode) - However I don't know if this issue has a significant negative impact in the long run. Here is a sample project that reproduces the issue: https://github.com/Adolio/Adobe-AIR-Worker-Crash |
@ajwfrost - a small ping to attract your attention to my last comment. The provided sample can easily reproduce the issue. Thanks in advance. |
Hi @Adolio - thanks for the reminder. We can reproduce this using your test project, when it's run via Visual Studio Code. But when we directly run it from ADL, it works fine. According to the event log in Windows, this isn't actually a crash .. it just looks like a "normal" (albeit code-driven) shut-down. We added a delay to the creation of the worker - but that then stopped it from being reproducible. But then we added a delay to the completion of the worker - and this still meant that the window disappears, just after a bit longer, which gives us time to check stuff (and attach a debugger). Observations:
Oddly - when we put a debug build of the runtime in here to try to see what's happening, it doesn't reproduce (i.e. with option 3 there, we still see the failure when using a release binary, but not with debug) - although the two entries disappear from "call stack", the window remains open. So I think this is likely to be some interoperability thing between the debugger - or whatever component is trying to track and update the VSCode output panes - and the runtime. I'll try to get a bit more information about the debugger traffic before adding more details back into the above-referenced BowlerHat ticket.. thanks |
So .. interestingly, as mentioned above, we are seeing different behaviour when we use a 'release' build vs a 'debug' build of the runtime. But we did manage to debug using a release build and found that the debugger was sending an "exit" request telling the runtime to terminate. I think the first thing we need to do next is to check why that was only received in a release build and not in a debug build .. so e.g. tracing out all the debugger socket traffic to see what's the difference and whether this is meant to be happening.. |
Okay I can't see any difference in the relevant messages to/from the debugger, the only changes are that in our debug build of the player, we have a lot more scripts and debug info available. But the actual user-space execution appears to be the same. For some reason the debugger is requesting the player to exit... Below are the data transfers when the worker has finished and sends the event. The "In..." operations are from the Flash Player in to the debugger, which is also where the data has
So this seems to be going okay: the "in" messages from the player give the final bits of trace from the main process (1), the debugger confirms that it had switched to the main process to display the traces, then the player says that isolate 2 (the worker) has quit... at which point the debugger is asking if we can terminate, the player sets the active isolate to 1 as that's the only one left now, and confirms that we can terminate (this is just an option i.e. capability) - and then the debugger sends an "exit" request, with that final @joshtynjala I'm wondering whether you have a custom implementation of the debugger going on within the VSCode extension, are you able to check the behaviour here? Looking at the flex-sdk FDB code, this to me looks like something has called PlayerSession.terminate(), so it does the "can you terminate" query and if that returns a true, sends the "exit" request. In that app, it seems this would only be called from the DebugCLI.java file i.e. either something throws an exception during the Alternatively @Adolio if you ever see this when using FDB, please let me know.. Plus, please let me know if you need more details! |
The vscode-swf-debug extension uses the SWF debugger from Apache Royale. I'll try to take a look at what it's doing when I have some time. |
Thanks @ajwfrost for the deep dive into it. I do confirm that the issue is happening mainly while using the vscode debugger (I didn't try FDB however). Worker termination in bundled app is working fine. |
Problem Description
Worker::terminate()
cause crash with ADL launch for AIR 50.2.1.1.Tested with latest AIR 50.2.1.1 with multiple different Windows devices with different applications using VScode and Animate.
Same problem in all cases.
There is no such issue with AIR 50.1.1.2 and below.
Also there is no such issue without ADL launch (for application bundle all fine).
Related issue (not the same): #2385
Steps to Reproduce
Launch application with code below using IDE and click anywhere on stage.
Launched
Worker
should be terminated.Application example with sources attached.
worker_terminate_crash.zip
Actual Result:
Application crash.
Expected Result:
Worker will be terminated without crash.
Known Workarounds
none
Use AIR 50.1.1.2.
The text was updated successfully, but these errors were encountered: