Microverse icon indicating copy to clipboard operation
Microverse copied to clipboard

Receiving Segmentation Fault 11 using any graphical app (iOS included)

Open iVoider opened this issue 3 years ago • 0 comments

Typical cause is always like this. Just different OpenGl, Metal errors for different apps.

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Subtype: KERN_INVALID_ADDRESS at 0x0000000000000000
Exception Codes: 0x0000000000000001, 0x0000000000000000
VM Region Info: 0 is not in any region.  Bytes before following region: 4329668608
      REGION TYPE                    START - END         [ VSIZE] PRT/MAX SHRMOD  REGION DETAIL
      UNUSED SPACE AT START
--->  
      __TEXT                      102118000-102a70000    [ 9568K] r-x/r-x SM=COW  ...etryDashWorld
Exception Note:  EXC_CORPSE_NOTIFY
Termination Reason: SIGNAL 11 Segmentation fault: 11
Terminating Process: exc handler [529]

Triggered by Thread:  0

Thread 0 Crashed::  Dispatch queue: com.apple.main-thread
0   CoreFoundation                	       0x1be3a17bc CFStringGetLength + 8
1   libGFXShared.dylib            	       0x23bd68a04 gfxInitializeLibrary + 720
2   GLEngine                      	       0x23bf23b8c gliInitializeLibrary + 68
3   OpenGLES                      	       0x23bf1f784 eagl_init + 480
4   OpenGLES                      	       0x23bf1f340 -[EAGLSharegroup initWithAPI:sharedWithCompute:] + 228
5   OpenGLES                      	       0x23bf1e46c -[EAGLContext commonInitWithAPI:properties:] + 208
6   OpenGLES                      	       0x23bf1e2c8 -[EAGLContext initWithAPI:properties:] + 268

I suppose it is because wrong gpu config, though as I can see Virtualization.framework doesn't contains any public method for video card config. I'd tried to disable SIP of VM and set gpu NVRAM boot args but no any effect.

-(id)init {
    if ([[self className] containsString:@ "_VZVirtualMachineStartOptions"]) {
        NSLog(@"Found %@", [self className]);
        bootLoader = self;
        [self hook_setBootMacOSRecovery:0];
    }
    return self;
}

+(void)load
{
    static dispatch_once_t onceToken;
    dispatch_once(&onceToken, ^{
        [objc_getClass("_VZVirtualMachineStartOptions") swizzleInstanceMethod:@selector(setBootMacOSRecovery:) withMethod:@selector(hook_setBootMacOSRecovery:)];
    });
}

- (void) hook_setBootMacOSRecovery: (int) boot {
    printf("hooked");
    [self hook_setBootMacOSRecovery:1];
}

iVoider avatar Oct 27 '21 00:10 iVoider