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

Author Topic: Tutorial Segmentation Fault  (Read 5253 times)

0 Members and 1 Guest are viewing this topic.

Wurstinator

  • Newbie
  • *
  • Posts: 33
    • View Profile
Tutorial Segmentation Fault
« on: September 01, 2013, 11:00:27 pm »
Hi,
I compiled the tutorial code (http://www.sfml-dev.org/tutorials/2.1/start-linux.php) on my virtual Ubuntu 12.04 32-bit machine.
However, the first line
sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
causes a Segmentation Fault and the process terminates.

I am using the 32-bit version for Linux of SFML 2.1.

#include <SFML/Graphics.hpp>

int main()
{
    sf::RenderWindow window(sf::VideoMode(200, 200), "SFML works!");
    sf::CircleShape shape(100.f);
    shape.setFillColor(sf::Color::Green);

    while (window.isOpen())
    {
        sf::Event event;
        while (window.pollEvent(event))
        {
            if (event.type == sf::Event::Closed)
                window.close();
        }

        window.clear();
        window.draw(shape);
        window.display();
    }

    return 0;
}

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11045
    • View Profile
    • development blog
    • Email
Re: Tutorial Segmentation Fault
« Reply #1 on: September 01, 2013, 11:46:55 pm »
on my virtual Ubuntu 12.04 32-bit machine.
As in VirtualBox? Well if you'd run it through the debugger, you'd see that it crashes in the graphics driver of VirtualBox, so it's essentially an issue with VirtualBox. I'm having the same issue and I haven't found I way to get it working.
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

Wurstinator

  • Newbie
  • *
  • Posts: 33
    • View Profile
Re: Tutorial Segmentation Fault
« Reply #2 on: September 02, 2013, 01:20:53 pm »
Well, that's a bummer. Guess I have to get it running on Windows now.

Thanks for the answer anyway.

Lo-X

  • Hero Member
  • *****
  • Posts: 618
    • View Profile
    • My personal website, with CV, portfolio and projects
Re: Tutorial Segmentation Fault
« Reply #3 on: September 02, 2013, 01:27:40 pm »
on my virtual Ubuntu 12.04 32-bit machine.
As in VirtualBox? Well if you'd run it through the debugger, you'd see that it crashes in the graphics driver of VirtualBox, so it's essentially an issue with VirtualBox. I'm having the same issue and I haven't found I way to get it working.

Wierd :o

I cross compile for windows using virtual box each time I need to, I even "cross" compile the same way from linux 64 to linux 32b because I'm too lazy to handle flags and its handy for testing, and it works too.
I wonder what's the changing factor that make you both crash

Grimshaw

  • Hero Member
  • *****
  • Posts: 631
  • Nephilim SDK
    • View Profile
Re: Tutorial Segmentation Fault
« Reply #4 on: September 02, 2013, 02:52:56 pm »
I think I had the same problem with the virtual box but then it worked fine. I think I had to set some kind of flag via terminal in the mesa drivers or something..Not really sure anymore :p

eXpl0it3r

  • SFML Team
  • Hero Member
  • *****
  • Posts: 11045
    • View Profile
    • development blog
    • Email
AW: Tutorial Segmentation Fault
« Reply #5 on: September 03, 2013, 09:41:48 pm »
Well running VB on Windows and compiling for Linux, is something else than compiling for Windows on Linux.
But yeah it just might be a settings issue...
Official FAQ: https://www.sfml-dev.org/faq.php
Official Discord Server: https://discord.gg/nr4X7Fh
——————————————————————
Dev Blog: https://duerrenberger.dev/blog/

amireldor

  • Newbie
  • *
  • Posts: 7
    • View Profile
    • Email
Re: Tutorial Segmentation Fault
« Reply #6 on: December 28, 2013, 03:04:07 am »
Solved.

I also had something like this, the application was segfaulting immediately. The backtrace showed something with virtualbox-dri.

I removed the installed guest additions (in my case, with aptitude), "inserted" the updated VirtualBox guest additions CD and installed them. Rebooted the guest machine, and now my application runs inside the VM :)