Report ID | 494 | Title | Memory Issues |
Product | Archived MegaZeux Bugs | Status | Fixed (Severity 3 - Medium) |
Version | - | Fixed in | 2.92f |
Introduced In Version | ---- | Operating System | Linux |
Report ID #494: Memory Issues
#1 Lachesis
Posted 14 June 2012 - 09:39 PM
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
Replies (1 - 15)
#2 Lachesis
Posted 14 June 2012 - 09:42 PM
==27744== LEAK SUMMARY: ==27744== definitely lost: 4,188 bytes in 13 blocks ==27744== indirectly lost: 176 bytes in 4 blocks ==27744== possibly lost: 70,009 bytes in 1,375 blocks ==27744== still reachable: 134,938 bytes in 1,394 blocks ==27744== suppressed: 0 bytes in 0 blocks
No longer occurs, probably was due to a bug in zlib and/or libpng.
This leak was likely caused by saving uninitialized data in the board name array (2.84b world.c:705; ftell is right after the board names are saved). The ZIP save equivalent of this report was fixed in GIT 5b5bbf0a.
This post has been edited by Lachesis: 27 September 2020 - 09:13 PM
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
#3 Lachesis
Posted 14 June 2012 - 11:26 PM
<<removed>>
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
#4 Lachesis
Posted 14 June 2012 - 11:31 PM
==27969== 26 bytes in 1 blocks are definitely lost in loss record 58 of 309 ==27969== at 0x4C28254: realloc (vg_replace_malloc.c:525) ==27969== by 0x4E804FD: check_realloc (util.c:110) ==27969== by 0x4E6977F: reallocate_robot (robot.c:842) ==27969== by 0x51C5798: delete_robot_lines (robo_ed.c:344) ==27969== by 0x51CCBA3: robot_editor (robo_ed.c:4254) ==27969== by 0x51C4C78: edit_robot (param.c:1091) ==27969== by 0x51B4A4F: change_param (edit.c:446) ==27969== by 0x51B526A: thing_menu (edit.c:675) ==27969== by 0x51B7F17: __edit_world (edit.c:1797) ==27969== by 0x4E5ACA7: title_screen (game.c:2470) ==27969== by 0x404675: main (main.c:163)
Leak fixed -- something wasn't getting freed during testing.
<<removed>>
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
#5 ajs
Posted 16 June 2012 - 10:42 AM
The syscall warning from ftell() looks like a valgrind bug -- even if it isn't, and it's a libc bug, I don't think you can fix it. Add it to valgrind.supp in the root directory of the MZX sources (you might also want to remove all the SDL ones we put there because I guess they've been fixed??).
"Conditional jump or move depends on uninitialised value(s)" this is probably a bug, I think you'll need to install the debug symbols for zlib and libpng (if your distro doesn't have them, just build them from source and put them in LD_LIBRARY_PATH so it loads then preferentially). Then you can use gdb to figure out what line triggers the valgrind error. I'd guess it's a libpng bug?
--ajs.
#6 ajs
Posted 16 June 2012 - 10:45 AM
http://bugs.debian.o....cgi?bug=577135
Which is a valgrind false positive due to some weird code structure in zlib. Apparently fixed in newer zlibs.
--ajs.
#7 Lachesis
Posted 16 June 2012 - 06:06 PM
I'm using whatever zlib is in the Ubuntu 10.10 repository. Time to upgrade.
I did a quick search on the Syscall one and it looks like Chromium development had the same issue crop up in Linux -- all they did was added it to their .supp, which sounds like probably the best thing to do in this case.
I still need to look further into the other "definitely lost" bug -- there's also at least 8 more bytes being "definitely lost" per run but I missed those in the full memory check log, the full memory check ignores suppressions so there's a lot to skip past.
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
#8 Lachesis
Posted 13 December 2012 - 02:40 PM
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
#9 Lachesis
Posted 11 July 2019 - 05:42 AM
There's a new leak I'm seeing with AddressSanitizer and make test where sometimes the vlayer is leaked. Not sure what the cause is, and fsafetranslate seems buggy wrt directories when testing with valgrind, so make test doesn't even work. I don't know why the backtrace is obfuscated, as --fno-omit-stack-pointer is enabled, but it's definitely the vlayer.
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
#10 Lachesis
Posted 17 July 2019 - 08:50 AM
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
#11 Lachesis
Posted 28 September 2020 - 08:18 AM
Other recent changes of note:
- valgrind
- GIT b917914a and GIT 8e9759d3 updated the valgrind suppressions to silence misc. library bugs.
- AddressSanitizer
- GIT 5b5bbf0a fixed the modern equivalent of that save_world ftell uninitialized read bug above. This was being reported because the board name buffers were not initialized past their null terminators.
- ThreadSanitizer
- Currently fixing the bad synchronization in sfx.c, which ThreadSanitizer has repeatedly noted. (Turns out a circular buffer designed for DOS doesn't really translate well to threads, who'd have thought!)
- ThreadSanitizer complains about the thread ID checking I added to make the audio lock debug messages appear less. This should be fixed.
- Currently fixing the bad synchronization in sfx.c, which ThreadSanitizer has repeatedly noted. (Turns out a circular buffer designed for DOS doesn't really translate well to threads, who'd have thought!)
Also, since this issue has a very badly defined scope, it's now about these threading issues and that delete_robot_lines leak. New valgrind/AddressSanitizer/ThreadSanitizer/etc reports aside from these after 2.92f is released should get their own issues.
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
#12 Lachesis
Posted 30 September 2020 - 04:18 AM
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
#13 Lachesis
Posted 01 October 2020 - 07:17 AM
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
#14 Lachesis
Posted 10 October 2020 - 05:41 AM
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository
#15 Lachesis
Posted 16 January 2021 - 09:45 PM
Issue fixed in: 2.92f
As mentioned above, I think further reports should get new issues so they are easier to keep track of. (Finally closing this thing...)
xx̊y (OST) - HELLQUEST (OST) - Zeux I: Labyrinth of Zeux (OST) (DOS OST)
w/ Lancer-X and/or asgromo: Pandora's Gate - Thanatos Insignia - no True(n) - For Elise OST
MegaZeux: Online Help File - Keycode Guide - Joystick Guide - Official GIT Repository