Copy link to clipboard
Copied
Consistently happens on AIR 32 (tried also 27 and 31), iOS 12 and 8.
A video of this happening on both iOS8 and iOS12: airiosbug.mp4 - Google Drive
Just create a NetConnection and a NetStream.
If class has a variable referncing the NetStream, if app is brought to background and then to foreground, it crashes immediately.
If NetStrean is not referenced, app doesn't crash.
Crash log infact reports a null pointer.
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000000
Note that app works perfectly and for a long time if not brought to background and back to foreground again. Crashes only when brought back to foreground.
You can download source code here: https://drive.google.com/open?id=1s92-Wv99dechTZgqRxNMpf-C1SabxBNh
Here is the only code:
Commenting: "_ns = ns;" application does not crash.
package
{
import flash.display.MovieClip;
import flash.net.NetConnection;
import flash.net.NetStream;
import flash.text.TextField;
/**
* ...
* @author Pippo Gregoretti
*/
public class MainAppDebug extends MovieClip
{
private var _tf:TextField;
private var _ns:NetStream;
public function MainAppDebug()
{
super();
trace("Debugging AIR application.");
//(_debugConsole as DebugConsole).show();
_tf = new TextField();
_tf.border = true;
_tf.width = stage.stageWidth;
_tf.height = stage.stageHeight;
_tf.multiline = true;
addChild(_tf);
addText("Debugging AIR Application");
addText("Creating NetStreams...");
var nc:NetConnection = new NetConnection();
nc.connect(null);
var ns:NetStream = new NetStream(nc);
/* THIS IS THE CULPRIT. COMMENT "_ns = ns" AND APP WILL NOT CRASH */
_ns = ns;
}
private function addText(t:String):void {
_tf.appendText(t + "\n");
}
}
}
Hello All,
We have done a AIR beta today, you can download it from Adobe AIR 32 Beta | application development - Adobe Labswhich contains the fix for this issue.
Regards,
Rohit
Copy link to clipboard
Copied
Here is the app descriptor:
<id>obscured</id>
<versionNumber>0.4</versionNumber>
<filename>AppName</filename>
<description/>
<name>AppName</name>
<copyright/>
<initialWindow>
<content>AppName.swf</content>
<systemChrome>standard</systemChrome>
<transparent>false</transparent>
<visible>true</visible>
<fullScreen>true</fullScreen>
<renderMode>direct</renderMode>
<maximizable>true</maximizable>
<minimizable>true</minimizable>
<resizable>true</resizable>
<autoOrients>true</autoOrients>
<depthAndStencil>true</depthAndStencil>
<aspectRatio>landscape</aspectRatio></initialWindow>
<icon/>
<customUpdateUI>false</customUpdateUI>
<allowBrowserInvocation>false</allowBrowserInvocation>
<supportedProfiles>desktop extendedDesktop mobileDevice extendedMobileDevice </supportedProfiles>
<iPhone>
<InfoAdditions><![CDATA[
<key>UIDeviceFamily</key>
<array>
<string>1</string>
<string>2</string>
</array>
]]></InfoAdditions>
<requestedDisplayResolution>high</requestedDisplayResolution>
</iPhone>
<supportedLanguages>en</supportedLanguages>
</application>
Copy link to clipboard
Copied
Hi,
Thank you for reporting the issueL The .libs and .src folders referenced by your application are missing in the above shared link. Please file a bug on Tracker​ and attach the complete source code for us to better understand the issue.
Thanks!
Copy link to clipboard
Copied
Hello Amrita,
Don't worry about libs and src, they are empty.
Just remove the references. Thank you.
Please check this issue since it makes Netstream unusable on Ios.
Regards
Copy link to clipboard
Copied
Dear Amrita,
The bug has been filed here: Tracker
Also another tester found the same issue, exactly with the code I have posted.
Copy link to clipboard
Copied
Dear Amrita,
Here is another version of source code with the 2 folder source references removed.
Please give attention to this bug since it's vital for any iOS appication playing a video.
https://drive.google.com/open?id=1V8cFQUyhPmQMuNQ1OKkVF5dfXrpY3lhc
Thank you very much
regards
Pippo
Copy link to clipboard
Copied
Hello,
any news on this?
It would be really appreciated if you could prioritise this since makes iOS user experience suffer.
Cheers
Copy link to clipboard
Copied
1st problem:
you pass a local variable nc:NetConnection by reference to a private class variable ns:NetStream
you have to define the nc var as a class variable too
2nd problem:
you do not use events, look at the example
NetConnection - Adobe ActionScript® 3 (AS3 ) API Reference
wait for a "NetConnection.Connect.Success" before creating your NetStream
potential other problems:
you define all your code into the constructor of the class
you do not listen for "Event.ADDED_TO_STAGE" before initializing your UI
you do not listen for "UncaughtErrorEvent.UNCAUGHT_ERROR"
etc.
It would be nice if you could
1) learn to provide a correct code sample to show if there is actually a bug
what you provide above is like "made on purpose to fail"
2) do not consider Adobe support as your own personal debugging service
3) use all that as an excuse to criticize the prioritization of Adobe AIR iOS user experience
simply put if you have a bad experience it is because the code is sloppy at best
it got nothing to do with Adobe AIR
just copy/paste the default NetConnection example from the documentation pointed above
and you'll see it all work
Copy link to clipboard
Copied
Dear Zwetan,
the code posted here is super simplified in order to provide a clear example understandable at a glance.
If you prefer, I can post you the entire 800 lines of the centralized video player. Code is written in purpose to fail in order to identify a bug. If it didn't fail, how could they address it? Do not confuse Adonbe stuff, and try things out first please.
Does it seem ok to you that, on iOS only, recferencing a NetStream crashes the app if brought to background?
Do not confuse Adobe staff. This is a low level bug in iOS builds only, and should be fixed.
I assure you that:
- Initializing things after added to stage events it crashes anyway
- Listening to NetConnection connect event, it crashes anyway
- It doesn't crash on Mac, Windows and Android, but only iOS
Come on mate, I make a living deveoping high profile AS since the 90s, don't assume you are dealing with a noob. Besides you know me from other places (including your own AS3 forum). You do have a temper issue mate, this is not the first time.
Cheers mate.
And to Adobe staff, please test on your own iOS devices and you will see the bug.
Copy link to clipboard
Copied
that's not how it works
you don't submit 800 lines of code to support for them to sort out where is the bug
you, you do isolate where the bug occurs, and you make a code sample to explicitly prove that such thing is happening here
it has to be obvious
you make the code sample simple, easy to replicate, easy to compile
so support and other reviewers can easily run the code and confirm the bug
if you're unwilling to do that then don't expect anyone to look into your bug,
or expect it to be classified "for review later" or NAB ("not a bug") etc.
any amount of experience or years of programming have nothing to do with that
Copy link to clipboard
Copied
I try to follow you, but you are contradictory. There is a real nasty bug there, and I invested a lot of tim to isolate it to the bone in order not to be generic and give AIR staff the correct information without being verbose.
On your first comment you stated: "learn to provide a correct code sample to show if there is actually a bug what you provide above is like "made on purpose to fail""
Then now you say: "you do isolate where the bug occurs, and you make a code sample to explicitly prove that such thing is happening here".
So, chose either one or the other.
I am not sure where your hostility comes from, but try to be supportive, this is a real bug that affects iOS so if you think you can contribute just do it, otherwise stop wasting your and my time.
Copy link to clipboard
Copied
I meant keep thing simple, but not too simple
the code from the first post is bad, just the part where you initialize everything in the constructor
code in constructor are not compiled/optimised the same that code in methods
in general any code in AS3 is JIT'ed, but not constructor functions
those generates $cinit calls that are always interpreted
not a big deal right?
except when you compile for iOS because there the code is AOT'ed
there is nothing interpreted ever under iOS because of Apple licensing
the compiler from the AIR SDK that take all this AS3 code
compile it to bytecode then cross-compile it to native code (only for iOS)
well... it will struggle more if you put "heavy" code in the constructor
but here the problem could be more complex than that
because in your constructor you not only init the UI code (TextField, etc.)
but also network code (NetConnection)
those have async parts,
can't draw the UI if the Event.ADDED_TO_STAGE did not occurs for some reason
can't wait for the network connection if the stage is not there because it block the main event loop
etc.
declaring all that code in the constructor and not using events is just asking for trouble
maybe it is not the cause of the crash you're experiencing
but it will certainly not help to clearly see what's going on
so what are ppl supposed to do?
take the sloppy code above and rewrite it cleanly for you ?
sorry no, you should do that
same for the gdrive BS, take your code sample to something like github
make it easy for others to get the code, comment about it, etc.
things like "don't worry about .libs and .src they are empty"
no, you worry about those
the sample should compile on first go from a build
no "you should remove this or add that for it to work" kind of manual intervention
that could make it work for some ppl or not for others
the more you automate it the more it is clear it is the same state for everyone
nobody 'want to spend few hours debugging something
for later some doofus telling you "oops I was careless, I forgot to ..."
or "well.... you should have done it in this order B before A, instead of A before B ..."
that is wasting everybody's time
same for the error you are reporting
you gave only 2 lines?
where is the full log? where is the stack trace?
you may think I'm too hard on you but really I'm not
developer time is precious, the shorter and faster you can give another dev
a set of very few steps to replicate your bug the faster he/she can validate it or not
if you make it harder it is most likely gonna end up in "I don't know", "we need more infos",
"let's look at it later" limbo
Copy link to clipboard
Copied
Zwetan plese vote for the bug on tracker.
Copy link to clipboard
Copied
Dear Zwetan,
Since "developer time is precious", I am really moved by the effort you are putting in this. Thank you very much for your valuable contribution.
Just to let you know, I have been contacted by AIR staff, and they are working on a fix for this bug.
Probably your valuable effort in testing out on iOS and other platforms, and writing a better code gave then the hint they needed.
Regards
Pippo
Copy link to clipboard
Copied
Hello All,
We have done a AIR beta today, you can download it from Adobe AIR 32 Beta | application development - Adobe Labswhich contains the fix for this issue.
Regards,
Rohit
Copy link to clipboard
Copied
Thank you very much. I have tested and confirm this is fixed! You Rock!