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

IOS resource exhaustion problem #3732

Open
ddyer0 opened this issue Sep 15, 2023 · 1 comment
Open

IOS resource exhaustion problem #3732

ddyer0 opened this issue Sep 15, 2023 · 1 comment

Comments

@ddyer0
Copy link
Contributor

ddyer0 commented Sep 15, 2023

The symptom is that the app crashes with no warning or useful debug info

I've only got this to occur on IOS, on physical devices, not on Android, Codename1 simulator, or Xcode simulator.
It appears to be some kind of resource exhaustion problem. The crash is SIGABRT at this line from GLUIImage.m,
where "imageData" appears to be null, which indicates that the "malloc" at the head of the method failed.

    CGContextTranslateCTM(context, 0, p2h);
    CGContextScaleCTM(context, 1, -1);
    CGColorSpaceRelease(colorSpace);
    CGContextClearRect(context, CGRectMake(0, 0, p2w, p2h));
    //CGContextSetRGBStrokeColor(context, 1, 0, 0, 1);
    //CGContextSetRGBFillColor(context, 0, 1, 0, 1);
    //CGContextFillRect(context, CGRectMake(0, p2h - h, w, h));
    //CGContextStrokeRect(context, CGRectMake(0, 0, w, p2h));
    CGContextDrawImage(context, CGRectMake(0, p2h - h, w, h), img.CGImage);
  glTexImage2D(GL_TEXTURE_2D, 0, GL_RGBA, p2w, p2h, 0, GL_RGBA, GL_UNSIGNED_BYTE, imageData);
    GLErrorLog;

I don't understand the immediate context - 'getTexture' shouldn't be involved in drawing my
images, so perhaps the whole environment is already corrupt in some way. I totally believe
that there's a resource exhaustion problem as the immediate cause of the crash. As a first step
I'd be very happy if there were a java-level exception instead of a hard crash.

2023-09-14 18:11:00.800368-0700 Develop[2046:146042] [Unknown process name] CGSImageDataLock: Cannot allocate memory
dyld4 config: DYLD_LIBRARY_PATH=/usr/lib/system/introspection DYLD_INSERT_LIBRARIES=/Developer/usr/lib/libBacktraceRecording.dylib:/Developer/usr/lib/libMainThreadChecker.dylib:/Developer/Library/PrivateFrameworks/DTDDISupport.framework/libViewDebuggerSupport.dylib:/Developer/Library/PrivateFrameworks/GPUTools.framework/libglInterpose.dylib:/usr/lib/libMTLCapture.dylib
(lldb)
(lldb) bt

@ddyer0
Copy link
Contributor Author

ddyer0 commented Sep 15, 2023

Irrespective of the larger question of why malloc fails, given that it does fail in this case, you
ought to throw some sort of java-level exception, rather than allow a SIGABORT to occur

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant