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

SIGFPE (division by zero) in random number app #160

Open
lmamane opened this issue Oct 26, 2024 · 2 comments
Open

SIGFPE (division by zero) in random number app #160

lmamane opened this issue Oct 26, 2024 · 2 comments

Comments

@lmamane
Copy link

lmamane commented Oct 26, 2024

Enter the random number app.
Click the "generate random number" button, or one of the "+" or "-" buttons, a few times.
Most of the times, this will stop the simulator process with a SIGFPE due to a division by zero in InfiniTime/src/components/motion/MotionController.cpp, function MotionController::ShouldShakeWake, because time == lastTime

This looks like having time == lastTime could be a simulator bug, not an issue on actual hardware, not sure.

Here's the patch I have applied locally to InfiniTime; let me know if you think it should go to InfiniTime (cleaned up of debugging output to cerr, obviously) for better robustness or is just a work-around for a simulator bug.

InfiniTime_FPE.zip

(sorry I upload it as a ZIP file, github doesn't let me attach a patch file with a messaging listing the supported file types, among which "PATCH")

@lmamane
Copy link
Author

lmamane commented Oct 26, 2024

Another way to trigger: enter settings, wake up setttings, enable "Shake Wake", then disable it again

@Eve1374
Copy link

Eve1374 commented Dec 11, 2024

I also experienced this issue today, and I don't know were it came from because you reported it on October 26 and I am quite sure I had successful InfiniSim runs since then. The bug happened randomly for me, even with just a right click on the watchface after infinisim starts.
Your (@lmamane ) patch seems to fix it, thanks.

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

2 participants