Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Messages - dropout

Pages: [1]
1
Window / Re: Segfault creating a fullscreen window on linux X11
« on: September 21, 2012, 12:41:55 pm »
Quote
Can you post a link to what you found concerning execlp?

The clang warning about missing sentinel in variadic function lead me to these pages:
http://stackoverflow.com/questions/12095865/spurious-missing-sentinel-in-function-call
http://blog.vucica.net/2009/08/fixing-warning-missing-sentinel-in-function-call.html

I'm glad that I could help, SFML is great, if not the greatest :) Amazing work, clean API.

2
Window / Re: Segfault creating a fullscreen window on linux X11
« on: September 21, 2012, 11:25:53 am »
Yes, I'm on 64Bit Xubuntu 12.04 fresh clean install, dependencies added through apt.
If I remove the cast it reintroduces the problem.
I've just made some additional testing with g++ 4.6, doesn't show a warning but still it crashes with the same problem.
It happens with with g++ 4.7 too.
I'm no C++ expert, rather a noob so I'm just using bare logic here, but it looks like the 64bit system has different sizes of NULL / 0 and maybe that is causing the segmentation fault. People had the same problem with execlp that made me think the problem is the same with XCreateIC.
Why it happens only in fullscreen mode, I have really no idea.

3
Window / Re: Segfault creating a fullscreen window on linux X11
« on: September 21, 2012, 12:27:51 am »
Not sure about the cause...
Clang++ raised a warning which is eliminated by this cast, and now the full-screen mode works as expected.

4
Window / Re: Segfault creating a fullscreen window on linux X11
« on: September 20, 2012, 11:47:57 pm »
I couldn't rest on this problem so tried to find a solution, and it happens that a list of arguments XCreateIC takes must be ended with a casted NULL pointer.
https://github.com/dropout/SFML/compare/f5bca33eaa5d48ee613b07a1aea724794a8860ec...master
I made a pull request fixing it.


5
Window / Segfault creating a fullscreen window on linux X11
« on: September 20, 2012, 05:47:08 pm »
Hi Dear SFML users!

I experienced a problem while creating a fullscreen styled window with SFML 2.0.
I cloned the repo from github compiled with clang++, and using a fresh install of Xubuntu 12.04 stable.

I have the following simple code:

#include "SFML/Window.hpp"

int main( int argc, char** argv ) {
     
    sf::ContextSettings settings;
    settings.antialiasingLevel = 2;
    settings.depthBits = 24;
    settings.stencilBits = 8;    
   
    sf::Window win;
    win.create( sf::VideoMode(1024,768), "Hello World", sf::Style::Fullscreen, settings );
   
    while ( win.isOpen() ) {
       
        sf::Event event;
        while ( win.pollEvent(event) ) {            
            if (event.type == sf::Event::Closed) {
                win.close();
            }
        }

        win.display( );
    }
   
    return 0;    
}
 

This application crashes (SEGFAULT) when trying to create a sf::Style::FullScreen window.
It disables my secondary monitor and changes my primary monitors resolution to the desired one specified in the application.
I need to recover my whole desktop after the crash.

Here is my callstack:

?? ()  
XCreateIC ()   
sf::priv::WindowImplX11::initialize (this=0xe71c00)    
sf::priv::WindowImplX11::WindowImplX11 (this=0xe71c00, mode={width = 1024, height = 768, bitsPerPixel = 32}, title=@0x7fffffffe538: {_M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x8a8e18 \"Hello World\"}, static npos = <optimized out>}, style=8)     
sf::priv::WindowImpl::create (mode={width = 1024, height = 768, bitsPerPixel = 32}, title=@0x7fffffffe538: {_M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x8a8e18 \"Hello World\"}, static npos = <optimized out>}, style=8)      
sf::Window::create (this=0x7fffffffe560, mode={width = 1024, height = 768, bitsPerPixel = 32}, title=@0x7fffffffe538: {_M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<No data fields>}, <No data fields>}, _M_p = 0x8a8e18 \"Hello World\"}, static npos = <optimized out>}, style=8, settings=@0x7fffffffe588: {depthBits = 24, stencilBits = 8, antialiasingLevel = 2, majorVersion = 2, minorVersion = 0})   
main (argc=1, argv=0x7fffffffe698)     
 

The problem arises when calling WindowImplX11.cpp's initialize function especially on line 476:
m_inputMethod = XOpenIM(m_display, NULL, NULL, NULL);
    m_inputContext = XCreateIC(m_inputMethod,
                                   XNClientWindow, m_window,
                                   XNFocusWindow,  m_window,
                                   XNInputStyle,   XIMPreeditNothing  | XIMStatusNothing,
                                   NULL);
 

Has anyone experienced the same?
Maybe it's not an SFML issue rather than a issue related to X11 or maybe a specific distro Xubuntu, but I'm not experienced in linux window management and couldn't figure it out myself.
If you have any ideas, please share with me :)

Thanks for your input in advance!


Pages: [1]
anything