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

sf::Window:setIcon causes segfault on Linux #1168

Closed
ghost opened this Issue Nov 21, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@ghost

ghost commented Nov 21, 2016

Using sf::Window::setIcon leads to a segfault on Linux. This example gives following gdb output:

Reading symbols from ./sfml...done.
(gdb) r
Starting program: /home/john/sfml/sfml 
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/usr/lib/libthread_db.so.1".
[New Thread 0x7fffecdb4700 (LWP 28918)]
[New Thread 0x7fffec3ae700 (LWP 28919)]
[New Thread 0x7fffebbad700 (LWP 28920)]
[New Thread 0x7fffeb3ac700 (LWP 28921)]
[New Thread 0x7fffeabab700 (LWP 28922)]
Success loading icon.png

Thread 1 "sfml" received signal SIGSEGV, Segmentation fault.
0x00007ffff6082c50 in _XData32 () from /usr/lib/libX11.so.6
(gdb) bt
#0  0x00007ffff6082c50 in _XData32 () from /usr/lib/libX11.so.6
#1  0x00007ffff605d683 in XChangeProperty () from /usr/lib/libX11.so.6
#2  0x00007ffff79752da in sf::priv::WindowImplX11::setIcon (this=0x7f3a40, width=256, height=256, 
    pixels=<optimized out>) at /build/sfml/src/SFML/src/SFML/Window/Unix/WindowImplX11.cpp:859
#3  0x000000000040151d in main () at sfml.cpp:20
(gdb) q

Seems 9996b7a is the problem. I tested the last revision before that commit and it worked. Problem is also present in latest revision 746bb9c

I ran into this on x86_64 Arch Linux installation with sfml-2.4.1-1

@binary1248 binary1248 added this to the 2.4.2 milestone Nov 26, 2016

@binary1248 binary1248 self-assigned this Nov 26, 2016

@binary1248 binary1248 added s:accepted and removed s:undecided labels Nov 26, 2016

binary1248 added a commit that referenced this issue Nov 26, 2016

Fixed Xlib crashing in sf::Window:setIcon because it expects the elem…
…ent data type passed to XChangeProperty to be unsigned long (architecture dependent 32-bit or 64-bit) instead of sf::Uint32 (architecture independent 32-bit) (#1168). Also adjusted other occurrences of wrong types passed to XChangeProperty with format set to 32.
@binary1248

This comment has been minimized.

Show comment
Hide comment
@binary1248

binary1248 Nov 26, 2016

Member

Should be fixed in #1171. @mstraube care to test?

Member

binary1248 commented Nov 26, 2016

Should be fixed in #1171. @mstraube care to test?

@ghost

This comment has been minimized.

Show comment
Hide comment
@ghost

ghost Nov 27, 2016

Yes, with #1171 it works.

ghost commented Nov 27, 2016

Yes, with #1171 it works.

binary1248 added a commit that referenced this issue Dec 3, 2016

Fixed Xlib crashing in sf::Window:setIcon because it expects the elem…
…ent data type passed to XChangeProperty to be unsigned long (architecture dependent 32-bit or 64-bit) instead of sf::Uint32 (architecture independent 32-bit) (#1168). Also adjusted other occurrences of wrong types passed to XChangeProperty with format set to 32.

eXpl0it3r added a commit that referenced this issue Jan 27, 2017

Fixed Xlib crashing in sf::Window:setIcon because it expects the elem…
…ent data type passed to XChangeProperty to be unsigned long (architecture dependent 32-bit or 64-bit) instead of sf::Uint32 (architecture independent 32-bit) (#1168). Also adjusted other occurrences of wrong types passed to XChangeProperty with format set to 32.

eXpl0it3r added a commit that referenced this issue Jan 28, 2017

Fixed Xlib crashing in sf::Window:setIcon because it expects the elem…
…ent data type passed to XChangeProperty to be unsigned long (architecture dependent 32-bit or 64-bit) instead of sf::Uint32 (architecture independent 32-bit) (#1168). Also adjusted other occurrences of wrong types passed to XChangeProperty with format set to 32.
@eXpl0it3r

This comment has been minimized.

Show comment
Hide comment
@eXpl0it3r

eXpl0it3r Feb 6, 2017

Member

Fixed with #1171

Member

eXpl0it3r commented Feb 6, 2017

Fixed with #1171

@eXpl0it3r eXpl0it3r closed this Feb 6, 2017

iamPHEN added a commit to Bablawn3d5/SFML that referenced this issue Mar 11, 2017

Fixed Xlib crashing in sf::Window:setIcon because it expects the elem…
…ent data type passed to XChangeProperty to be unsigned long (architecture dependent 32-bit or 64-bit) instead of sf::Uint32 (architecture independent 32-bit) (SFML#1168). Also adjusted other occurrences of wrong types passed to XChangeProperty with format set to 32.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment