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

Pages: [1]
1
General / Re: sf::Text::getLocalBounds causes segmentation fault?(SOLVED)
« on: January 03, 2016, 04:21:02 pm »
I downgraded to MinGW 4.9 and stopped using clang and it works.

2
General / Re: sf::Text::getLocalBounds causes segmentation fault?
« on: January 02, 2016, 06:59:15 pm »
So reading this thread back I wasn't clear at all what my config was which is probably confusing so here;
I'm using mingw 5.1.0 and compiling with clang 3.7.0.
I was able to get the code in the OP to work if I compiled in visual studio with the debug libs.
The crash happens at line 350 in Text.cpp
Code: [Select]
if (!m_geometryNeedUpdate)I noticed that sf::Text::ensureGeometryUpdate is called when rendering as well but it doesn't crash when I do that, only when I try to get the bounds (both getLocalBounds and getGlobalBounds).

3
General / Re: sf::Text::getLocalBounds causes segmentation fault?
« on: January 01, 2016, 08:33:03 pm »
Building with visual studio and release libs results in the same crash but using the debug libs works fine.
The same can't be said for mingw though, both release and debug have the same issue.
I'm not sure what info from the visual studio debugger you want me to give you, gdb gave me more info than I got from vs.

4
General / Re: sf::Text::getLocalBounds causes segmentation fault?
« on: January 01, 2016, 06:13:43 pm »

I checked, this is not the case.
Are you saying that it doesn't have a fault when you do have an event loop?

It still crashes with an event loop.

5
General / Re: sf::Text::getLocalBounds causes segmentation fault?
« on: January 01, 2016, 05:47:14 pm »
That's the thing, There wasn't an error message. Just the standard windows "whatever.exe has stopped working"
Run it in the debugger and in Debug mode. Then you get a more meaningful error message and see where exactly it crashes. Once you've done that, provide us with that information.

Best I can do is GDB because visual studio won't link properly for whatever reason.
(gdb) run
Starting program: Z:\Projects\test\test.exe
[New Thread 5868.0x2030]
[New Thread 5868.0x263c]
[New Thread 5868.0x211c]
[New Thread 5868.0x2a28]
[New Thread 5868.0x1c70]
[New Thread 5868.0x21cc]
[Thread 5868.0x1c70 exited with code 0]
[New Thread 5868.0x2aac]
[Thread 5868.0x2aac exited with code 0]
[New Thread 5868.0x2a80]
[New Thread 5868.0xa10]
[New Thread 5868.0x54c]
[New Thread 5868.0x2674]
[Thread 5868.0x2a80 exited with code 0]
[Thread 5868.0xa10 exited with code 0]
[New Thread 5868.0x1230]
[New Thread 5868.0x26a0]
[New Thread 5868.0x27d0]
font loaded..

Program received signal SIGSEGV, Segmentation fault.
0x0000000068eec64c in sf::Text::ensureGeometryUpdate (this=0x8000) at Z:\Source\SFML\src\SFML\Graphics\Text.cpp:350
350         if (!m_geometryNeedUpdate)

Is it crashing in any way with the event loop too?
I'm asking because your "crashing" is normal without the event loop, without an event loop in it your program is literally not responding to windows so that message appears.

I checked, this is not the case.

6
General / Re: sf::Text::getLocalBounds causes segmentation fault?
« on: January 01, 2016, 04:52:34 pm »
minimal example:
The example should also be "complete".
You left out the event code.

I don't see why it matters but I added it.
Is this an issue with SFML or my own code? It's driving me nuts.

7
General / Re: sf::Text::getLocalBounds causes segmentation fault?
« on: December 31, 2015, 08:06:26 pm »
That's the thing, There wasn't an error message. Just the standard windows "whatever.exe has stopped working"

8
General / sf::Text::getLocalBounds causes segmentation fault?(SOLVED)
« on: December 31, 2015, 06:16:24 pm »
Calling getLocalBounds on an sf::Text object causes a crash.

minimal example:
#include <iostream>
#include <SFML/Graphics.hpp>

int main()
{
  sf::Font f;
  f.loadFromFile("font.ttf");
  sf::Text t;
  t.setFont(f);
  t.setString("some string");
  t.setCharacterSize(16);
  sf::RenderWindow window(sf::VideoMode(1280, 720), "example", sf::Style::Close);
 
  while (window.isOpen())
  {
    sf::Event event;
    while (window.pollEvent(event))
    {
      if (event.type == sf::Event::Closed)
        window.close();
    }

    sf::FloatRect width = t.getLocalBounds();
    window.clear();

    window.display();

  }
}
 

My OS is Windows 10 Pro 64-bit. As far as I can tell nobody else is having this issue so maybe I'm just not using it correctly?

Pages: [1]