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.


Topics - D

Pages: [1]
1
Graphics / 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.

2
Network / Usage of sf::Socket::Status in non-blocking sockets?
« on: January 17, 2011, 05:15:49 pm »
Hi. I'm using SFML2 in my project and non-blocking UDP socket. According to the API, I should get enum code 1 (NotReady), when I send data when the previous data hasn't been completely sent yet, do I understand this correctly?

When I run the code (just sending data in a loop), on OS X, I get enum code 3 (Error) when the previous data hasn't been sent yet. On Windows, I get 0 (Done) all the time. Either there's a bug in the library, or I'm just understanding the whole thing wrong. Receiving works correctly afaik.

3
Network / Any way to resolve local UDP port in SFML 1.6?
« on: December 15, 2010, 01:48:16 am »
Hi. I'm starting out with SFML and the networking side of it. My question is following: Am I able to resolve the local port that is used by sf::SocketUDP? I took a look at the SFML2.0 api, which has this method, which will eventually return the port I'm after. But is there a way to do that in 1.6?

I'm a complete beginner what comes to networking, so I'll explain a little more why I think I need that port.

Server binds a port (in my test case 51337). When client sends something to that port, it sends it via another free port, which is assigned to it by operating system. Right? So if server returns something to client after getting the packet from client, it replies it to the port that the data came from. But if the client wants to receive that data that server just sent, it needs to bind the socket it's using. And because I cant resolve the local port, I'll need to manually bind some port, which causes problems if I run another client and it uses the same port.

Does my thinking make any sense, or am I completely lost? :D Thanks for advance.

(I'm using SFML 1.6, C++ and Mac OS X 10.6)

Pages: [1]
anything