[solved] Problem running Project: Starfighter


diligentcircle

Well-Known Member
Joined
Aug 29, 2011
Messages
1,594
Age
31
Location
Milky Way galaxy
Website
onpon4.github.io
So, for the past week or so, I've been working on porting Project: Starfighter to the Pandora.


I am pleased to say that I'm almost done. I have successfully reduced the game's original resolution of 800x600 to 800x480, with some invaluable assistance from the most active maintainer of Project: Starfighter on Sourceforge. I've also changed the controls to better suit the Pandora. Here is what I've got so far:


http://www.mediafire...3jce0xccez6x4kw


BUT, I've hit a roadblock. I was able to successfully compile the source with the C/C++ Development Tools PND, but whenever I try to run it, I get this error, which doesn't show up on a Linux PC, after the intro screen:



Code:
*** glibc detected *** ./starfighter: corrupted double-linked list: [hexadecimal number, memory address I assume] ***

Aborted


Anyone see the problem or have any ideas why this error would show up on the Pandora, but not on a Linux PC?


To compile and run, just download the C/C++ Development Tools PND (if you don't have it), edit the makefile to point to an SD card or USB drive you have (it's set to SD_APPS, since I have an SD card with that label; change SD_APPS to an SD card or USB drive you have), run the PND, go to the source directory, make, make install.


I tried to use Valgrind, which turned up in a search of this error, but for the life of me I can't figure out how to compile it on the Pandora. The docs are all over the place and point to non-existent files, while doing "make" causes it to tell me that there's no makefile, and I see no configure script anywhere. There isn't a file called "Makefile" or "makefile", but there are files called "Makefile.am" and "Makefile.in". I'm guessing the version of make in the PND is old or something? I'm not very familiar with make.
 
Last edited by a moderator:
I would look into areas where objects are being delete/free. Things like trying to access a previously deleted address can be the cause i.e a attempt to double delete


As you are trying valgrind is really the tool of choice to debug this, although arm support may not be complete. You may want to try running it in the x86 valgrind build.


Another more tedious option is trying to use gdb and step line by line until you hit the right spot. Or place a wrapper around delete's with printf's to try and catch the exact one.
 
I would look into areas where objects are being delete/free. Things like trying to access a previously deleted address can be the cause i.e a attempt to double delete


As you are trying valgrind is really the tool of choice to debug this, although arm support may not be complete. You may want to try running it in the x86 valgrind build.


Another more tedious option is trying to use gdb and step line by line until you hit the right spot. Or place a wrapper around delete's with printf's to try and catch the exact one.
Thanks for the advice! I've found and fixed it. The culprit was this recent change to git, which I had incorporated:


https://sourceforge.net/p/pr-starfighter/code/ci/f51dbd0669453290fb167caa7de8578cfcb7f7fd/tree/code/resources.cpp?diff=336a0798fa1edf55f757b059dd082d66df8c124d


I'll bring this up to the devs at SourceForge so they can look at it. It's funny how it didn't cause a problem on normal PCs.
 
what is the pixel depth for shipShape? (should match your screen depth)


My assumption is that your pandora version has a 16 bpp depth, but this code is assuming 32 bpp pixel data, so your most likely exceeding the range of the pixel array.



Either way that code is not safe for non 32 bit per color images.
 
Last edited by a moderator:
Back
Top