简体   繁体   中英

SIGSEGV/SEGV_ACCERR causes crash in GPUImage framework iOS

I was getting the SIGSEGV/SEGV_ACCERR crash report from crittercism tool integrated in my app, this was because of taking a video capturing and leaving the app in sleep mode for 15-20 minutes after coming back from sleep mode the app crashed, this is blocker issue in my case .Please suggest the solution, thanks in advance The following shows the sample code used:

GPUImageiOSBlurFilter   * blurFilterObj = [[GPUImageiOSBlurFilter alloc] init];
    blurFilterObj.blurRadiusInPixels = 4.5f ;
    blurFilterObj.downsampling = 2.5f ;
    blurFilterObj.saturation = 1.0f;



GPUImageVideoCamera  *liveVideo = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPresetMedium cameraPosition:AVCaptureDevicePositionFront];
    liveVideo.outputImageOrientation = UIInterfaceOrientationPortrait;
    liveVideo.horizontallyMirrorFrontFacingCamera = YES ;

    //Add Targets to live video
    [liveVideo addTarget:blurView];
   [liveVideo addTarget:blurFilterObj];
 [blurFilterObj addTarget:blurView];

   CSBlurView  *blurView = [[CSBlurView alloc] initWithFrame:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height)];
    [self.view addSubview:blurView];

GPUImageVideoCamera  *liveVideo = [[GPUImageVideoCamera alloc] initWithSessionPreset:AVCaptureSessionPresetMedium cameraPosition:AVCaptureDevicePositionFront];
    liveVideo.outputImageOrientation = UIInterfaceOrientationPortrait;
    liveVideo.horizontallyMirrorFrontFacingCamera = YES ;

    //Add Targets to live video
    [liveVideo addTarget:blurView];
   [liveVideo addTarget:blurFilterObj];
 [blurFilterObj addTarget:blurView];

The following represents the crash report

libGPUSupportMercury.dylib 0x322d48f6 gpus_ReturnNotPermittedKillClient + 1 
IMGSGX543GLDriver 0x2c7e282d SubmitPackets + 125
GLEngine 0x2fc44c3d gliPresentViewES + 17   
OpenGLES 0x2fc4f139 -[EAGLContext presentRenderbuffer:] + 65    
0x0006f2a3 -[GPUImageContext presentBufferForDisplay] (GPUImageContext.m:196)
0x00074a75 -[GPUImageView presentFramebuffer] (GPUImageView.m:220)
0x0004e23d runSynchronouslyOnVideoProcessingQueue (GPUImageOutput.m:27
0x00074cdd -[GPUImageView newFrameReadyAtTime:atIndex:] (GPUImageView.m:385)    
0x0002096f -[GPUImageVideoCamera      updateTargetsForVideoCameraUsingCacheTextureAtWidth:height:time:] (GPUImageVideoCamera.m:640) 
0x00020ceb -[GPUImageVideoCamera processVideoSampleBuffer:] (GPUImageVideoCamera.m:738) 
0x000216bf __74-[GPUImageVideoCamera  captureOutput:didOutputSampleBuffer:fromConnection:]_block_invoke  (GPUImageVideoCamera.m:966)    
libdispatch.dylib 0x38246d1b _dispatch_call_block_and_release + 11  
libdispatch.dylib 0x3824d273 _dispatch_queue_drain$VARIANT$mp + 375 
libdispatch.dylib 0x3824d06b _dispatch_queue_invoke$VARIANT$mp + 43
libdispatch.dylib 0x3824dce1 _dispatch_root_queue_drain + 77
libdispatch.dylib 0x3824df59 _dispatch_worker_thread2 + 57  
libsystem_pthread.dylib 0x38388dbf _pthread_wqthread + 299  
libsystem_pthread.dylib 0x38388c84 start_wqthread + 8

I got the solution from BradLarson who develops the GPUImage filters api,he responded from the github resource. When we use the gpuimagevideocamera its always renders the opengl so when it goes to background mode or sleep mode also rendering the opengl then crash will happen so, before app moves to the background stop the camera capture and remove the filters added to the camera and picturewriter it solves the problem. Thank you

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM