You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There seems to an issue when using gcc version 9.2.0 and higher optimization levels. I had to go down to -O0, otherwise the program segfaults. I tried debugging using gdb and simple "printf", and when using gdb it would trace the segfault to the line:
even though the index would not point outside the allocated space of buf. When using printf to debug, it appears to segfault in the return from the function run_for_frequencies. Neither makes much sense to me. Anyway, using -O0 solved the problem so that is a workaround.
The text was updated successfully, but these errors were encountered:
The segfault is likely because run_for_frequencies is defined to return int, but there's no return.
Yes, failing to return an int is undefined behaviour, and can cause anything, including segfault. Change it to void, and it worked fine. At least for me.
There seems to an issue when using gcc version 9.2.0 and higher optimization levels. I had to go down to -O0, otherwise the program segfaults. I tried debugging using gdb and simple "printf", and when using gdb it would trace the segfault to the line:
even though the index would not point outside the allocated space of buf. When using printf to debug, it appears to segfault in the return from the function
run_for_frequencies
. Neither makes much sense to me. Anyway, using -O0 solved the problem so that is a workaround.The text was updated successfully, but these errors were encountered: