iOS Question iOS 9 App release Crash

QtechLab

Active Member
Licensed User
Longtime User
GoodMorning everyone.

Today i'm writing you with the hope to find a solution to my problem:

I coded some App with B4x environment, every App works fine except the last one.

My problem comes out when i test my App in final release, It Crash randomly without any sense.
My App exchange data with a Server in some functions.

I Developed and Tested the App with a iPhone 5C with iOS 9.2

-If i use Debug mode the App works fine.
-If i use Release mode with ReleaseLogger enabled it also works fine.
-If i use Release mode with ReleaseLogger disabled (Library not included in project, as Apple wants) it crash after any operation i do with the network.


I tried to place some Try and message box but i haven't found anything relevant

I tried Also with a iOS 7.1 device. With that old iPhone the App works fine also without ReleaseLogger.

Did you ever had a problem like this one? I'm really frustrated.

Please HELP me. I must find a solution
 

QtechLab

Active Member
Licensed User
Longtime User
I use remote builder but i also have a local iMac. How can i do the procedure that you mean?
 
Upvote 0

QtechLab

Active Member
Licensed User
Longtime User
I looked at the logs list, i can't find what i'm looking for. There are listed older crash...
Is it possible that it is a BUG in iOS9? i repeat that with an iPhone 4 with iOS 7.1.2 (last possible) every function works fine, without crash.
 
Upvote 0

QtechLab

Active Member
Licensed User
Longtime User
This is what i've obtained:

B4X:
an 26 08:26:07 iPhone-di-Marcello com.apple.xpc.launchd[1] (UIKitApplication:com.centrosicurezza.myPlus[0x4647][312]) <Notice>: Service exited due to signal: Segmentation fault: 11
Jan 26 08:26:07 iPhone-di-Marcello SpringBoard[48] <Warning>: HW kbd: Failed to set (null) as keyboard focus
Jan 26 08:26:08 iPhone-di-Marcello SpringBoard[48] <Warning>: Application 'UIKitApplication:com.centrosicurezza.myPlus[0x4647]' crashed.
Jan 26 08:26:08 iPhone-di-Marcello UserEventAgent[23] <Warning>: 405538591192: id=com.centrosicurezza.myPlus pid=312, state=0
Jan 26 08:26:08 iPhone-di-Marcello ReportCrash[314] <Notice>: platform_thread_get_unique_id matched 79164
Jan 26 08:26:08 iPhone-di-Marcello ReportCrash[314] <Notice>: Formulating report for corpse[312] My Plus
Jan 26 08:26:08 iPhone-di-Marcello ReportCrash[314] <Warning>: report not saved because the limit of 25 for 109_My Plus logs has been reached.
Jan 26 08:26:08 iPhone-di-Marcello ReportCrash[314] <Error>: Notice: This report is abbreviated for syslog inclusion because it could not be saved to disk.
    Symbolication may be possible by manually cleaning up and including the Binary Image section of a full report from this same device -- good luck!
Jan 26 08:26:08 iPhone-di-Marcello ReportCrash[314] <Error>: Process:             My Plus [312]
    Path:                /private/var/mobile/Containers/Bundle/Application/1A349F92-09CB-4CD1-A562-C4ED0D64B0DA/My Plus.app/My Plus
    OS Version:          iOS 9.2 (13C75)
Jan 26 08:26:08 iPhone-di-Marcello ReportCrash[314] <Error>: Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
    Exception Subtype: KERN_INVALID_ADDRESS at 0x203d206f
    Triggered by Thread:  3
Jan 26 08:26:08 iPhone-di-Marcello ReportCrash[314] <Error>: Global Trace Buffer (reverse chronological seconds):
    10.218784    AppleJPEG                     0x000000002416a6c5 [0x14a66200] Releasing session
    13.438952    AppleJPEG                     0x0000000024169fa1 [0x14a66200] Created session
Jan 26 08:26:08 iPhone-di-Marcello ReportCrash[314] <Error>: Thread 0 name:  Dispatch queue: com.apple.main-thread
    Thread 0:
    0   libobjc.A.dylib                   0x225b06aa 0x22590000 + 132778
    1   My Plus                           0x001e0724 0xa1000 + 1308452
    2   My Plus                           0x001e65fc 0xa1000 + 1332732
    3   My Plus                           0x0017149a 0xa1000 + 853146
    4   My Plus                           0x0014e408 0xa1000 + 709640
    5   CoreFoundation                    0x22dcecc4 0x22cd5000 + 1023172
    6   CoreFoundation                    0x22cf92ac 0x22cd5000 + 148140
    7   My Plus                           0x001de60a 0xa1000 + 1299978
    8   My Plus                           0x001dde4c 0xa1000 + 1297996
    9   My Plus                           0x001e3c70 0xa1000 + 1322096
    10  My Plus                           0x001e38e6 0xa1000 + 1321190
    11  My Plus                           0x0010ef32 0xa1000 + 450354
    12  My Plus                           0x000c8532 0xa1000 + 161074
    13  My Plus                           0x001077e0 0xa1000 + 419808
    14  CoreFoundation                    0x22dcecc4 0x22cd5000 + 1023172
    15  CoreFoundation                    0x22cf92ac 0x22cd5000 + 148140
    16  My Plus                           0x001de60a 0xa1000 + 1299978
    17  My Plus                           0x001dde4c 0xa1000 + 1297996
    18  My Plus                           0x001dd966 0xa1000 + 1296742
    19  libdispatch.dylib                 0x22967dd6 0x22967000 + 3542
    20  libdispatch.dylib                 0x22967dc2 0x22967000 + 3522
    21  libdispatch.dylib                 0x2296c670 0x22967000 + 22128
    22  CoreFoundation                    0x22d8cfc4 0x22cd5000 + 753604
    23  CoreFoundation                    0x22d8b4be 0x22cd5000 + 746686
    24  CoreFoundation                    0x22cddbb8 0x22cd5000 + 35768
    25  CoreFoundation                    0x22cdd9ac 0x22cd5000 + 35244
    26  GraphicsServices                  0x23f57af8 0x23f4e000 + 39672
    27  UIKit                             0x26fc9fb4 0x26f4e000 + 507828
    28  My Plus                           0x000a8014 0xa1000 + 28692
    29  libdyld.dylib                     0x22990872 0x2298e000 + 10354
Jan 26 08:26:08 iPhone-di-Marcello ReportCrash[314] <Error>: Thread 1 name:  Dispatch queue: com.apple.libdispatch-manager
    Thread 1:
    0   libsystem_kernel.dylib            0x22a63320 0x22a4d000 + 90912
    1   libdispatch.dylib                 0x2297794e 0x22967000 + 67918
    2   libdispatch.dylib                 0x22969a2e 0x22967000 + 10798
Jan 26 08:26:08 iPhone-di-Marcello ReportCrash[314] <Error>: Thread 2:
    0   libsystem_kernel.dylib            0x22a6288c 0x22a4d000 + 88204
    1   libsystem_pthread.dylib           0x22b00e18 0x22b00000 + 3608
    2   libsystem_pthread.dylib           0x22b009fc 0x22b00000 + 2556
Jan 26 08:26:08 iPhone-di-Marcello ReportCrash[314] <Error>: Thread 3 Crashed:
    0   libobjc.A.dylib                   0x225b06d6 0x22590000 + 132822
    1   My Plus                           0x0021ec90 0xa1000 + 1563792
    2   My Plus                           0x0022a2fe 0xa1000 + 1610494
    3   Foundation                        0x235e632c 0x2350a000 + 901932
    4   libsystem_pthread.dylib           0x22b02c7e 0x22b00000 + 11390
    5   libsystem_pthread.dylib           0x22b02bf2 0x22b00000 + 11250
    6   libsystem_pthread.dylib           0x22b00a08 0x22b00000 + 2568
Jan 26 08:26:08 iPhone-di-Marcello ReportCrash[314] <Error>: Thread 3 crashed with ARM Thread State (32-bit):
        r0: 0x203d206f    r1: 0x203d206f      r2: 0x00000020      r3: 0x02d6aea0
        r4: 0xffffffff    r5: 0x15986440      r6: 0x15896990      r7: 0x40218c58
        r8: 0x14687740    r9: 0x15896990     r10: 0x00000009     r11: 0x39481700
        ip: 0x000007ff    sp: 0x40218c38      lr: 0x0021ec91      pc: 0x225b06d6
      cpsr: 0x20000030
 
Upvote 0

QtechLab

Active Member
Licensed User
Longtime User
The "#####INVIO COMANDO######## 6 #####..." is a log that is written when i send data to my server

B4X:
Jan 26 08:45:50 iPhone-di-Marcello My Plus[334] <Warning>: ################ INVIO COMANDO ############## 6 ###############
Jan 26 08:45:50 iPhone-di-Marcello My Plus[334] <Warning>: Class (b4i_linkedlist) instance released.
Jan 26 08:45:50 iPhone-di-Marcello My Plus[334] <Warning>: ################ INVIO COMANDO ############## 6 ###############
Jan 26 08:45:50 iPhone-di-Marcello My Plus[334] <Warning>: Class (b4i_linkedlist) instance released.
Jan 26 08:45:51 iPhone-di-Marcello My Plus[334] <Warning>: ################ INVIO COMANDO ############## 6 ###############
Jan 26 08:45:51 iPhone-di-Marcello My Plus[334] <Warning>: Class (b4i_linkedlist) instance released.
Jan 26 08:45:51 iPhone-di-Marcello My Plus[334] <Warning>: ################ INVIO COMANDO ############## 6 ###############
Jan 26 08:45:51 iPhone-di-Marcello My Plus[334] <Warning>: Class (b4i_linkedlist) instance released.
Jan 26 08:45:51 iPhone-di-Marcello My Plus[334] <Warning>: ################ INVIO COMANDO ############## 6 ###############
Jan 26 08:45:51 iPhone-di-Marcello My Plus[334] <Warning>: Class (b4i_linkedlist) instance released.
Jan 26 08:45:51 iPhone-di-Marcello My Plus[334] <Warning>: ################ INVIO COMANDO ############## 6 ###############
Jan 26 08:45:51 iPhone-di-Marcello My Plus[334] <Warning>: Class (b4i_linkedlist) instance released.
Jan 26 08:45:51 iPhone-di-Marcello My Plus[334] <Warning>: ################ INVIO COMANDO ############## 6 ###############
Jan 26 08:45:51 iPhone-di-Marcello My Plus[334] <Warning>: Class (b4i_linkedlist) instance released.
Jan 26 08:45:51 iPhone-di-Marcello My Plus[334] <Warning>: Scollegamento socket:    connesso = false
Jan 26 08:45:51 iPhone-di-Marcello SpringBoard[48] <Warning>: HW kbd: Failed to set (null) as keyboard focus
Jan 26 08:45:51 iPhone-di-Marcello com.apple.xpc.launchd[1] (UIKitApplication:com.centrosicurezza.myPlus[0x1f45][334]) <Notice>: Service exited due to signal: Segmentation fault: 11
Jan 26 08:45:51 iPhone-di-Marcello SpringBoard[48] <Warning>: Application 'UIKitApplication:com.centrosicurezza.myPlus[0x1f45]' crashed.
Jan 26 08:45:51 iPhone-di-Marcello UserEventAgent[23] <Warning>: 433936536366: id=com.centrosicurezza.myPlus pid=334, state=0
Jan 26 08:45:51 iPhone-di-Marcello ReportCrash[335] <Notice>: Formulating report for corpse[334] My Plus
Jan 26 08:45:51 iPhone-di-Marcello ReportCrash[335] <Notice>: platform_thread_get_unique_id matched 83235
Jan 26 08:45:51 iPhone-di-Marcello ReportCrash[335] <Warning>: report not saved because the limit of 25 for 109_My Plus logs has been reached.
Jan 26 08:45:51 iPhone-di-Marcello ReportCrash[335] <Error>: Notice: This report is abbreviated for syslog inclusion because it could not be saved to disk.
    Symbolication may be possible by manually cleaning up and including the Binary Image section of a full report from this same device -- good luck!
Jan 26 08:45:51 iPhone-di-Marcello ReportCrash[335] <Error>: Process:             My Plus [334]
    Path:                /private/var/mobile/Containers/Bundle/Application/1A349F92-09CB-4CD1-A562-C4ED0D64B0DA/My Plus.app/My Plus
    OS Version:          iOS 9.2 (13C75)
Jan 26 08:45:51 iPhone-di-Marcello ReportCrash[335] <Error>: Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
    Exception Subtype: KERN_INVALID_ADDRESS at 0x203d206f
    Triggered by Thread:  4
Jan 26 08:45:51 iPhone-di-Marcello ReportCrash[335] <Error>: Global Trace Buffer (reverse chronological seconds):
    14.122080    AppleJPEG                     0x000000002416a6c5 [0x159fc000] Releasing session
    17.584813    AppleJPEG                     0x0000000024169fa1 [0x159fc000] Created session
Jan 26 08:45:51 iPhone-di-Marcello ReportCrash[335] <Error>: Thread 0 name:  Dispatch queue: com.apple.main-thread
    Thread 0:
    0   libobjc.A.dylib                   0x225b16ac 0x22590000 + 136876
    1   My Plus                           0x0012f542 0x5f000 + 853314
    2   My Plus                           0x00080ef4 0x5f000 + 138996
    3   My Plus                           0x000c364a 0x5f000 + 411210
    4   CoreFoundation                    0x22dcecc4 0x22cd5000 + 1023172
    5   CoreFoundation                    0x22cf92ac 0x22cd5000 + 148140
    6   My Plus                           0x0019c60a 0x5f000 + 1299978
    7   My Plus                           0x0019be4c 0x5f000 + 1297996
    8   My Plus                           0x0019b966 0x5f000 + 1296742
    9   libdispatch.dylib                 0x22967dd6 0x22967000 + 3542
    10  libdispatch.dylib                 0x22967dc2 0x22967000 + 3522
    11  libdispatch.dylib                 0x2296c670 0x22967000 + 22128
    12  CoreFoundation                    0x22d8cfc4 0x22cd5000 + 753604
    13  CoreFoundation                    0x22d8b4be 0x22cd5000 + 746686
    14  CoreFoundation                    0x22cddbb8 0x22cd5000 + 35768
    15  CoreFoundation                    0x22cdd9ac 0x22cd5000 + 35244
    16  GraphicsServices                  0x23f57af8 0x23f4e000 + 39672
    17  UIKit                             0x26fc9fb4 0x26f4e000 + 507828
    18  My Plus                           0x00066014 0x5f000 + 28692
    19  libdyld.dylib                     0x22990872 0x2298e000 + 10354
Jan 26 08:45:51 iPhone-di-Marcello ReportCrash[335] <Error>: Thread 1 name:  Dispatch queue: com.apple.libdispatch-manager
    Thread 1:
    0   libsystem_kernel.dylib            0x22a63320 0x22a4d000 + 90912
    1   libdispatch.dylib                 0x2297794e 0x22967000 + 67918
    2   libdispatch.dylib                 0x22969a2e 0x22967000 + 10798
Jan 26 08:45:51 iPhone-di-Marcello ReportCrash[335] <Error>: Thread 2:
    0   libsystem_kernel.dylib            0x22a6288c 0x22a4d000 + 88204
    1   libsystem_pthread.dylib           0x22b00e18 0x22b00000 + 3608
    2   libsystem_pthread.dylib           0x22b009fc 0x22b00000 + 2556
Jan 26 08:45:51 iPhone-di-Marcello ReportCrash[335] <Error>: Thread 3:
    0   libsystem_kernel.dylib            0x22a6288c 0x22a4d000 + 88204
    1   libsystem_pthread.dylib           0x22b00e18 0x22b00000 + 3608
    2   libsystem_pthread.dylib           0x22b009fc 0x22b00000 + 2556
Jan 26 08:45:51 iPhone-di-Marcello ReportCrash[335] <Error>: Thread 4 Crashed:
    0   libobjc.A.dylib                   0x225b06d6 0x22590000 + 132822
    1   My Plus                           0x001dcc90 0x5f000 + 1563792
    2   My Plus                           0x001e82fe 0x5f000 + 1610494
    3   Foundation                        0x235e632c 0x2350a000 + 901932
    4   libsystem_pthread.dylib           0x22b02c7e 0x22b00000 + 11390
    5   libsystem_pthread.dylib           0x22b02bf2 0x22b00000 + 11250
    6   libsystem_pthread.dylib           0x22b00a08 0x22b00000 + 2568
Jan 26 08:45:51 iPhone-di-Marcello ReportCrash[335] <Error>: Thread 4 crashed with ARM Thread State (32-bit):
        r0: 0x203d206f    r1: 0x203d206f      r2: 0x00000020      r3: 0x03a95580
        r4: 0xffffffff    r5: 0x169592e0      r6: 0x16878390      r7: 0x4029ac58
        r8: 0x16871ae0    r9: 0x16878390     r10: 0x00000009     r11: 0x39481700
        ip: 0x000007ff    sp: 0x4029ac38      lr: 0x001dcc91      pc: 0x225b06d6
      cpsr: 0x20000030
 
Upvote 0

QtechLab

Active Member
Licensed User
Longtime User
The App is crashing randomly without any sense. I've inserted many LOG(...) and the App seems to crash when it wants to return back from a function to its caller

for example i see the first log(01) and not the last one (03):

B4X:
Sub MyStream_NewData(buffer() as byte)
[INDENT]...
log("01--Enter bufferProcess function")
BufferProcess(buffer)
log("03--Exit BufferProcess function")
...[/INDENT]
end sub

Sub BufferProcess(Buffer() as byte)
[INDENT]Elaborate received data...
...
log("02--Data elaborated")
'After this point the App crashes[/INDENT]
end sub
 
Upvote 0

QtechLab

Active Member
Licensed User
Longtime User
I'm sure about that.

These are the cases:

[iOS 9.2 - iPhone 5C]
-App in debug mode -> not crash
-App with iReleaseLogger included and connected to the server B4iLogger.jar -> not crash
-App with iReleaseLogger included and NOT connected to the server B4iLogger.jar -> not crash
-App with iReleaseLogger not included -> crash

[iOS 7.1.2 - iPhone 4]
-App in debug mode -> not crash
-App with iReleaseLogger included and connected to the server B4iLogger.jar -> not crash
-App with iReleaseLogger included and NOT connected to the server B4iLogger.jar -> not crash
-App with iReleaseLogger not included -> not crash
 
Upvote 0

QtechLab

Active Member
Licensed User
Longtime User
I've found this explanation about segmentation fault: 11


Service exited due to signal: Segmentation fault: 11
A segmentation vault is where your code tries to access a portion of protected memory. Generally this is caused by a bad pointer (in C language terms). For instance let's say you have a function called "doSomething" and it's memory address is 0x483949384. The variable doSomething contains that memory address and when you call doSometing() it goes to that memory address and starts executing code. But if something comes along and sticks a value like 12 in there and Lua still thinks its a function, and it tries to jump t that location. The Operating System's kernel says that's not allowed and dumps your program.
Generally I've seen this happen when you have something like a RunTime listener running in a scene and you change that scene and then remove the scene. All of a sudden that function is no longer in memory but some event is still trying to go there. I would look for any onComplete listeners that may be completing after removing something it's trying to use.
 
Upvote 0

QtechLab

Active Member
Licensed User
Longtime User
This is the complete log... I'm not able to understand a lot
 

Attachments

  • Crash MyPlus.txt
    39.9 KB · Views: 230
Upvote 0

QtechLab

Active Member
Licensed User
Longtime User
Erel, i finally solved this little problem... The App crash when i close the AsyncStream object in a Sub that is called by the AsyncStream_NewData... then the EXC_BAD_ACCESS when return to the Delegator

I've made many software that use "AsyncStream" in VB.NET and there, the "close" method just close the stream, then you can use the Dispose.. I think that is wrong place nil the object in the close method.
Little example

B4X:
Sub iStream_NewData(Buffer() as byte)
.....
.....
close_connection()
....
....

end sub


Sub close_Connection()
iStream.close
end sub
 
Upvote 0
Top