• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
Locked
0

AIR application with Native application crash on iOS because of numFunctionsToTest

New Here ,
Dec 29, 2011 Dec 29, 2011

Copy link to clipboard

Copied

I wrote a simple Hello World AIR Native Extension and have implemented following context initializer

void helloWorldContextInitializer(void* extData, const uint8_t* ctxType, FREContext ctx,

                                  uint32_t* numFunctionsToTest, const FRENamedFunction** functionsToSet)

{

    NSLog(@"Entering ContextInitializer");

   

    *functionsToSet = _methods;

   

    NSLog(@"Method list initialized");

   

    if(numFunctionsToTest != NULL)

    {

        NSLog(@"numFunctionToTest is not null");

        *numFunctionsToTest = (uint32_t)2;

    }

   

    NSLog(@"Exiting ContextInitializer");

}

My Application crash on iOS device with following message in console.

Dec 29 15:58:41 unknown HelloWorld[24298] <Warning>: Entering ContextInitializer

Dec 29 15:58:41 unknown HelloWorld[24298] <Warning>: Method list initialized

Dec 29 15:58:41 unknown HelloWorld[24298] <Warning>: numFunctionToTest is not null

Dec 29 15:58:42 unknown ReportCrash[24302] <Notice>: Formulating crash report for process HelloWorld[24298]

Dec 29 15:58:42 unknown com.apple.launchd[1] <Warning>: (UIKitApplication:org.divy.contactmanagement[0x5c0]) Job appears to have crashed: Bus error: 10

Dec 29 15:58:42 unknown SpringBoard[15] <Warning>: Application 'HelloWorld' exited abnormally with signal 10: Bus error: 10

Dec 29 15:58:43 unknown ReportCrash[24302] <Error>: Saved crashreport to /var/mobile/Library/Logs/CrashReporter/

It seems line following line is cause of the problem.

*numFunctionsToTest = (uint32_t)2;

modified the line to *numFunctionsToTest = 2; still no luck.

It seem the pointer is pointing is not correct.

Following is the Device log if it helps.

Incident Identifier: 650833B2-9F2E-4186-B499-29C9088EBD66

CrashReporter Key:   f559e8609ce49e196f1137a3c1c7d27b40377472

Hardware Model:      iPhone3,1

Process:         HelloWorld [24065]

Path:            /var/mobile/Applications/35BEA219-A5DF-48BB-8602-228EB8AF3D61/HelloWorld.app/HelloWorld

Identifier:      HelloWorld

Version:         ??? (???)

Code Type:       ARM (Native)

Parent Process:  launchd [1]

Date/Time:       2011-12-29 14:36:08.226 -0800

OS Version:      iPhone OS 5.0.1 (9A405)

Report Version:  104

Exception Type:  EXC_BAD_ACCESS (SIGBUS)

Exception Codes: KERN_PROTECTION_FAILURE at 0x011c6d85

Crashed Thread:  0

TOPICS
Performance issues

Views

1.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Jan 02, 2012 Jan 02, 2012

Copy link to clipboard

Copied

Can you try shifting this line:

  *functionsToSet = _methods;

after you have set numFunctionsToTest to 2?

If that doesn't work, can you share the contents of _methods?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 05, 2012 Mar 05, 2012

Copy link to clipboard

Copied

LATEST

It was my mistake in configuration of extension.xml file. Instead of mentioning Extesion Initialization funtion i was using context initialization funtions there. It started working after correcting this problem.

Thanks for all the help.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines