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

crash on enable toggle #8

Open
moshesiegel opened this issue Oct 10, 2015 · 18 comments
Open

crash on enable toggle #8

moshesiegel opened this issue Oct 10, 2015 · 18 comments

Comments

@moshesiegel
Copy link

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.

@AnnoyinSamurai
Copy link

Debugging the crash, i see __stack_chk_fail on libsystem_c.dylib after Frame Buffer is set with new Gamma values.

@angeloalduino
Copy link

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.

@Rivm
Copy link

Rivm commented Oct 10, 2015

@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.

@moshesiegel
Copy link
Author

@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
#8 (comment)
.

@AnnoyinSamurai
Copy link

@Rivm I have it set to 0xc00 already, i will try deployment target fix later today.
Thanks.

@Rivm
Copy link

Rivm commented Oct 11, 2015

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

@AnnoyinSamurai
Copy link

@Rivm Yup, 0xc0c worked. Another issue i noticed , after disabling the screen still has orange tint left requiring a reset.

@luuuke
Copy link
Contributor

luuuke commented Oct 11, 2015

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.

@esusatyo
Copy link

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);

@luuuke
Copy link
Contributor

luuuke commented Oct 13, 2015

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.

@blcs79
Copy link

blcs79 commented Nov 2, 2015

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!

@mkasu
Copy link

mkasu commented Nov 2, 2015

In newest HEAD, I've got constant crashes due to this commit:
6246648

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).

@agentk
Copy link

agentk commented Nov 3, 2015

@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.

screen shot 2015-11-03 at 11 11 24 am

@mkasu
Copy link

mkasu commented Nov 3, 2015

@agentk Thanks. Got it to work. It seems just the clean-step was missing for me (already had changed the identifiers previously).

@patrickwelker
Copy link

@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.

@paulrudy
Copy link

@agentk Thanks, clean & build was the piece I was missing, too.

@patmuk
Copy link

patmuk commented Dec 7, 2015

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);

@agentk
Copy link

agentk commented Dec 9, 2015

@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.

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