EXC_BAD_ACCESS error

3 replies [Last post]
mrEmpty
User offline. Last seen 8 years 44 weeks ago. Offline
Joined: 07/16/2012
Posts:

Hello.

Using some basic code, just to test some live tweaking, I'm getting an EXC_BAD_ACCESS error on the following line:

[self processVideoSampleBuffer:sampleBuffer];

in GPUImageVideoCamera.m

The basic code I'm using is:

GPUImageVideoCamera *videoCamera = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPreset640x480 cameraPosition:AVCaptureDevicePositionBack];

GPUImageFilter *filter = [[GPUImageSepiaFilter alloc] init];
GPUImageView *filteredVideoView = [[GPUImageView alloc] initWithFrame:viewBox.frame];

[videoCamera addTarget:filter];
[filter addTarget: filteredVideoView];

[videoCamera startCameraCapture];

viewBox is a UIView, nothing fancy, it's just hanging around from an earlier test. If I create a new rect the same error throws.

I've added all the frameworks required, I've used GPUImage successfully before, but not on a live video stream.

Thanks.

mrEmpty
User offline. Last seen 8 years 44 weeks ago. Offline
Joined: 07/16/2012
Posts:

Additional information:

Incident Identifier: 3EE0C984-D329-4658-ABA9-0CEC06072693
CrashReporter Key: cee19d44daf51c2fc09c25165e0b8766756eadb9
Hardware Model: iPhone3,1
Process: PukkaPlayground [3391]
Path: /var/mobile/Applications/37639B26-8A38-4898-8AA7-FD42C82D818D/PukkaPlayground.app/PukkaPlayground
Identifier: PukkaPlayground
Version: ??? (???)
Code Type: ARM (Native)
Parent Process: launchd [1]

Date/Time: 2012-07-16 12:04:47.912 +0100
OS Version: iPhone OS 5.1.1 (9B206)
Report Version: 104

Exception Type: EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: KERN_INVALID_ADDRESS at 0x00000009
Crashed Thread: 0

Thread 0 name: Dispatch queue: com.apple.main-thread
Thread 0 Crashed:
0 libobjc.A.dylib 0x34ed9f78 objc_msgSend + 16
1 PukkaPlayground 0x0009b236 __74-[GPUImageVideoCamera captureOutput:didOutputSampleBuffer:fromConnection:]_block_invoke_0121 (GPUImageVideoCamera.m:396)
2 libdispatch.dylib 0x30306b24 _dispatch_barrier_sync_f_slow_invoke + 72
3 libdispatch.dylib 0x30305e8a _dispatch_main_queue_callback_4CF$VARIANT$up + 190
4 CoreFoundation 0x371ad2a6 __CFRunLoopRun + 1262
5 CoreFoundation 0x3713049e CFRunLoopRunSpecific + 294
6 CoreFoundation 0x37130366 CFRunLoopRunInMode + 98
7 GraphicsServices 0x338ef432 GSEventRunModal + 130
8 UIKit 0x30edccce UIApplicationMain + 1074
9 PukkaPlayground 0x00077fc0 main (main.m:16)
10 PukkaPlayground 0x00077f64 start + 32

Thread 0 crashed with ARM Thread State:
r0: 0x00375a20 r1: 0x000a176c r2: 0x00398e40 r3: 0x000a176c
r4: 0x00000001 r5: 0x00000000 r6: 0x00000000 r7: 0x2fe73e14
r8: 0x2fe73e2c r9: 0x000285db r10: 0x2fe73e2c r11: 0x3ec49de0
ip: 0x3e1442c8 sp: 0x2fe73e04 lr: 0x0009b23d pc: 0x34ed9f78
cpsr: 0x20000030

Also this line:

0x34ed9f78: ldr r3, [r4, #8]

from this:

libobjc.A.dylib`objc_msgSend:

is highlighted when the error is thrown.

Brad Larson
Brad Larson's picture
User offline. Last seen 4 years 22 weeks ago. Offline
Joined: 05/14/2008
Posts:

Is this an ARC-enabled application? Do you keep a reference to your GPUImageVideoCamera and GPUImageView as instance variables? If not, your video camera and your entire video pipeline will be deallocated as soon as your set method has finished. You need to retain at least the video camera object for as long as you want to run your video capture.

mrEmpty
User offline. Last seen 8 years 44 weeks ago. Offline
Joined: 07/16/2012
Posts:

Of course, I keep forgetting about ARC. Thanks.

Syndicate content