MvvmCross Could not find a Setup class for application - xamarin.forms

I have an Xamarin Forms Android Application with MvvmCross and I see several of these exceptions in my insights.
When the app starts from scratch everything works fine. As far as I can tell this error happens, wenn the app is moved to hibernation and is started again.
I have a SplashScreenActivity which defines the Setup class as follows:
MvxFormsSplashScreenActivity<ApplicationSetup, CoreApp, App>
In case it helps, the Project is open source and the code lies here: https://github.com/MoneyFox/MoneyFox
How can I fix that?
Error:
Package: com.applysolutions.moneyfox
Version Code: 2019099001
Version Name: 5.1.2019099.001
Android: 9
Android Build: PQ2A.190405.003
Manufacturer: Google
Model: Pixel 3
CrashReporter Key: c69e70df-a610-4112-be05-e3869f130474
Date: undefined
Xamarin Exception Stack:
MvvmCross.Exceptions.MvxException: Failed to create setup instance
at MvvmCross.Core.MvxSetupSingleton.CreateSetup () [0x00017] in <5379a95ac98a4680b7bb47f5b716a158>:0
at MvvmCross.Core.MvxSetupSingleton.EnsureSingletonAvailable[TMvxSetupSingleton] () [0x00045] in <5379a95ac98a4680b7bb47f5b716a158>:0
at MvvmCross.Platforms.Android.Core.MvxAndroidSetupSingleton.EnsureSingletonAvailable (Android.Content.Context applicationContext) [0x00000] in <5379a95ac98a4680b7bb47f5b716a158>:0
at MvvmCross.Forms.Platforms.Android.Views.MvxFormsAppCompatActivity.OnCreate (Android.OS.Bundle bundle) [0x00006] in <4ea0c9ab37e14fd8aa188ddf8fa8736e>:0
at MoneyFox.Droid.MainActivity.OnCreate (Android.OS.Bundle bundle) [0x00052] in <2cfc40e7b7be4d839b84f168044b373f>:0
at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_savedInstanceState) [0x00011] in <8ac02975c09144d5ae9c10aecc6be0c2>:0
at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.9(intptr,intptr,intptr)
--- End of inner exception stack trace ---
MvvmCross.Exceptions.MvxException: Could not find a Setup class for application
at MvvmCross.Core.MvxSetupExtensions.CreateSetup[TSetup] () [0x00019] in <5379a95ac98a4680b7bb47f5b716a158>:0
at MvvmCross.Core.MvxSetup.Instance () [0x00015] in <5379a95ac98a4680b7bb47f5b716a158>:0
at MvvmCross.Core.MvxSetupSingleton.CreateSetup () [0x00000] in <5379a95ac98a4680b7bb47f5b716a158>:0
Thread 2:
0 dalvik.system.VMStack.getThreadStackTrace(VMStack.java:-2)
1 java.lang.Thread.getStackTrace(Thread.java:1538)
2 java.lang.Thread.getAllStackTraces(Thread.java:1588)
3 com.microsoft.appcenter.crashes.Crashes.saveUncaughtException(Crashes.java:943)
4 com.microsoft.appcenter.crashes.WrapperSdkExceptionManager.saveWrapperException(WrapperSdkExceptionManager.java:50)
5 md5a0013181b845adff0c8407b475a96272.MainActivity.n_onCreate(MainActivity.java:-2)
6 md5a0013181b845adff0c8407b475a96272.MainActivity.onCreate(MainActivity.java:30)
7 android.app.Activity.performCreate(Activity.java:7144)
8 android.app.Activity.performCreate(Activity.java:7135)
9 android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1271)
10 android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2931)
11 android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3086)
12 android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
13 android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
14 android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
15 android.app.ActivityThread$H.handleMessage(ActivityThread.java:1816)
16 android.os.Handler.dispatchMessage(Handler.java:106)
17 android.os.Looper.loop(Looper.java:193)
18 android.app.ActivityThread.main(ActivityThread.java:6718)
19 java.lang.reflect.Method.invoke(Method.java:-2)
20 com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
21 com.android.internal.os.ZygoteInit.main(ZygoteInit.java:858)
Thread 6698:
0 java.lang.Object.wait(Object.java:-2)
1 java.lang.Daemons$ReferenceQueueDaemon.runInternal(Daemons.java:178)
2 java.lang.Daemons$Daemon.run(Daemons.java:103)
3 java.lang.Thread.run(Thread.java:764)
Thread 6699:
0 java.lang.Object.wait(Object.java:-2)
1 java.lang.Object.wait(Object.java:422)
2 java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:188)
3 java.lang.ref.ReferenceQueue.remove(ReferenceQueue.java:209)
4 java.lang.Daemons$FinalizerDaemon.runInternal(Daemons.java:232)
5 java.lang.Daemons$Daemon.run(Daemons.java:103)
6 java.lang.Thread.run(Thread.java:764)
Thread 6700:
0 java.lang.Thread.sleep(Thread.java:-2)
1 java.lang.Thread.sleep(Thread.java:373)
2 java.lang.Thread.sleep(Thread.java:314)
3 java.lang.Daemons$FinalizerWatchdogDaemon.sleepFor(Daemons.java:342)
4 java.lang.Daemons$FinalizerWatchdogDaemon.waitForFinalization(Daemons.java:364)
5 java.lang.Daemons$FinalizerWatchdogDaemon.runInternal(Daemons.java:281)
6 java.lang.Daemons$Daemon.run(Daemons.java:103)
7 java.lang.Thread.run(Thread.java:764)
Thread 6707:
0 android.os.MessageQueue.nativePollOnce(MessageQueue.java:-2)
1 android.os.MessageQueue.next(MessageQueue.java:326)
2 android.os.Looper.loop(Looper.java:160)
3 android.os.HandlerThread.run(HandlerThread.java:65)
Thread 6709:
0 android.os.MessageQueue.nativePollOnce(MessageQueue.java:-2)
1 android.os.MessageQueue.next(MessageQueue.java:326)
2 android.os.Looper.loop(Looper.java:160)
3 android.os.HandlerThread.run(HandlerThread.java:65)
Thread 6710:
0 android.os.MessageQueue.nativePollOnce(MessageQueue.java:-2)
1 android.os.MessageQueue.next(MessageQueue.java:326)
2 android.os.Looper.loop(Looper.java:160)
3 android.os.HandlerThread.run(HandlerThread.java:65)
EDIT: I tried if it behaves differently, when I deactivate linking. But that didn't have an effect.

Related

Deadlock in Berkeley DB?

I'm using berkeley db to store 100 milion keys and theirs values. There is one instance of berkeley db on the server. One writer adds and removes records and five readers (five independent applications) read proper values.
Sometimes one of my readers stucks and I have to kill it and run it again. I attached to it using gdb:
[Switching to LWP 100674 of process 54232]
0x0000000000886771 in __lock_ohash ()
(gdb) where
#0 0x0000000000886771 in __lock_ohash ()
#1 0x000000000087a1c4 in __lock_get_internal ()
#2 0x00000000008793d4 in __lock_vec ()
#3 0x000000000078e094 in __db_lget ()
#4 0x00000000007ff26d in __bam_search ()
#5 0x00000000007f07f6 in __bamc_search ()
#6 0x00000000007edb13 in __bamc_get ()
#7 0x0000000000783091 in __dbc_iget ()
#8 0x000000000078b793 in __dbc_get_pp ()
#9 0x0000000000762a5a in Dbc::get(Dbt*, Dbt*, unsigned int) ()
...
Why does it stuck in __lock_ohash() function? When it stucks the whole application freezes until I kill it. Is it a deadlock? Why database does not manage and solve it?
Version of berkeley db: 18.1.40
Flags used by writer and readers:
uint32_t flags = DB_INIT_LOCK | DB_INIT_MPOOL | DB_SYSTEM_MEM | DB_INIT_TXN |
DB_CREATE | DB_REGISTER;
OS: FreeBSD 13.0-RELEASE-p6
Shared memory info:
[adg#ovhs8 ~]$ ipcs -M
shminfo:
shmmax: 4294967296 (max shared memory segment size)
shmmin: 1 (min shared memory segment size)
shmmni: 192 (max number of shared memory identifiers)
shmseg: 128 (max shared memory segments per process)
shmall: 1048576 (max amount of shared memory in pages)
Database size - 4,6 GB:
[adg#ovhs8 ~/adg_db/Database/database]$ ls -ltrh
total 3349522
-rw-r----- 1 adg adg 10M Mar 13 23:11 log.0000000001
-rw-r----- 1 adg adg 4.6G Mar 14 09:26 adgdatabase.db
-rw-r----- 1 adg adg 24B Mar 14 09:29 __db.001
-rw-r----- 1 adg adg 200B Mar 14 09:30 __db.register

Xamarin.Forms - iOS app crash after start

I have xamarin forms application. On Android is everything OK. On iOS is possible to run app only if I use visual studio to deploy application to iPhone or when I use simulator. When I use TestFlight service then app crash on startup. Apple automation test fails too.
Part of crah log is here and full crash log is under this:
Exception Type: EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
Triggered by Thread: 0
Thread 0 name:
Thread 0 Crashed:
0 libsystem_kernel.dylib 0x000000019aec6d88 __pthread_kill + 8
1 libsystem_pthread.dylib 0x000000019addf1e8 pthread_kill$VARIANT$mp + 136 (pthread.c:1458)
2 libsystem_c.dylib 0x000000019ad329b0 __abort + 112 (abort.c:147)
3 libsystem_c.dylib 0x000000019ad32940 abort + 112 (abort.c:118)
4 Zaruky.iOS 0x0000000101d9ee64 xamarin_printf + 25177700 (runtime.m:2472)
5 Zaruky.iOS 0x0000000101c6475c mono_invoke_unhandled_exception_hook + 23889756 (exception.c:1299)
6 Zaruky.iOS 0x0000000101bf95bc mono_handle_exception_internal + 23451068 (mini-exceptions.c:2783)
7 Zaruky.iOS 0x0000000101bf9fb0 mono_resume_unwind + 23453616 (mini-exceptions.c:3532)
8 Zaruky.iOS 0x0000000101bededc mono_arm_resume_unwind + 23404252 (exceptions-arm64.c:421)
9 Zaruky.iOS 0x00000001006f5b38 llvm_resume_unwind_trampoline + 168
10 Zaruky.iOS 0x00000001015762ec Xamarin_iOS_UIKit_UIApplication_Main_string___intptr_intptr + 16622316 (UIApplication.cs:0)
11 Zaruky.iOS 0x0000000101c0b1bc mono_jit_runtime_invoke + 23523772 (mini-runtime.c:3165)
12 Zaruky.iOS 0x0000000101cc6870 mono_runtime_invoke_checked + 24291440 (object.c:3220)
13 Zaruky.iOS 0x0000000101cccac8 mono_runtime_exec_main_checked + 24316616 (object.c:5284)
14 Zaruky.iOS 0x0000000101be9774 mono_jit_exec + 23385972 (driver.c:1328)
15 Zaruky.iOS 0x0000000101da6900 xamarin_main + 25209088 (monotouch-main.m:0)
16 Zaruky.iOS 0x0000000100607e4c main + 441932 (main.m:166)
17 libdyld.dylib 0x000000019aed18f0 start + 4
I found some errors with Device log in visual studio:
Visual studio - device log
Full apple crash log
I had to create new project and move all code to this new project. Now is everything OK. But I don't know where the mistake was.

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory error for node application

<--- Last few GCs --->
[19250:0x28db090] 338316 ms: Mark-sweep 1358.4 (1530.4) -> 1357.6 (1530.4) MB, 4703.7 / 0.0 ms allocation failure GC in old space requested
[19250:0x28db090] 340800 ms: Mark-sweep 1357.6 (1530.4) -> 1357.5 (1462.9) MB, 2483.3 / 0.0 ms last resort GC in old space requested
[19250:0x28db090] 343628 ms: Mark-sweep 1357.5 (1462.9) -> 1357.5 (1447.9) MB, 2827.1 / 0.0 ms last resort GC in old space requested
<--- JS stacktrace --->
==== JS stack trace =========================================
Security context: 0x18172b0a58b9 <JSObject>
2: _assign(aka _assign) [/home/rapidgenomics/Apps/LIMS/mean/node_modules/mongoose/lib/model.js:4183] [bytecode=0x3229ad46f471 offset=708](this=0x174d0f5822d1 <undefined>,err=0x174d0f582201 <null>,vals=0x145e731935b9 <JSArray[21554]>,mod=0xcc5d9aefff9 <Object map = 0x140aa8af76e1>,assignmentOpts=0x380059b28211 <Object map = 0x140aa8afc2d9>)
3: next(aka next) [/home/rapidgenomics/Apps/LIMS...
FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - JavaScript heap out of memory
1: node::Abort() [/usr/bin/node]
2: 0x8ccf9c [/usr/bin/node]
3: v8::Utils::ReportOOMFailure(char const*, bool) [/usr/bin/node]
4: v8::internal::V8::FatalProcessOutOfMemory(char const*, bool) [/usr/bin/node]
5: v8::internal::Factory::NewFixedArray(int, v8::internal::PretenureFlag) [/usr/bin/node]
6: v8::internal::HashTable<v8::internal::NameDictionary, v8::internal::NameDictionaryShape>::New(v8::internal::Isolate*, int, v8::internal::PretenureFlag, v8::internal::MinimumCapacity) [/usr/bin/node]
7: v8::internal::HashTable<v8::internal::NameDictionary, v8::internal::NameDictionaryShape>::EnsureCapacity(v8::internal::Handle<v8::internal::NameDictionary>, int, v8::internal::PretenureFlag) [/usr/bin/node]
8: v8::internal::BaseNameDictionary<v8::internal::NameDictionary, v8::internal::NameDictionaryShape>::EnsureCapacity(v8::internal::Handle<v8::internal::NameDictionary>, int) [/usr/bin/node]
9: v8::internal::BaseNameDictionary<v8::internal::NameDictionary, v8::internal::NameDictionaryShape>::Add(v8::internal::Handle<v8::internal::NameDictionary>, v8::internal::Handle<v8::internal::Name>, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyDetails, int*) [/usr/bin/node]
10: v8::internal::LookupIterator::ApplyTransitionToDataProperty(v8::internal::Handle<v8::internal::JSObject>) [/usr/bin/node]
11: v8::internal::Object::AddDataProperty(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::internal::PropertyAttributes, v8::internal::Object::ShouldThrow, v8::internal::Object::StoreFromKeyed) [/usr/bin/node]
12: v8::internal::Object::SetProperty(v8::internal::LookupIterator*, v8::internal::Handle<v8::internal::Object>, v8::internal::LanguageMode, v8::internal::Object::StoreFromKeyed) [/usr/bin/node]
13: v8::internal::Runtime_SetProperty(int, v8::internal::Object**, v8::internal::Isolate*) [/usr/bin/node]
14: 0x19a0ec2042fd
The error keep happening for a specific page loading, and even after I increased memory by using node --max_old_space_size=4096 server.js or increase-memory-limit command in the root directory of the project, it still fails in production.
The same solution works in my local dev environment.
How can I fix it?

Application crash: QAcessibleInterface and segmentation fault

I have this application bundled on Os X 10.11 El Capitan with Qt 5.5, and runs justfine on the development machine. It also works on Os X Yosemite 10.10.5. The app crashes on all other machines that have Os X 10.11 El Capitan. Here is part of the Error log:
System Integrity Protection: enabled
Crashed Thread: 0 Dispatch queue: com.apple.main-thread
Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Note: EXC_CORPSE_NOTIFY
VM Regions Near 0:
-->
__TEXT 000000010acca000-000000010b06b000 [ 3716K] r-x/rwx SM=COW /Volumes/VOLUME/WaveAnalyser.app/Contents/MacOS/WaveAnalyser
Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0 QtGui 0x000000010b83bc9a QAccessible::uniqueId(QAccessibleInterface*) + 106
1 libqcocoa.dylib 0x000000010e73b961 QCocoaAccessibility::notifyAccessibilityUpdate(QAccessibleEvent*) + 17
2 QtWidgets 0x000000010b3dac5f QAbstractItemViewPrivate::_q_rowsInserted(QModelIndex const&, int, int) + 127
3 QtWidgets 0x000000010b3dce36 QAbstractItemView::qt_static_metacall(QObject*, QMetaObject::Call, int, void**) + 1510
4 QtCore 0x000000010bf0ac26 QMetaObject::activate(QObject*, int, int, void**) + 2550
5 QtCore 0x000000010bf80d2e QAbstractItemModel::rowsInserted(QModelIndex const&, int, int, QAbstractItemModel::QPrivateSignal) + 78
6 QtCore 0x000000010be8eea0 QAbstractItemModel::endInsertRows() + 80
7 QtGui 0x000000010baffb07 QStandardItemModelPrivate::rowsInserted(QStandardItem*, int, int) + 151
8 QtGui 0x000000010baffec6 QStandardItemPrivate::insertRows(int, int, QList<QStandardItem*> const&) + 934
9 QtGui 0x000000010bb0351b QStandardItemModel::appendRow(QList<QStandardItem*> const&) + 75
The problem shows up when I press the pushbutton that closes the QMainWindow. I can provide complete log to track down the problem.

fpc Pascal Runtime error 216 before execution ends

I was implementing adjacency list in Pascal (by first reading edge end points, and then using dynamic arrays to assign required amount of memory to edgelist of each node). The program executes fine, gives correct outputs but gives runtime error 216 just before exiting.
The code is :
type aptr = array of longint;
var edgebuf:array[1..200000,1..2] of longint;
ptrs:array[1..100000] of longint;
i,j,n,m:longint;
elist:array[1..100000] of aptr;
{main}
begin
readln(n,m);
fillchar(ptrs,sizeof(ptrs),#0);
for i:=1 to m do begin
readln(edgebuf[i][1],edgebuf[i][2]);
inc(ptrs[edgebuf[i][1]]);
end;
for i:=1 to n do begin
setlength(elist[i],ptrs[i]);
end;
fillchar(ptrs,sizeof(ptrs),#0);
for i:=1 to m do begin
inc(ptrs[edgebuf[i][1]]);
elist[edgebuf[i][1]][ptrs[edgebuf[i][1]]]:=edgebuf[i][2];
end;
for i:=1 to n do begin
writeln(i,' begins');
for j:=1 to ptrs[i] do begin
write(j,' ',elist[i][j],' ');
end;
writeln();
writeln(i,' ends');
end;
writeln('bye');
end.
When run on file
4 5
1 2
3 2
4 3
2 1
2 3
gives output:
1 begins
1 2
1 ends
2 begins
1 1 2 3
2 ends
3 begins
1 2
3 ends
4 begins
1 3
4 ends
bye
Runtime error 216 at $0000000000416644
$0000000000416644
$00000000004138FB
$0000000000413740
$0000000000400645
$00000000004145D2
$0000000000400180
Once the program says "bye", what is the program executing that is giving runtime error 216?
RTE 216 is in general fatal exceptions. GPF/SIGSEGV and in some cases SIGILL/SIGBUS, and that probably means that your program corrupts memory somewhere.
Compile with runtime checks on might help you find errors (Free Pascal : -Criot )

Resources