Skip to content

[MinGW/Clang] Fix SEGFAULTs when logging to globals#95

Closed
Amphaal wants to merge 2 commits into
mosra:masterfrom
Amphaal:patch-1
Closed

[MinGW/Clang] Fix SEGFAULTs when logging to globals#95
Amphaal wants to merge 2 commits into
mosra:masterfrom
Amphaal:patch-1

Conversation

@Amphaal

@Amphaal Amphaal commented May 4, 2020

Copy link
Copy Markdown
Contributor

Okay, I think I found the issue with mosra/magnum#417.

Changing few lines in src/Corrade/Utility/Debug.cpp allowed me to boot up a sample projet using a Magnum Clang build.

My 2cts guess here is that Clang does some optimizations and "hard stores" pointer addresses of the standard outputs when directly referenced "as it", references that may change outside of Corrade, resulting in SEGFAULTs when Magnum tries to use its logging capabilities.

@mosra mosra added this to the 2020.0a milestone May 4, 2020

@mosra mosra left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Wow, nice. I have no idea how you managed to discover this :)

Comment thread src/Corrade/Utility/Debug.cpp
Co-authored-by: Vladimír Vondruš <mosra@centrum.cz>
@Amphaal

Amphaal commented May 4, 2020

Copy link
Copy Markdown
Contributor Author

Wow, nice. I have no idea how you managed to discover this :)

Luck and perseverance I guess... Classic MinGW developper's traits right here xD

@mosra

mosra commented May 4, 2020

Copy link
Copy Markdown
Owner

Merged as abfeeaf, thank you! (The CIs take ages to go through, sorry.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants