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

Author Topic: Greek or Cyrillic characters makes SFML crash under OS X  (Read 5135 times)

0 Members and 1 Guest are viewing this topic.

Skomakar'n

  • Newbie
  • *
  • Posts: 25
    • View Profile
Greek or Cyrillic characters makes SFML crash under OS X
« on: May 25, 2011, 07:39:47 am »
I've made a textfield that works pretty well, and under Linux, if it happens to deal with characters that don't add anything to the width of the rectangle around the rendered text, it simply doesn't store them. I don't know why Greek or Cyrillic characters won't work as I'm using wide character strings, so this is also something I would like to get an answer to. Many other characters, such as þ, ð, å, ä, ö, æ and ø work just fine.

The main problem here, though, is that when trying to type Greek or Cyrillic characters when running the program in Mac, the program will simply crash. This is the call stack that Xcode gave me (read from bottom to top):



Also, accented letters don't get noticed by OS X, but they work fine under Linux; that is, in Linux, I can, for instance, first press the grave accent key, and then the A key, and an á will actually appear in my textfield. OS X ignores the accent key and just gives me a regular a.

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Greek or Cyrillic characters makes SFML crash under OS X
« Reply #1 on: May 25, 2011, 10:54:36 am »
Which SFML version are you using ?
Want to play movies in your SFML application? Check out sfeMovie!

Skomakar'n

  • Newbie
  • *
  • Posts: 25
    • View Profile
Greek or Cyrillic characters makes SFML crash under OS X
« Reply #2 on: May 25, 2011, 03:27:57 pm »
Oh, sorry. 1.6. I'm running Snow Leopard on an Intel-based MacBook Pro. The problem has nothing to do with the textfield code or the TextEntered event. I booted up an old demo of the game, and it crashed as soon as I pressed a letter key using a Greek or Russian keyboard layout, too. As you can see in the call stack above, the bug is in SFML.

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Greek or Cyrillic characters makes SFML crash under OS X
« Reply #3 on: May 25, 2011, 04:46:36 pm »
I think we would need a minimal example producing this crash, because I've just been testing Greek or Russian keyboard layout and nothing special happened.

I dunno whether there's something particular to do, I've only used the default Window-based project and typed some letters with both layouts.
Want to play movies in your SFML application? Check out sfeMovie!

Skomakar'n

  • Newbie
  • *
  • Posts: 25
    • View Profile
Greek or Cyrillic characters makes SFML crash under OS X
« Reply #4 on: May 25, 2011, 08:11:38 pm »
Quote from: "Ceylo"
I think we would need a minimal example producing this crash, because I've just been testing Greek or Russian keyboard layout and nothing special happened.

I dunno whether there's something particular to do, I've only used the default Window-based project and typed some letters with both layouts.

It appears it doesn't happen if I compile using the terminal, but only when I compile using Xcode (Debug or Release mode doesn't matter)...

Any project, for that matter, as long as it uses a RenderWindow, at least.

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Greek or Cyrillic characters makes SFML crash under OS X
« Reply #5 on: May 25, 2011, 10:40:11 pm »
Hmm.. indeed it does crash with the graphics project. I'll have a look at it but not right now.
Want to play movies in your SFML application? Check out sfeMovie!

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Greek or Cyrillic characters makes SFML crash under OS X
« Reply #6 on: May 26, 2011, 11:35:15 am »
Does this problem happen also with 2.0 ? (If you have time to test)
SFML / OS X developer

Skomakar'n

  • Newbie
  • *
  • Posts: 25
    • View Profile
Greek or Cyrillic characters makes SFML crash under OS X
« Reply #7 on: May 27, 2011, 10:17:53 am »
Quote from: "Hiura"
Does this problem happen also with 2.0 ? (If you have time to test)

I don't have SFML 2, sorry (and I don't intend on getting it for this project; I've written probably fifteen to sixteen thousand lines so far... No way I'm changing all of that now, haha).

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Greek or Cyrillic characters makes SFML crash under OS X
« Reply #8 on: May 27, 2011, 10:34:27 am »
We're not asking you to convert your project, we just want you to test this particular problem with SFML 2 ;)

But if it can be reproduced easily, I guess Hiura or Ceylo can try it as well.
Laurent Gomila - SFML developer

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Greek or Cyrillic characters makes SFML crash under OS X
« Reply #9 on: May 27, 2011, 11:28:56 am »
Seems to work fine with SFML2 (at least no crash).
Want to play movies in your SFML application? Check out sfeMovie!

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Greek or Cyrillic characters makes SFML crash under OS X
« Reply #10 on: May 27, 2011, 11:51:45 am »
Quote from: "Ceylo"
Seems to work fine with SFML2 (at least no crash).
Thank you =)
SFML / OS X developer

Ceylo

  • Hero Member
  • *****
  • Posts: 2325
    • View Profile
    • http://sfemovie.yalir.org/
    • Email
Greek or Cyrillic characters makes SFML crash under OS X
« Reply #11 on: May 27, 2011, 11:51:51 am »
Code: [Select]
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0xf0b1b15e
0x0028a243 in sf::Input::OnEvent (this=0xbffff4a0, EventReceived=@0xbfffefc4) at /Users/ceylo/Downloads/SFML-1.6-sdk-macosx-ub32+64/build/xcode/../../src/SFML/Window/Input.cpp:112
112        case Event::KeyPressed :  myKeys[EventReceived.Key.Code] = true;  break;
(gdb) bt
#0  0x0028a243 in sf::Input::OnEvent (this=0xbffff4a0, EventReceived=@0xbfffefc4) at /Users/ceylo/Downloads/SFML-1.6-sdk-macosx-ub32+64/build/xcode/../../src/SFML/Window/Input.cpp:112
#1  0x0028d023 in std::_Rb_tree_const_iterator<sf::WindowListener*>::operator++ () at /Developer/SDKs/MacOSX10.5.sdk/usr/include/c++/4.0.0/bits/stl_tree.h:193
#2  0x0028d023 in sf::priv::WindowImpl::SendEvent (this=0x30b1bcba, EventToSend=@0xbfffefc4) at /Users/ceylo/Downloads/SFML-1.6-sdk-macosx-ub32+64/build/xcode/../../src/SFML/Window/WindowImpl.cpp:191
#3  0x0028f5c1 in sf::priv::WindowImplCocoa::HandleKeyDown (this=0x51a7e0, eventRef=0x53a3a0) at /Users/ceylo/Downloads/SFML-1.6-sdk-macosx-ub32+64/build/xcode/../../src/SFML/Window/Cocoa/WindowImplCocoa.mm:284
#4  0x9458ed38 in -[NSWindow sendEvent:] ()
#5  0x944a7817 in -[NSApplication sendEvent:] ()
#6  0x0028e298 in -[sfPrivAppController processEvents] (self=0x509e90, _cmd=0x2ca6b9) at /Users/ceylo/Downloads/SFML-1.6-sdk-macosx-ub32+64/build/xcode/../../src/SFML/Window/Cocoa/AppController.mm:397
#7  0x0028fe27 in sf::priv::WindowImplCocoa::ProcessEvents (this=0x51a7e0) at /Users/ceylo/Downloads/SFML-1.6-sdk-macosx-ub32+64/build/xcode/../../src/SFML/Window/Cocoa/WindowImplCocoa.mm:557
#8  0x0028b81b in sf::Window::GetEvent (this=0xbffff470, EventReceived=@0xbffff83c) at /Users/ceylo/Downloads/SFML-1.6-sdk-macosx-ub32+64/build/xcode/../../src/SFML/Window/Window.cpp:222
#9  0x000025ce in main ()
(gdb) print EventReceived.Key.Code
$1 = 816954554


 :roll:
Want to play movies in your SFML application? Check out sfeMovie!

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Greek or Cyrillic characters makes SFML crash under OS X
« Reply #12 on: May 27, 2011, 12:19:04 pm »
EventReceived.Key.Code must have an invalid value.

Anyway, if it works with SFML 2 it's not going to be fixed in 1.6, so don't waste too much time on this crash.
Laurent Gomila - SFML developer

Skomakar'n

  • Newbie
  • *
  • Posts: 25
    • View Profile
Greek or Cyrillic characters makes SFML crash under OS X
« Reply #13 on: May 28, 2011, 03:52:53 pm »
Quote from: "Laurent"
EventReceived.Key.Code must have an invalid value.

Anyway, if it works with SFML 2 it's not going to be fixed in 1.6, so don't waste too much time on this crash.

If Ceylo feels up to fixing it anyway, though, you're not going to stop him, are you, haha?

Maybe he doesn't, though...

Laurent

  • Administrator
  • Hero Member
  • *****
  • Posts: 32504
    • View Profile
    • SFML's website
    • Email
Greek or Cyrillic characters makes SFML crash under OS X
« Reply #14 on: May 28, 2011, 04:31:14 pm »
I won't stop him but there will be no release containing this fix ;)
Laurent Gomila - SFML developer

 

anything