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

test_qtreetbl.c will segfault with gcc >= 10 #94

Closed
Fullaxx opened this issue Nov 4, 2022 · 4 comments
Closed

test_qtreetbl.c will segfault with gcc >= 10 #94

Fullaxx opened this issue Nov 4, 2022 · 4 comments

Comments

@Fullaxx
Copy link
Contributor

Fullaxx commented Nov 4, 2022

make test will fail when qlibc is compiled with gcc >= 10.
Under this case, test_qtreetbl.c will compile but will segfault during execution.
I believe that it is caused by the unused return true; of drawtree().
test_qtreetbl_gcc10.txt
test_qtreetbl_gcc11.txt
test_qtreetbl_gcc12.txt

@Fullaxx
Copy link
Contributor Author

Fullaxx commented Nov 4, 2022

sorry, this isn't quite right and needs more investigation.

@Fullaxx Fullaxx closed this as completed Nov 4, 2022
@Fullaxx
Copy link
Contributor Author

Fullaxx commented Nov 4, 2022

Apparently the unused return value is not the root cause.
It seems that when test_qtreetbl.c is compiled with -O2 the drawtree() will produce a segfault,
When I remove the -O2 optimizations flag to get better debugging symbols, drawtree() functions normally.
Commenting out the drawtree() does avoid the segfault, but I don't have a good explanation as to the root cause.
If anyone has any insight here, that would be greatly appreciated.

@Fullaxx Fullaxx reopened this Nov 4, 2022
Fullaxx added a commit to Fullaxx/qlibc that referenced this issue Nov 4, 2022
* Comment out drawtree() to prevent segfault with gcc >= 10
@wolkykim
Copy link
Owner

wolkykim commented Nov 4, 2022

Hi Thanks for the report.
This is addressed by #95

@Fullaxx
Copy link
Contributor Author

Fullaxx commented Nov 4, 2022

awesome, thanks! verified that works with gcc-12

@Fullaxx Fullaxx closed this as completed Nov 4, 2022
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