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 - Zeeno

Pages: [1]
1
General / Re: Return code 234 on multithreading and Radeon
« on: November 13, 2013, 09:05:39 pm »
My guess would be the graphics driver especially on Linux. Have you tried a different driver?

Maybe others should test the code as well to make sure it's really hardware/driver related. Your and my code run here on Windows 8.1 with my AMD card without problems, exit nicely with 0.

Code does not work properly on glfxr drivers, but on open-source drivers it does end with 0 and print "Third". It would be nice to know why :)
I was worried that windows would pop message "Was this software running properly? - Yes - Reinstall" or something like that, every single time that program ends. Since it is only Linux-fglxr problem I guess that I can ignore this malfunction.
Thank you for all responses.

2
General / Re: Return code 234 on multithreading and Radeon
« on: November 13, 2013, 08:15:04 pm »
After last command in main. I can get by stepping as far as 'return 0;', but then gdb(using through NetBeans) quit and shows nothing. When i tried to debug new/delete version, gdb quits at 'delete gw;' and shows nothing more. Tried valgrind and strace to see whether I can find anything interesting, but valgrind shows more than 50 000 errors and also output of strace is very long.

3
General / Re: Return code 234 on multithreading and Radeon
« on: November 13, 2013, 08:05:14 pm »
I just let the main function end. It's basically bunch of loops waiting for the right moment (one of the game objects call level->stop()) and then all loops end. Even the code posted here doesn't work properly.
Starting program using "$ ./program.run" and than printing return value "echo $?" gives me 234. I am developing using NetBeans, and after hitting "Play" button the result is same.
In this thread's code I don't have a chance to close window (it opens and close as main() ends) and I don't force program to quit. It just ends itself with 234 return code.

4
General / Re: Return code 234 on multithreading and Radeon
« on: November 13, 2013, 07:25:23 pm »
Quote
You might be able to over come the crash with a better scope handling and it's most likely an issue with OpenGL contexts and order of destruction, but I'm lacking the knowledge how SFML has implemented things.

Generally speaking: Don't use global variables and don't use manual memory management.
You should also avoid "using namespace", because while it makes things easier to type at first, it will make everything more complicated later on, when you're trying to figure out, from where which class/type originates from, plus you avoid name clashes.
code....

This code also return code 234 for me. As i wrote, I tried many ways of creating RenderWindow. It just prints "One" and "Two" and then (when automatically trying to destroy RenderWindow) crashes.
I am rewriting my Engine from SDL2 to SFML2 and everything works fine, just the quiting of applications always crashes. Normally it wouldn't be a big issue, application is quitting, but I am wondered why.

5
General / Return code 234 on multithreading and Radeon
« on: November 13, 2013, 06:53:28 pm »
Hi,
I am switching from SDL2 to SFML2 and I've found a possible bug, but I am new to SFML, so I am not sure.
I've tried to google and read many topics so I think this is only a ATI driver problem.

My specification of Lenovo G585 notebook is
AMD APU E1-1200 with Radeon HD 7310
Lubuntu 13.10
Proprietary drivers (due to OpenCL support).

I am using SFML2.1 . Tried both, downloading libraries from http://www.sfml-dev.org/download/sfml/2.1/ and compiling from source with latest commit 4cddde79fe606e22a4327a8ec26ad62fc4a9b7f7 . Same result.

Program compile just fine, but when destroying RenderWindow object, program crash with 234 return code. Tried to allocate and destruct using new and delete (shown in the code) and creating RenderWindow as local variable as shown in tutorials, no change. In this example, stdout writes only "One" and "Two", than it crashes.
Compiled on Intel platform with Kubuntu 13.10 and program quits normally with exit code 0.

Do not know whether this problem is only multithreading-specific, in simple monothread application never crashed. I also tried to activate and deactivate window in threads, same result.

Can be this fixed? If no, is there any workaround like managing OpenGL context manually or inheriting RenderWindow and reimplementing deallocating and freeing resources?

#include <iostream>
#include <SFML/Graphics.hpp>
#include <thread>

using namespace sf;
using namespace std;

RenderWindow * gw;

void draw() {
    gw->clear(Color(0, 0, 0, 128));

    CircleShape c;
    c.setPosition(300, 200);
    c.setRadius(100);
    c.setFillColor(Color::Red);

    gw->draw(c);
    gw->display();
    gw->setActive(false);
}

int main(int argc, char** argv) {    
    gw = new RenderWindow(VideoMode(800, 600), "My window");
   
    gw->setActive(false);
    thread t(&draw);

    t.join();
    cout << "One" << endl;
    gw->close();
    cout << "Two" << endl;
    delete gw; //crashes here
    cout << "Three" << endl;

    return 0;
}
 

Thank you for your help and time.

Pages: [1]