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

Author Topic: Double-free bug in SFML2 (at least on OS X)  (Read 1724 times)

0 Members and 1 Guest are viewing this topic.

D

  • Newbie
  • *
  • Posts: 12
    • View Profile
Double-free bug in SFML2 (at least on OS X)
« on: January 15, 2012, 01:13:11 am »
Hi. I compiled SFML2 main branch (from github) today, and discovered a bug that is caused by freeing a non-allocated pointer. The bug occurs after initializing a empty sf::String and when the program is calling its destructor:
Code: [Select]
#include <SFML/System.hpp>
int main()
{
    sf::String s;
    return 0;
}

Code: [Select]
~ ยป ./a.out                                                    
a.out(27893) malloc: *** error for object 0x100035300: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug


I did a quick glance through SFML's source code, but discovered nothing suspicious. sf::String is just a wrapper around std::basic_string<Uint32> after all...
I'm running OS X 10.6.8, SFML and the executable is in x86_64. Compiling the program in i386 architecture made no difference. I haven't been able to test this on other machines yet.

Oberon

  • Newbie
  • *
  • Posts: 19
    • View Profile
    • My Github profile
Double-free bug in SFML2 (at least on OS X)
« Reply #1 on: January 15, 2012, 09:33:11 am »
It's a known bug, but it seems to be Apple's fault: https://github.com/SFML/SFML/issues/5

Hiura

  • SFML Team
  • Hero Member
  • *****
  • Posts: 4321
    • View Profile
    • Email
Double-free bug in SFML2 (at least on OS X)
« Reply #2 on: January 15, 2012, 10:34:37 am »
Yes, this is indeed issue #5. I just added some more information and a solution to the issue on github.

But still no news from Apple one year after filling a bug repport...
SFML / OS X developer

D

  • Newbie
  • *
  • Posts: 12
    • View Profile
Double-free bug in SFML2 (at least on OS X)
« Reply #3 on: January 15, 2012, 11:18:44 am »
Thanks for replies. I didn't go through the issues list, sorry about that. Good to know that the problem lies in Apple's side, although it may take a long time before they will fix it, or if they will...