Hi,
I’ve got a little playground that I’ve been using to play around with Fuse for the past couple of days. I installed a version of the app on my iPhone 6 running iOS 10 (developing on OS X El Capitan). Simple app - it’s just a single view in a Navigator
with an Each iterating over results from an API call. I noticed that every now and then, when I try to open the app on my phone, it would immediately crash. The splash screen would come up for a split-second and it would crash. It would do this repeatedly (like 6, 7, times), but then on the next attempt it would open just fine. Once it opened fine, it would be fine for a while.
At first, I thought it was some bad JS running when the page was activated, so I turned that off and deployed a new version of the app. When my phone got into this situation, both the original app and the new one would crash immediately after trying to open it.
Next, I suspected maybe the fonts being loaded were causing it to crash, so I removed the fonts and deployed a third app to my phone. But for the past day or so, I can’t even get the original app to crash upon load. All three versions run just fine.
I can provide a stripped-down version of the code if that would do any good, but the API that’s called is internal only, so it wouldn’t be functioning. Instead, I captured this crash log from iOS that hopefully will be helpful.
Relevant snippet:
Exception Type: EXC_BREAKPOINT (SIGTRAP)
Exception Codes: 0x0000000000000001, 0x00000001871644f8
Termination Signal: Trace/BPT trap: 5
Termination Reason: Namespace SIGNAL, Code 0x5
Terminating Process: exc handler [0]
Triggered by Thread: 0
Application Specific Information:
BUG IN CLIENT OF LIBDISPATCH: trying to lock recursively
Two other things that might be of interest/related.
(1)
I notice that when I launch the app, there is a slight delay between the time I tap the icon and the time that the splash screen appears. Like up to 5 seconds sometimes, but very inconsistent.
(2)
When I launch the app while connected to my laptop (set up to break on exceptions), I get an exception thrown at in file Fuse.Storage.g.cpp:
// public static string Read(string filename) [static] :32
uString* ApplicationDir::Read(uString* filename)
{
if (::g::Uno::String::op_Equality(filename, NULL))
U_THROW(::g::Uno::ArgumentNullException::New6(::STRINGS[0/*"filename"*/]));
uString* filepath = ::g::Uno::IO::Path::Combine(::g::Uno::IO::Directory::GetUserDirectory(1), filename);
if (::g::Uno::IO::File::Exists(filepath))
return ::g::Uno::IO::File::ReadAllText(filepath);
else
U_THROW(::g::Uno::Exception::New2(::STRINGS[1/*"File does n...*/])); <-- EXCEPTION HERE
}
The file that it’s looking for, that doesn’t exist, is: /var/mobile/Containers/Application/[some-id]/Documents/FuseLocalStorage/
I don’t think that’s related to the crash because even when that error comes up (i.e. every time), the app resumes once I play through the breakpoint.
Again, happy to submit the full source of my app, but I’d have to modify it and the repro is not consistent anyway. The gist of the app is as follows:
fuse-playground.unoproj:
{
"RootNamespace":"",
"Packages": [
"Fuse",
"FuseJS",
"FuseCore",
"UnoCore",
"Fuse.Triggers",
"Fuse.Navigation",
"Fuse.iOS"
],
"Includes": [
"*",
"Assets/Images/anon_avatar.png:Bundle",
"scripts/queries/*.js:Bundle",
"scripts/configs/*.js:Bundle",
"bower_components/moment/moment.js:Bundle"
],
"iOS": {
"LaunchImages": {
"iPhone_Portrait_2x": "Assets/Images/splash/Default@2x~iphone.png",
"iPhone_Portrait_R4": "Assets/Images/splash/Default-568h@2x~iphone.png",
"iPhone_Portrait_R47": "Assets/Images/splash/Default-667h.png",
"iPad_Portrait_1x": "Assets/Images/splash/Default-Portrait~ipad.png",
"iPad_Portrait_2x": "Assets/Images/splash/Default-Portrait@2x~ipad.png",
"iPad_Landscape_1x": "Assets/Images/splash/Default-Landscape~ipad.png",
"iPad_Landscape_2x": "Assets/Images/splash/Default-Landscape@2x~ipad.png"
}
}
}
Main.ux:
<App>
<Router ux:Name="router" />
<Viewport Perspective="1000">
<Panel>
<Navigator DefaultTemplate="activeUsers">
<ActiveUsers ux:Template="activeUsers" router="router" />
</Navigator>
</Panel>
</Viewport>
</App>
Note: The use of Viewport
was going to my next A/B test, but I can’t get it to crash anyway. I’ll update on whether that has any bearing on the load times, though.
ActiveUsers.ux:
<Page ux:Class="ActiveUsers">
<Router ux:Dependency="router" />
<JavaScript File="ActiveUsers.js" />
<DockPanel>
<StackPanel Dock="Top" Background="#ff674c">
<StatusBarBackground Dock="Top"/>
<Fuse.iOS.StatusBarConfig Style="Light" IsVisible="True" Animation="Slide" />
<Panel>
<Text Value="Active Users" TextAlignment="Center" TextColor="#fff" FontSize="24" Margin="0,10,0,5" />
</Panel>
</StackPanel>
<ScrollView SnapMinTransform="false">
<DockPanel>
<CogWheelReload Dock="Top" /> <!-- taken straight from the pull-to-reload example -->
<StackPanel>
<Text Value="{lastUpdatedObs}" FontSize="10" Alignment="Center" Margin="5" Color="#000" />
<Each Items="{users}">
<Deferred>
<!-- another dock panel with east list item contents -->
</Deferred>
</Each>
</StackPanel>
</DockPanel>
</ScrollView>
</DockPanel>
</Page>