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
Possible Segfault in strip_sgr #52
Comments
@kazumits are you able to run your minimal example with You can even try a simple valgrind run with your normal R build to see if it provides a bit more information. I haven't yet peered at the code to see if I can detect something obviously wrong, but without being able to reproduce the crash it will be much harder for me to debug. Any additional information about the location of the problem in the C code will help. |
Thanks a lot for looking into it! |
@brodieG thanks for your instruction but
The segfault was gone when I deleted the line (I'm not sure this line is necessary) I hope the information will help. |
I agree that setting the null terminator shouldn't be necessary because later |
Thanks, this is great. I'll look at it in detail in the next couple of days. Based on @krlmr's comment, and the fact that it works fine with low optimizations but segfaults in high optimizations almost makes me wonder if something is going wrong with the R ICC + MKL compilation (although 100% of the times in the past when I've blamed the compiler, I've been wrong). |
I've narrowed down the reproducible condition. Compiling fansi with It may cause |
Excellent, thanks for putting in the hard work here. I'll be working on this package this week so I'll try to write this in a way that always compiles correctly. |
I believe this is fixed in the development branch. I was about ready to blame ICC, but I think that other compilations were benefiting from undefined behavior that allowed them to work properly where the re-declaration of a variable in a loop was not overwriting the previous pointer location. @kazumits unfortunately I do not have an ICC license; would you be able to test the development branch to see if the error persists? |
What a subtle issue, thanks again for looking into it! |
This error has been completely gone in the development branch using
I do appreciate your efforts. |
See r-lib/pillar#123.
Failed to reproduce locally, including running with valgrind on R devel from March.
The text was updated successfully, but these errors were encountered: