GammaThingy
GammaThingy copied to clipboard
crash on enable toggle
running 9.1 beta 4 on my 6: app immediately crashes on toggling on/off yet it will change the gamma color but its not adjustable.
Debugging the crash, i see __stack_chk_fail on libsystem_c.dylib after Frame Buffer is set with new Gamma values.
Are you compiling for all architectures, including arm64? I noticed that it only works if targeting armv7. I was trying to write a today widget for it (arm64 only) and then ran into this issue.
@glassbot: If you're running iOS 7 or later, you need go into GammaController.m:102
and change:
uint32_t data[0xc00 / sizeof(uint32_t)];
to
uint32_t data[0xc0c / sizeof(uint32_t)];
EDIT: Numbers flipped around, my bad.
@angeloalduino that fixed it, I was compiling for the latest but when I set they deployment target back to 7 it worked.
Thanks.
On Sat, Oct 10, 2015 at 5:47 PM, Angelo Alduino [email protected] wrote:
Are you compiling for all architectures, including arm64? I noticed that it only works if targeting armv7. I was trying to write a today widget for it (arm64 only) and then ran into this issue.
— Reply to this email directly or view it on GitHub https://github.com/thomasfinch/GammaThingy/issues/8#issuecomment-147128417 .
@Rivm I have it set to 0xc00 already, i will try deployment target fix later today. Thanks.
Wow oops, I accidentally had the change "" and to "" reversed. In iOS 7, the gamma table struct's unsigned array size changed from 0x100 to 0x101. So, if my math checks out...
Old:
0x100 * sizeof(unsigned int) * 3 = 3072 or 0xc00
New:
0x101 * sizeof(unsigned int) * 3 = 3084 or 0xc0c
@Rivm Yup, 0xc0c worked. Another issue i noticed , after disabling the screen still has orange tint left requiring a reset.
My current PR includes a commit where I added proper ARM64 support using @glassbot's solution.
Edit: The specific commit has been merged, this issue should be fixed now.
I've pulled the latest commit, running it on iPad 4th Gen still crashes the app for me. It works fine on my iPhone 6. I set added a breakpoint, and it's stopping at GammaController.m:122
:
error = IOMobileFramebufferGetGammaTable(fb, data);
I just realized that this issue doesn't depend on architecture as suggested above, I've updated my fork in this regard. Should be fixed now.
Still crashing here (iPhone 6S, iOS 9.1) as soon as I try to use any of the controls. Gamma effect not initiated. Any ideas? Thanks!
In newest HEAD, I've got constant crashes due to this commit: https://github.com/thomasfinch/GammaThingy/commit/624664866decadaab08dc57a9a04156b0feb3bc0
If I change it back, GammaThingy works normally (have not tried the widget though).
Edit: It seems there's still some glitches with wrong colors, even without using the widget. If removing this change. However, it does not work at all for me (the file!=NULL assert is triggered).
@mkasu You may have an APP_GROUP_IDENTIFIER change missing. I found I missed the change in Info.plist (see screenshot), then had to do a clean and build to update the app.
@agentk Thanks. Got it to work. It seems just the clean-step was missing for me (already had changed the identifiers previously).
@agentk Thanks. I have zero experience in Xcode and always had a crash when trying to interact with the compiled app. Search for the APP_GROUP_IDENTIFIER
and added my group fixed it.
@agentk Thanks, clean & build was the piece I was missing, too.
It still does not work for me - looks like a (setting?) file is missing. 2015-12-08 00:11:43.581 GammaTest[4778:1635401] enabled: 1 2015-12-08 00:11:43.591 GammaTest[4778:1635401] Lock status: 0 Assertion failed: (file != NULL), function +[GammaController setGammaWithRed:green:blue:], file /Users/patmuk/code/sideload/iPhone/GammaThingy/GammaTest/mvc/controller/GammaController.m, line 138. from this code:
137 file = fopen([filePath UTF8String], "wb"); 138 assert(file != NULL);
@patmuk That is the same error I was getting too. The filePath is based on the APP_GROUP_IDENTIFIER. Ensure it is set correctly in the project level settings, and not overridden in the targets, and that it matches what you entered in Capabilities -> App Group. Then clean and rebuild.
Just setting the bundle and group identifiers in General and Capabilities is not enough. You need to search for the value in build settings too.
The clean is important too as this change at the project level does not cause the build to be updated unless you clean first.