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

Author Topic: SIGTRAP after SetText()  (Read 2535 times)

0 Members and 1 Guest are viewing this topic.

Foaly

  • Sr. Member
  • ****
  • Posts: 453
    • View Profile
SIGTRAP after SetText()
« on: June 29, 2011, 08:32:03 pm »
Hello there,
I have a little problem here and I hope that somebody can help me. I have been working on a game for quiet some time now and everything seemed to work fine. I'm not home for a couple of weeks now, but I wanted to continue working on my game. So i brought all the files with me and set everything up on a different computer. The program compiles just fine. But when i tried to fire up the debugger a weird thing happened. The program just crashed out of nowhere at start up. All the debugger was saying was:
Code: [Select]
Program received signal SIGTRAP, Trace/breakpoint trap.
In ?? () ()
Debugger finished with status 0

Of course that is useless as could be. The call stack did show anything interesting either. So I tried different things, but none of them seemed to work at all. Then i had the idea to update my IDE (i am using Code::Blocks 10.05). So i downloaded the debugger nighly (26 June 2011 build (rev 7257)). I still got the same error, but this time the debugger messages were a little more detailed. This time the call stack looked like this:
Code: [Select]
#0 7C90120F ntdll!DbgUiConnectToDbg() (C:\WINDOWS\system32\ntdll.dll:??)
#1 7C96EE31 ntdll!RtlpNtMakeTemporaryKey() (C:\WINDOWS\system32\ntdll.dll:??)
#2 7C96F26E ntdll!RtlpNtMakeTemporaryKey() (C:\WINDOWS\system32\ntdll.dll:??)
#3 7C970456 ntdll!RtlpNtMakeTemporaryKey() (C:\WINDOWS\system32\ntdll.dll:??)
#4 7C94BAFC ntdll!LdrFindEntryForAddress() (C:\WINDOWS\system32\ntdll.dll:??)
#5 015E0000 ?? () (??:??)
#6 7C91A1BA ntdll!RtlpUnWaitCriticalSection() (C:\WINDOWS\system32\ntdll.dll:??)
#7 77C2C2DE msvcrt!free() (C:\WINDOWS\system32\msvcrt.dll:??)
#8 015E0000 ?? () (??:??)
#9 00A25CCD __gnu_cxx::new_allocator<char>::deallocate(this=0x22fd2b, __p=0x679e9c34 "") (d:/programmes/mingw-4.4/bin/../lib/gcc/mingw32/4.4.0/include/c++/ext/new_allocator.h:95)
#10 00A4771D std::basic_string<unsigned int, std::char_traits<unsigned int>, std::allocator<unsigned int> >::_Rep::_M_destroy(this=0x679e9c34, __a=...) (d:/programmes/mingw-4.4/bin/../lib/gcc/mingw32/4.4.0/include/c++/bits/basic_string.tcc:427)
#11 00A4777E std::basic_string<unsigned int, std::char_traits<unsigned int>, std::allocator<unsigned int> >::_Rep::_M_dispose(this=0x679e9c34, __a=...) (d:/programmes/mingw-4.4/bin/../lib/gcc/mingw32/4.4.0/include/c++/bits/basic_string.h:231)
#12 00A47B00 std::basic_string<unsigned int, std::char_traits<unsigned int>, std::allocator<unsigned int> >::assign(this=0x15e8ba0, __str=...) (d:/programmes/mingw-4.4/bin/../lib/gcc/mingw32/4.4.0/include/c++/bits/basic_string.tcc:251)
#13 00A47EEC std::basic_string<unsigned int, std::char_traits<unsigned int>, std::allocator<unsigned int> >::operator=(this=0x15e8ba0, __str=...) (d:/programmes/mingw-4.4/bin/../lib/gcc/mingw32/4.4.0/include/c++/bits/basic_string.h:506)
#14 00A250CC sf::Unicode::Text::operator=(this=0x15e8ba0) (../../include/SFML/System/Unicode.hpp:64)
#15 00983958 sf::String::SetText(this=0x15e8af4, Text=...) (D:\dev\sfml\sdk\SFML-1.6\src\SFML\Graphics\String.cpp:68)
#16 00409629 CMainMenu::Init(this=0x15e8880) (..\Src\MainMenu.cpp:9)

The part of the code that the error is referring too looks like this:
Code: [Select]
In the header file:
sf::String creditsHeader;

and in the .cpp file:
creditsHeader.SetFont(sf::Font::GetDefaultFont());
creditsHeader.SetText("Credits");
creditsHeader.SetSize(80);

So I am really lost on this one and I don't know anything more that I could try... I hope somebody can help me.

Here are some more information on the system and versions:
Windows XP SP3
SFML 1.6
gcc 4.5.2

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
SFML / OS X developer

Haikarainen

  • Guest
SIGTRAP after SetText()
« Reply #2 on: July 02, 2011, 07:36:38 am »
It's a known bug, I would recommend using SFML2, its pretty stable and has a lot of bugfixes since 1.6. It's also really easy to install if you follow this guide:

http://www.sfml-dev.org/tutorials/2.0/compile-with-cmake.php

Foaly

  • Sr. Member
  • ****
  • Posts: 453
    • View Profile
SIGTRAP after SetText()
« Reply #3 on: July 05, 2011, 03:47:21 pm »
Thank for the replys, but sadly this doesn't help...
I tried to use a couple different fonts, but I still get the same error...
In my code it looks like this:
Code: [Select]
//first this
m_pHeaderFont = new sf::Font();
if(!m_pHeaderFont->LoadFromFile("data/LiberationSerif-Regular.ttf", 80))
    LOG_ERROR("Error loading font.");

// and later on this
creditsHeader.SetFont(*m_pHeaderFont);
creditsHeader.SetText("Credits");
creditsHeader.SetSize(80);

Is there any other solution for this?

Haikarainen

  • Guest
SIGTRAP after SetText()
« Reply #4 on: July 05, 2011, 04:01:16 pm »
Quote from: "Foaly"
Thank for the replys, but sadly this doesn't help...
I tried to use a couple different fonts, but I still get the same error...
In my code it looks like this:
Code: [Select]
//first this
m_pHeaderFont = new sf::Font();
if(!m_pHeaderFont->LoadFromFile("data/LiberationSerif-Regular.ttf", 80))
    LOG_ERROR("Error loading font.");

// and later on this
creditsHeader.SetFont(*m_pHeaderFont);
creditsHeader.SetText("Credits");
creditsHeader.SetSize(80);

Is there any other solution for this?


Upgrade to SFML2. Its a branch in development but all the bugfixes and improvements makes it worth it.

 

anything