iOS Question Signal -11 error

schimanski

Well-Known Member
Licensed User
Longtime User
I wanted to update my project after a while. But now, I always get the follwing exception after starting it. I saw, that the problem seems to do something with tabstrip, which i'm using in my project. Has something changed?

B4X:
Copying updated assets files (4)
Application_Start
innerClearAll
SignalHandler 11
Error occurred on line: 358 (Main)
Signal - 11
Stack Trace: (
    "0   EIS Plan             SignalHandler + 120",
    "1   libsystem_platform.dylib            0x0000000182eacb48 _sigtramp + 36",
    "2   ???                  0x0 + 7785193872",
    "3   EIS Plan             -[b4i_main _initpages] + 2368",
    "4   CoreFoundation       <redacted> + 144",
    "5   CoreFoundation       <redacted> + 284",
    "6   EIS Plan             +[B4I runDynamicMethod:method:throwErrorIfMissing:args:] + 1624",
    "7   EIS Plan             -[B4IShell runMethod:] + 448",
    "8   EIS Plan             -[B4IShell raiseEventImpl:method:args::] + 1640",
    "9   EIS Plan             -[B4IShellBI raiseEvent:event:params:] + 1560"
)
 

schimanski

Well-Known Member
Licensed User
Longtime User
At the beginning, I add 3 pages with the following sub, but it is not possible to start the app again. The compiler shows me the error every time in another line of code:confused:
B4X:
Sub InitPages
    For i=1 To Kommandoanzahl
        Kommandopage(i).Initialize("Kommandopage" & i)
        
        Kommandopage(i).Title = KommandoKey(i)
        Kommandotabelle(i).Initialize(Me, "Table" & i, 8)
        Kommandotabelle(i).AddToParent(Kommandopage(i).RootPanel, 0, 0dip, 100%x, 80%y)
        Tabelle_erstellen(Kommandotabelle(i), Kommando(i), Kommandofolge(i))
        TabPages.Add(Kommandopage(i))
        Log(i)
    Next
    TabStrip1.SetPages(TabPages)
End Sub
 
Upvote 0

schimanski

Well-Known Member
Licensed User
Longtime User
Sometimes, the app chrashes before this value is logged. When i set the log(i) at the beginning of the for-next-loop, the value is always 1 at the beginning.

When I set more logs, I can see, that the sub Tabelle_erstellen is sometimes called 3 times and sometimes only one time. I can not detect a regularity in the exception. Each start, the exception is raised in another line...

B4X:
Sub Tabelle_erstellen(Tabelle As Table, Kom As Map, Folge As List)

    Tabelle.SetHeader(Array As String("Name", "Mo", "Di", "Mi", "Do", "Fr", "Sa", "So"))
    For i=0 To Folge.Size-1
        Dim key As String = Folge.Get(i)
        Dim w1 As Woche = Kom.Get(key)
        Tabelle.AddRow(Array As String(key, w1.Montag.Eintrag, w1.Dienstag.Eintrag, w1.Mittwoch.Eintrag, w1.Donnerstag.Eintrag, w1.Freitag.Eintrag, w1.Samstag.Eintrag, w1.Sonntag.Eintrag))
    Next

    Tabelle.EvenRowColor=Colors.Gray
    Tabelle.OddRowColor=Colors.Gray
    Tabelle.AddRow(Array As String("Vorplanung", "", "", "", "", "", "", ""))

    Tabelle.EvenRowColor=Colors.LightGray
    Tabelle.OddRowColor=Colors.LightGray
    Tabelle.AddRow(Array As String("Stärke", "", "", "", "", "", "", ""))
    Tabelle.EvenRowColor=evenColor
    Tabelle.OddRowColor=oddColor
    Tabelle.SetColumnsWidths(Array As Int(30%x, 10%x, 10%x, 10%x, 10%x, 10%x, 10%x, 10%x))

End Sub
 
Upvote 0

schimanski

Well-Known Member
Licensed User
Longtime User
Sorry for the late reply. I set the debugautoflashlogs to true, but no additionl logs....
 
Upvote 0

schimanski

Well-Known Member
Licensed User
Longtime User
I have reduce my project in this small project. The exception is raised after starting the app in debug.

Thank you for your efforts...
 

Attachments

  • Test.zip
    9.5 KB · Views: 236
Last edited:
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
I don't see how your code can work:
B4X:
Sub Eintraege_vornehmen
   For i=1 To Kommandoanzahl
       KommandWerte(i).Initialize
       Tabellen_fuellen(Kommandotabelle(i), KommandWerte(i))
   Next
End Sub

Sub Tabellen_fuellen(Tabelle As Table, Kom As Map)
   'Eintragungen vornehmen:
   For i=0 To Tabelle.GetSize-2
       Dim w1 As Woche
       w1.Initialize
       w1=Kom.Get(Tabelle.GetValue(0, i))
       Log("w1: " & w1)
       Log(Kom.Size)
       Tabelle.SetValue(1,i,CorrectNull(w1.Montag.Eintrag))
       Tabelle.SetValue(2,i,CorrectNull(w1.Dienstag.Eintrag))
       Tabelle.SetValue(3,i,CorrectNull(w1.Mittwoch.Eintrag))
       Tabelle.SetValue(4,i,CorrectNull(w1.Donnerstag.Eintrag))
       Tabelle.SetValue(5,i,CorrectNull(w1.Freitag.Eintrag))
       Tabelle.SetValue(6,i,CorrectNull(w1.Samstag.Eintrag))
       Tabelle.SetValue(7,i,CorrectNull(w1.Sonntag.Eintrag))
   Next
End Sub
Kom will be an empty map. w1 will be Null.
Accessing fields of a null object will lead to a crash.
 
Upvote 0

schimanski

Well-Known Member
Licensed User
Longtime User
Kom gets the data in the full projekt out of cloudkvs, which is not included in the project. Looks like, that you don't get the Signal 11-error after starting the app??? The exception is called with starting the app, even if Kom and w1 is null or not. In erarlier versions of the b4i-compiler, I didn't had such exception. I will try to make a test-app with a litle more code of the original....
 
Upvote 0

schimanski

Well-Known Member
Licensed User
Longtime User
Is it not possible to intercept a field with Null? The sub correctNull seems not to work and when I set each time

If w1.Montag.Eintrag=Null Then w1.Montag.Eintrag="",
If w1.Dienstag.Eintrag=Null Then w1.Dienstag.Eintrag=""
....
..

the app runs one or two times and after the third start, it crashes again..
 
Upvote 0

schimanski

Well-Known Member
Licensed User
Longtime User
I tried a lot to avoid the signal -11 error without success. But I mentioned, that it was raised after an b4i update. Now, I have downgraded b4i from 5.00 to 4.80 and the exception is no longer raised again. Perhaps, this could be an information for someone which could help me to find out the problem. If not, I think I have to rework the whole structure:confused:...
 
Upvote 0

Similar Threads

Top