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

macOS on Intel: floating point exception in munit_rand_int_range(), but only inside a test #94

Open
plexilcrf opened this issue Jun 30, 2023 · 2 comments

Comments

@plexilcrf
Copy link

plexilcrf commented Jun 30, 2023

Platform: macOS 12.6.7, MacBook Pro (16-inch, 2019), Intel i9 CPU, clang 13.1.6.

A helper function which calls munit_rand_int_range(), called from a test, is raising signal 8 (SIGFPE, floating point exception).

If I call the function from main(), prior to calling munit_suite_main() (i.e. outside the munit test environment), no problems are apparent when run from the command line, and the test suite runs normally (until the test in question).

However, when running the same executable under lldb, all of the tests in the suite report ERROR.

Under lldb, single-stepping through munit_rand_int_range() prior to calling munit_suite_main() doesn't seem to raise the signal. Breakpoints seem to be ignored inside a test. So I'm unable to debug further.

The problem does not seem to occur in the munit example.c.

@codylico
Copy link

Is it possible that you're running into this issue?
#30 (comment)

@plexilcrf
Copy link
Author

plexilcrf commented Jun 30, 2023

Is it possible that you're running into this issue? #30 (comment)

Yes, the function was being called with a range of (0, 0). So please close this issue as a duplicate.

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