Kodi Community Forum

Full Version: [iPhone] Non Jailbroken build only works when attached to debugger
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've successfully downloaded and built the iOS project and the app runs great from xcode. The app will not run when launched from the device however. I've not got a jailbroken device but I've been using my apple developer signing identity. I commented out this code and added my signing identity to the target.

#export CODESIGN_ALLOCATE=/Developer/Platforms/iPhoneOS.platform/Developer/usr/bin/codesign_allocate
#if [ "${PLATFORM_NAME}" == "iphoneos" ]; then
#/Developer/iphoneentitlements401/gen_entitlements.py "org.xbmc.xbmc_ios" "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${PROJECT_NAME}.xcent";
#codesign -f -s "iPhone Developer" --entitlements "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/${PROJECT_NAME}.xcent" "${BUILT_PRODUCTS_DIR}/${WRAPPER_NAME}/"
#fi

Anyone have any ideas about what I need to change in the project to get this working correctly? Am really excited to show people but can only run it attached to my computer!

When the app doesn't start it doesn't seem to be getting anywhere in the app, it almost looks like the OS is stopping it before it can start but i've got the provisioning profile setup ok as i can debug it from xcode.
I have the exact same problem. I also built it with my apple developer signing identity.

What I modified is the code signing script like you, and CFBundleIdentifier from org.xbmc.xbmc_ios to org.xbmc.xbmc-ios in xbmc/osx/ios/XBMCIOS-Info.plist.

It works well when launched from debugger, but crashes right after launched on device.
crashlogs would be nice to see.
There are no crash logs. It doesn't appear to even make it to the first line of the main method. It stops running very fast like there are missing requirements or something.
iOS 4.2.1 or 4.3 ?
Both. No change since I upgraded.
I suspect that the problem is due to XBMC's internal use of dynamic libraries:

I also tried to run XBMC on a non-jailbroken iPad by signing it with an Apple developer certificate. It works when started from Xcode. But when I try to run the app by tapping its icon, it does not seem to make it to main. This is the corresponding crash log: http://pastebin.com/AyPLauGU. Unfortunately, I didn't save the console log.

If I replace all dynamic libs with their static counterparts in the project below XBMC-IOS/External Libs, I still get a crash:
http://pastebin.com/f3SjrmDP

But on the console, it seems that XBMC starts and is killed because of trying to fork():

Apr 10 11:52:43 Schlaftablett UIKitApplication:org.xbmc.xbmcios[0x7e34][5693] <Notice>: params.c:OpenConfFile() - Unable to open configuration file "/private/var/mobile/Applications/94088F35-1CDB-47CD-9D3C-328E39C2589F/.smb/smb.conf":
Apr 10 11:52:43 Schlaftablett UIKitApplication:org.xbmc.xbmcios[0x7e34][5693] <Notice>: No such file or directory
Apr 10 11:52:43 Schlaftablett UIKitApplication:org.xbmc.xbmcios[0x7e34][5693] <Notice>: params.c:OpenConfFile() - Unable to open configuration file "/Users/Shared/xbmc-depends/ios-4.2_arm7/etc/samba/smb.conf":
Apr 10 11:52:43 Schlaftablett UIKitApplication:org.xbmc.xbmcios[0x7e34][5693] <Notice>: No such file or directory
Apr 10 11:52:44 Schlaftablett kernel[0] <Debug>: launchd[5693] Builtin profile: container (sandbox)
Apr 10 11:52:44 Schlaftablett kernel[0] <Debug>: launchd[5693] Container: /private/var/mobile/Applications/94088F35-1CDB-47CD-9D3C-328E39C2589F [69] (sandbox)
Apr 10 11:52:44 Schlaftablett sandboxd[5694] <Notice>: XBMC(5693) deny process-fork
Apr 10 11:52:44 Schlaftablett sandboxd[5694] <Notice>: XBMC(5693) deny process-fork
Apr 10 11:52:44 Schlaftablett ReportCrash[5695] <Notice>: Formulating crash report for process XBMC[5693]
Apr 10 11:52:44 Schlaftablett com.apple.launchd[1] (UIKitApplication:org.xbmc.xbmcios[0x7e34][5693]) <Warning>: (UIKitApplication:org.xbmc.xbmcios[0x7e34]) Job appears to have crashed: Bus error: 10
Apr 10 11:52:44 Schlaftablett SpringBoard[30] <Warning>: Application 'XBMC' exited abnormally with signal 10: Bus error: 10
Apr 10 11:52:44 Schlaftablett ReportCrash[5695] <Error>: Saved crashreport to /var/mobile/Library/Logs/CrashReporter/XBMC_2011-04-10-115244_Schlaftablett.plist using uid: 0 gid: 0, synthetic_euid: 501 egid: 0
Has anyone figured this out yet? I'm having this exact same issue.
when you run under xcode, you are in xcode's sandbox. when run as an app. then you are in a real sandbox. You need to setup a xbmc with proper sandbox profile and allow those things it needs.
Interesting how you appear to have the same basic issue that I have with building and running from Xcode:

http://forum.xbmc.org/showthread.php?tid=99812

but my crashes are SIGKILLs (signal 9) and yours are bus errors (signal 10).
So I'm wondering if any progress has been made on this since I saw in a thread somewhere that davilla got hardware acceleration working on 4.3

Here's my console log - hoping someone could make heads or tails of it and hopefully see something here that can lead to a solution:

Code:
May 25 15:02:24 unknown ReportCrash[290] <Notice>: Formulating crash report for process XBMC[289]
May 25 15:02:24 unknown ReportCrash[290] <Notice>: Formulating crash report for process XBMC[289]
May 25 15:02:24 unknown com.apple.launchd[1] <Notice>: (UIKitApplication:my.identifier.mediaplayer[0x40dc]) Exited: Killed: 9
May 25 15:02:24 unknown com.apple.launchd[1] <Warning>: (UIKitApplication:my.identifier.mediaplayer[0x40dc]) Throttling respawn: Will start in 2147483647 seconds
May 25 15:02:24 unknown SpringBoard[29] <Warning>: Application 'XBMC' exited abnormally with signal 9: Killed: 9
May 25 15:02:24 unknown ReportCrash[290] <Error>: Saved crashreport to /var/mobile/Library/Logs/CrashReporter/XBMC_2011-05-25-150224_iPad.plist using uid: 0 gid: 0, synthetic_euid: 501 egid: 0
May 25 15:02:24 unknown ReportCrash[290] <Error>: Saved crashreport to /var/mobile/Library/Logs/CrashReporter/XBMC_2011-05-25-150224_iPad.plist using uid: 0 gid: 0, synthetic_euid: 501 egid: 0
May 25 15:02:25 unknown kernel[0] <Debug>: launchd[289] Builtin profile: container (sandbox)
May 25 15:02:25 unknown kernel[0] <Debug>: launchd[289] Container: /private/var/mobile/Applications/C29C8C81-1C9F-4863-A44E-7EF274F73102 [69] (sandbox)

and my crash log:

Code:
Incident Identifier: 606D7F87-BB03-4BE8-93CF-0B6A4FAAE4AA
CrashReporter Key:   6c2c3898ffa732cc24c1992180e514ed4bc39807
Hardware Model:      iPad2,1
Process:         XBMC [289]
Path:            /var/mobile/Applications/C29C8C81-1C9F-4863-A44E-7EF274F73102/XBMC.app/XBMC
Identifier:      XBMC
Version:         ??? (???)
Code Type:       ARM (Native)
Parent Process:  launchd [1]

Date/Time:       2011-05-25 15:02:24.116 -0400
OS Version:      iPhone OS 4.3.3 (8J2)
Report Version:  104

Exception Type:  EXC_CRASH (SIGKILL)
Exception Codes: 0x00000000, 0x00000000
Crashed Thread:  0

Thread 0 Crashed:
0   dyld                              0x2fe1c8a0 strcmp + 0
1   dyld                              0x2fe0ce32 ImageLoaderMachO::parseLoadCmds() + 30
2   dyld                              0x2fe1262c ImageLoaderMachOCompressed::instantiateFromFile(char const*, int, unsigned char const*, unsigned long long, unsigned long long, stat const&, unsigned int, unsigned int, linkedit_data_command const*, ImageLoader::LinkContext const&) + 228
3   dyld                              0x2fe0da14 ImageLoaderMachO::instantiateFromFile(char const*, int, unsigned char const*, unsigned long long, unsigned long long, stat const&, ImageLoader::LinkContext const&) + 348
4   dyld                              0x2fe052e8 dyld::loadPhase6(int, stat const&, char const*, dyld::LoadContext const&) + 576
5   dyld                              0x2fe053fe dyld::loadPhase5stat(char const*, dyld::LoadContext const&, stat*, int*, bool*, std::vector<char const*, std::allocator<char const*> >*) + 174
6   dyld                              0x2fe055b4 dyld::loadPhase5(char const*, char const*, dyld::LoadContext const&, std::vector<char const*, std::allocator<char const*> >*) + 232
7   dyld                              0x2fe057fe dyld::loadPhase4(char const*, char const*, dyld::LoadContext const&, std::vector<char const*, std::allocator<char const*> >*) + 302
8   dyld                              0x2fe05cce dyld::loadPhase3(char const*, char const*, dyld::LoadContext const&, std::vector<char const*, std::allocator<char const*> >*) + 494
9   dyld                              0x2fe065d0 dyld::loadPhase1(char const*, char const*, dyld::LoadContext const&, std::vector<char const*, std::allocator<char const*> >*) + 88
10  dyld                              0x2fe06798 dyld::loadPhase0(char const*, char const*, dyld::LoadContext const&, std::vector<char const*, std::allocator<char const*> >*) + 368
11  dyld                              0x2fe0688e dyld::load(char const*, dyld::LoadContext const&) + 178
12  dyld                              0x2fe071a4 dyld::libraryLocator(char const*, bool, char const*, ImageLoader::RPathChain const*) + 52
13  dyld                              0x2fe0b980 ImageLoader::recursiveLoadLibraries(ImageLoader::LinkContext const&, bool, ImageLoader::RPathChain const&) + 1524
14  dyld                              0x2fe0ba2a ImageLoader::link(ImageLoader::LinkContext const&, bool, bool, ImageLoader::RPathChain const&) + 98
15  dyld                              0x2fe04f10 dyld::link(ImageLoader*, bool, ImageLoader::RPathChain const&) + 136
16  dyld                              0x2fe06f56 dyld::_main(macho_header const*, unsigned long, int, char const**, char const**, char const**) + 1278
17  dyld                              0x2fe01286 dyldbootstrap::start(macho_header const*, int, char const**, long, macho_header const*) + 506
18  dyld                              0x2fe01058 _dyld_start + 48

Thread 0 crashed with ARM Thread State:
    r0: 0x00e861b0    r1: 0x2fef2ef0      r2: 0x2fecf328      r3: 0x2fee36d1
    r4: 0x00000001    r5: 0x2fefaa74      r6: 0x00000000      r7: 0x2fece6f0
    r8: 0x2fed03f4    r9: 0x00000012     r10: 0x2fed0284     r11: 0x00000003
    ip: 0x2fef82f8    sp: 0x2fece6c0      lr: 0x2fedee39      pc: 0x2feee8a0
  cpsr: 0x00000010

Binary Images:
   0xd3000 -   0x680fff +XBMC armv7  <9014c0139d573f0fb02ee726f26ef1c0> /var/mobile/Applications/C29C8C81-1C9F-4863-A44E-7EF274F73102/XBMC.app/XBMC
0x2fed2000 - 0x2fef7fff  dyld armv7  <bb9bfc7d242331d29a79adf7ef7aaa18> /usr/lib/dyld