Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

64 bit iOS - crash on launch with Release version #144

Closed
ronherrema opened this issue Aug 1, 2016 · 9 comments

Comments

Projects
None yet
2 participants
@ronherrema
Copy link

commented Aug 1, 2016

I'm building an app using libpd and OpenFrameworks as two separate sub-projects. I have no problem archiving and then installing and running the app (through either Ad Hoc or TestFlight) on my 32 bit iPad when archiving is set to Release. For my 64 bit iPad, it will install but not run if archiving is set to Release. The crash log looks like this:

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000008
Triggered by Thread: 0

Filtered syslog:
None found

Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 Infinity 0x000000010033cf3c phasor_dsp + 40
1 Infinity 0x000000010034311c ugen_doit + 496
2 Infinity 0x000000010034311c ugen_doit + 496
3 Infinity 0x0000000100342ca4 ugen_done_graph + 956
4 Infinity 0x000000010034c750 canvas_dodsp + 240
5 Infinity 0x000000010034b1a0 canvas_start_dsp + 84
6 Infinity 0x0000000100375d78 glob_evalfile + 156
7 Infinity 0x000000010038bf94 +[PdBase openFile:path:] + 88
8 Infinity 0x00000001000148b4 -PdPatch initWithFile:
9 Infinity 0x0000000100011734 -ViewController viewDidLoad

And the Xcode stops on this line of code:

static void phasor_dsp(t_phasor *x, t_signal **sp)
{
    x->x_conv = 1./sp[0]->s_sr;
    dsp_add(phasor_perform, 4, x, sp[0]->s_vec, sp[1]->s_vec, sp[0]->s_n);
}

And my own code looks like this:

@implementation ViewController {
   ofApp *myApp;
}

-(void)viewDidLoad {
    [super viewDidLoad];

    myApp = (ofApp*)ofGetAppPtr();

#pragma mark - libpd setup

    _pd = [[PdAudioController alloc]init];
    PdAudioStatus pdInit = [_pd configurePlaybackWithSampleRate:44100 numberChannels:2 inputEnabled:YES mixingEnabled:YES];
    if (pdInit != PdAudioOK) {
        NSLog(@"pd failed");
    }

    // Load the patch
    _patch = [[PdPatch alloc]initWithFile:@"drones_vanilla_2nd_5th_input4.pd"];

    _pd.active = YES;

    // Pd listener setup
    _dispatcher = [[PdDispatcher alloc]init];
    [_dispatcher addListener:self forSource:@"s1"]; // not used at the moment

    [PdBase setDelegate:_dispatcher];

}

Can someone tell me why this might be crashing with the 64 bit version and not the 32 bit? (Or why it might be crashing in any case.) I've had a few suggestions in the Apple developers' forum but am still not clear how to proceed:

https://forums.developer.apple.com/thread/53139?start=0&tstart=0

@ronherrema

This comment has been minimized.

Copy link
Author

commented Aug 2, 2016

Adding some screen shots from Xcode's Analyze function, showing a number of dereferences of null, and wondering if these could be part of the problem:

screen shot 2016-08-02 at 11 34 08
screen shot 2016-08-02 at 11 34 37
screen shot 2016-08-02 at 11 34 50

@ronherrema

This comment has been minimized.

Copy link
Author

commented Aug 2, 2016

I tried using the Address Sanitizer and got the following results:

screen shot 2016-08-02 at 12 34 25

screen shot 2016-08-02 at 12 34 40

Also, the debugging console showed the sp variable to have repeatedly a value of NULL.

@danomatika

This comment has been minimized.

Copy link
Member

commented Aug 3, 2016

Does it load the patch if you remove the vline~ object?

@ronherrema

This comment has been minimized.

Copy link
Author

commented Aug 3, 2016

No, that doesn't help. I then get the same error but at phasor_dsp. Also showing here the values of the s variable:

screen shot 2016-08-03 at 22 18 51

screen shot 2016-08-03 at 22 15 33

@ronherrema

This comment has been minimized.

Copy link
Author

commented Aug 16, 2016

Hi Dan

Just sending this as a prompt - do you have any clues about this
(unresolved) issue?

Thanks

Ron

Ron Herrema, PhD
Composer, developer & digital artist

http://www. http://www.mti.dmu.ac.uk/~rherremaronherrema.net

On 3 August 2016 at 22:23, Ron Herrema rherrema@gmail.com wrote:

No, that doesn't help. I then get the same error but at phasor_dsp. Also
showing here the values of the s variable:

[image: screen shot 2016-08-03 at 22 18 51]
https://cloud.githubusercontent.com/assets/3489924/17382429/ae4f9954-59c8-11e6-9634-e2b0231c1f48.png

[image: screen shot 2016-08-03 at 22 15 33]
https://cloud.githubusercontent.com/assets/3489924/17382436/b4d79e16-59c8-11e6-8234-227d8d0b8bbd.png

Ron Herrema, PhD
Composer, developer & digital artist

http://www. http://www.mti.dmu.ac.uk/~rherremaronherrema.net

On 3 August 2016 at 18:53, Dan Wilcox notifications@github.com wrote:

Does it load the patch if you remove the vline~ object?


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#144 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ADVAhOxj3YICGChtxeJO3jrvNQmkmDV2ks5qcNWMgaJpZM4JZ-P5
.

@danomatika

This comment has been minimized.

Copy link
Member

commented Aug 16, 2016

Dunno. I don't know the internals of pd itself very well. Pinging @nettoyeurny & @millerpuckette

@danomatika

This comment has been minimized.

Copy link
Member

commented Sep 24, 2016

I just pushed a commit which resolves a crash when loading a patch due to a divide by zero. It's probably not related but you could try adding this change to your copy of ofxPd: 0705e59

@ronherrema

This comment has been minimized.

Copy link
Author

commented Sep 30, 2016

Thanks for that. I can't really say whether it is related, since attempting
to update libpd wound up generating a number of new error messages in Xcode
that I unfortunately don't have time to deal with at the moment (a number
of them were of the type 'implicit declaration of function xyz is invalid
in C99').

What I can say is that switching from using libpd to using Enzien Audio's
Heavy Audio Tools has enabled me to get the Pd patch working properly on 64
bit devices. Of course it would be nice to solve the issue with libpd, but
that will have to wait for another day.

cheers

Ron

Ron Herrema, PhD
Composer, developer & digital artist
Senior Lecturer in Creative Computing, Bath Spa University

http://www. http://www.mti.dmu.ac.uk/~rherremaronherrema.net

On 24 September 2016 at 19:54, Dan Wilcox notifications@github.com wrote:

I just pushed a commit which resolves a crash when loading a patch due to
a divide by zero. It's probably not related but you could adding this
change to your copy of ofxPd: 0705e59
0705e59


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
#144 (comment), or mute
the thread
https://github.com/notifications/unsubscribe-auth/ADVAhBBkftyqqtt_mKiu81s-Gsha9bf-ks5qtXHxgaJpZM4JZ-P5
.

@danomatika

This comment has been minimized.

Copy link
Member

commented Sep 30, 2016

Ok. I will close this for now. Please reopen if/when you run into it again.

@danomatika danomatika closed this Sep 30, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.