Join GitHub today
GitHub is home to over 20 million developers working together to host and review code, manage projects, and build software together.
Segmentation fault when printing a float #350
Comments
z3ntu
changed the title from
test_input: Segmentation fault when printing a float
to
Segmentation fault when printing a float
Jun 3, 2017
|
This looks like a softfp/hardfp issue. When I look at my N5 binaries, I have:
This leads to the floats being actually integers in the structure, but the compiler doesn't know that and uses them directly as floats. |
|
@Tofee This is not the issue here, libhybris uses the softfp calling convention when issuing calls to softfp libraries. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
z3ntu commentedJun 3, 2017
•
Edited 1 time
-
z3ntu
Jun 3, 2017
EDIT: This issue seems to be present in a bunch of tests. This issue was written only with test_input in mind! (I was debugging that one and found the issue)
Printing a float, like
printf("float: %f\n", 1.0);in the functionon_new_eventresults in a Segmentation fault. Doing the same in themainfunction, everything works as expected.Showcase: z3ntu/libhybris@ea24333
Output of that:
gdb backtrace - mirror of the paste is here
This problem causes the test_input test to crash: https://github.com/libhybris/libhybris/blob/master/hybris/tests/test_input.c#L51-L54 .
Casting the two variables into an integer and printing them works around the issue. Sample patch: z3ntu/libhybris@5773400