|
valgrind reporting 1000000 still reachable blocks at the end of my program |
Michael Taboada
Member #14,161
March 2012
|
Hi, |
SiegeLord
Member #7,827
October 2006
|
We fixed a ton of memory leaks from 5.0.11 to 5.1.x. Does Arch come with the unstable packages? "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
Michael Taboada
Member #14,161
March 2012
|
Hi, |
Peter Hull
Member #1,136
March 2001
|
Just for you, I installed Allegro 5.0.11 and libspeechd and your code for horseshoes and bash-it and game-kit. This is under Ubuntu.For horseshoes I got a black screen and some background music playing. For bash-it, just the black screen. I couldn't easily figure out what to expect or what was wrong from the code. Have you tried much simpler programs (i.e. the allegro examples)? If you still get X errors and valgrind reports with those we know it's allegro itself and not your code. I think we need to sort this out before proceeding. Pete
|
Chris Katko
Member #1,881
January 2002
|
Peter Hull said: Just for you, I installed Allegro 5.0.11 and libspeechd and your code for horseshoes and bash-it and game-kit. This is under Ubuntu.For horseshoes I got a black screen and some background music playing. For bash-it, just the black screen. I couldn't easily figure out what to expect or what was wrong from the code. Wow. You really deserve a hand shake for going through that much effort. I bought you a Reddit Silver: http://i.imgur.com/wMXXlHN.jpg (Also, if you actually want Reddit gold, PM me your account and I'll buy you one.) Quote: Have you tried much simpler programs (i.e. the allegro examples)? If you still get X errors and valgrind reports with those we know it's allegro itself and not your code. This, a thousand times this. For future reference, Michael, Peter is hitting the nail on the head when it comes to memory leaks from a library. Always check the example code because it will (usually) be bug free. (Which means it's something you're doing.) If the example fails, then you've got a simple, succinct piece of code that demonstrates the problem that everyone can easily check so you don't have to chop up your own program to recreate the bug just to demonstrate it. I once thought I found an Allegro bug with putpixel. It turned out I ended up having a very obscure uninitialized variable issue that caused an problem very far away and only showed up in Allegro functions. It wasn't Allegro at all. The point here is that your code can make it look like Allegro is the problem if you give Allegro bad data to start with. So that's what we're trying to rule out here. -----sig: |
Peter Hull
Member #1,136
March 2001
|
I've done a bit more on this. For me, valgrind also reports a lot of stuff, virtually all of which (AFAICS) comes from the graphics driver. The next step would to be to write the suppression file for these and see what's left. If you can go to 5.1, I would recommend that because it's better in many ways as SiegeLord says. Although it's classified as 'unstable' that just means liable to change rather than buggy. And I don't think it's liable to change much at this time. Finally, on bash-it, it seems to me that you aren't calling dynamic_menu::set_font anywhere, so nothing is being printed on screen because font is NULL. Is the code on github the same as what you're working with? Cheers,
|
Bruce Pascoe
Member #15,931
April 2015
|
I think we need to drop the "unstable" moniker, it seems to scare users away unnecessarily. In my experience 5.1 has actually been more reliable than 5.0, which is why I made the plunge for minisphere early on. In fact most of the bugfix work lately seems to go directly into 5.1, with only some of those fixes being backported.
|
SiegeLord
Member #7,827
October 2006
|
There'll be a 5.2 release soonish to resolve this stable/unstable conundrum . "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
Michael Taboada
Member #14,161
March 2012
|
Hi all, |
Peter Hull
Member #1,136
March 2001
|
OK, let us know how you get on. I'm not sure I can be of much help, unfortunately.
|
SiegeLord
Member #7,827
October 2006
|
I just ran horseshoes through valgrind and, after supressing a whole bunch of fglrx errors (see the attached suppression file) pretty much every remaining error was not Allegro's fault! One Allegro-related leak in your code is this piece of code in game-kit/allegro_stuff/sound.cpp: s = al_load_sample(((string)(al_path_cstr(al_get_standard_path(ALLEGRO_RESOURCES_PATH), '/'))+file).c_str()); You actually need to free the return value of al_get_standard_path, like so: ALLEGRO_PATH* path = al_get_standard_path(ALLEGRO_RESOURCES_PATH); s = al_load_sample(((string) (al_path_cstr(path, '/'))+file).c_str()); al_destroy_path(path);
"For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
|