xboxscene.org forums

Author Topic: Dev Errors On Stepmania  (Read 84 times)

jsrlepage

  • Archived User
  • Full Member
  • *
  • Posts: 115
Dev Errors On Stepmania
« on: August 04, 2004, 01:06:00 PM »

NOTE: For the heck of it and because it's free : http://stepmaniax.blogspot.com/

Hi all.

As you know, Xport did way back a port of Stepmania to Xbox.

Not so long from now the geeks at stepmania compiled one version but it wasn't running. so i tagged along and am in somewhat charge of the Xbox porting effort. Read : i'm the only "official" dev who's workin on an Xbox version :-P

Now I'm in somewhat of a "shit". My problem is that I can get output on TV, and all, but one simple thing is blocking me. For example, let's say we're in SongManager.cpp, which also is my actual bug. I have the InitAll procedure. It is reached, yatta! But the bug is that whenever it tries to call a procedure inside itself, CRASH. Like when SongManager::InitAll calls the local procedure InitSongsFromDisk, which is inside SongManager.cpp/the object, bam, crash. But when I call InitSongsFromDisk from outside of SongManager, it's reached. But then again, it tries to call a local function and crashes.

Anyone has an idea on this? like compiler options or something?

This post has been edited by jsrlepage on Aug 5 2004, 06:21 AM
Logged

fghjj

  • Archived User
  • Sr. Member
  • *
  • Posts: 288
Dev Errors On Stepmania
« Reply #1 on: August 04, 2004, 03:35:00 PM »

I don't know any compiler options that affect basic C++ syntax like this, maybe you can post some code and debug info (try using breakpoints perhaps?).
Logged

jsrlepage

  • Archived User
  • Full Member
  • *
  • Posts: 115
Dev Errors On Stepmania
« Reply #2 on: August 04, 2004, 07:30:00 PM »

i used endless loops to get where the bug is.

like

CODE

void SongManager::InitAll( LoadingWindow *ld )
{
   ld->SetText("InitAll Reached!");
   ld->Paint();
   LOG->Info("InitAll");
   while(true){}
   SONGMAN->InitSongsFromDisk(ld);
   //this->
   
   InitCoursesFromDisk( ld );
   InitAutogenCourses();
   /* This shouldn't need to be here; if it's taking long enough that this is
  * even visible, we should be fixing it, not showing a progress display. */
   if( ld )
  ld->SetText( "Saving Catalog.xml ..." );
   SaveCatalogXml();
}

void SongManager::Reload( LoadingWindow *ld )
{
   FlushDirCache();

   if( ld )
  ld->SetText( "Reloading ..." );

   // save scores before unloading songs, of the scores will be lost
   PROFILEMAN->SaveMachineProfile();

   FreeSongs();
   FreeCourses();

   /* Always check songs for changes. */
   const bool OldVal = PREFSMAN->m_bFastLoad;
   PREFSMAN->m_bFastLoad = false;

   InitAll( ld ); <- IT WON'T REACH PARENT

   // reload scores afterward
   PROFILEMAN->LoadMachineProfile();

   PREFSMAN->m_bFastLoad = OldVal;
}

/*
 * © 2001-2004 Chris Danford, Glenn Maynard
 * All rights reserved.
 *
 * Permission is hereby granted, free of charge, to any person obtaining a
 * copy of this software and associated documentation files (the
 * "Software"), to deal in the Software without restriction, including
 * without limitation the rights to use, copy, modify, merge, publish,
 * distribute, and/or sell copies of the Software, and to permit persons to
 * whom the Software is furnished to do so, provided that the above
 * copyright notice(s) and this permission notice appear in all copies of
 * the Software and that both the above copyright notice(s) and this
 * permission notice appear in supporting documentation.
 *
 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF
 * THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS
 * INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT
 * OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
 * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
 * OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
 * PERFORMANCE OF THIS SOFTWARE.
 */

had to do it folks.

This post has been edited by jsrlepage on Aug 5 2004, 05:29 AM
Logged

fghjj

  • Archived User
  • Sr. Member
  • *
  • Posts: 288
Dev Errors On Stepmania
« Reply #3 on: August 04, 2004, 09:25:00 PM »

First of all, please use code tags whenever necessary.
CODE
thanks :)
Much more readable that way.

Ontopic now, I'm pretty sure that calling member functions of a class isn't the problem here. Setting while(true) loops won't help you to solve runtime problems in complicated apps like StepMania.

I suggest you read up on C++ debugging, like breakpoints, watches and call stacks. The XDK has an excellent set of debugging tools, you could try finding out how to use them by taking a look at existing projects, like XBMC or the XDK-samples provided by M$.
Logged

jsrlepage

  • Archived User
  • Full Member
  • *
  • Posts: 115
Dev Errors On Stepmania
« Reply #4 on: August 04, 2004, 09:28:00 PM »

small update : won't tell my new bug, but now the problem is somewhat more precise : XDK doesn't like to reference a pointer. ld is a pointer, and is also passed as a reference to another proc. that it ain't liking.
Logged

jsrlepage

  • Archived User
  • Full Member
  • *
  • Posts: 115
Dev Errors On Stepmania
« Reply #5 on: August 05, 2004, 10:27:00 AM »

I know it's a bump, kill me if you want, but I just blogged this issue.

I have created a blog at http://stepmaniax.blogspot.com/ for those interested in contributing either by coding or by ideas. Go nuts.
Logged

d0wnlab

  • Archived User
  • Sr. Member
  • *
  • Posts: 326
Dev Errors On Stepmania
« Reply #6 on: August 05, 2004, 09:59:00 PM »

uhm.  I've run into something similiar to this in c++ coding in linux/windows.  Usually what I've found is the problem is that you haven't allocated the object that is attempting a local call properly.

IE the songmanager object wherever it's being created in the original code is being misallocated somehow.  This has lead me to similiar problems where GDB will stop in the middle of calling the actual function with a seg fault.  I'd suggest running a debugger and seeing what the 'this' pointer looks like at crash time, imho it will be invalid.
Logged

jsrlepage

  • Archived User
  • Full Member
  • *
  • Posts: 115
Dev Errors On Stepmania
« Reply #7 on: August 05, 2004, 11:27:00 PM »

i have got through it for the moment. seems some compiler options were misconfigured.

the fact is, now there's another bug. which'll be posted on my blog asap.

involves FOR loops.
Logged

Mage

  • Archived User
  • Sr. Member
  • *
  • Posts: 482
Dev Errors On Stepmania
« Reply #8 on: August 05, 2004, 11:46:00 PM »

99.9% chance it is your code, the compilers used in the xdk are standard msvc++ compilers.
Logged