bugWarzone 2100 Project - Bugs: bug #11976, Invalid reads in physfs remove...

 
 
Show feedback again

You are not allowed to post comments on this tracker with your current authentification level.

bug #11976: Invalid reads in physfs remove search path function

Submitted by:  Per I. Mathisen <per>
Submitted on:  Mon 07 Jul 2008 01:08:22 PM UTC  
 
Category: NoneSeverity: Important
Priority: 7 - HighStatus: None
Assigned to: NoneOpen/Closed: Open
Release: svn/trunkOperating System: GNU/Linux
Planned Release: None

Sun 14 Sep 2008 08:36:52 PM UTC, SVN revision 6028:

Trunk is currently broken when playing music and switching between the "base" and "mp" mods, see ticket:57.

This revision fixes ticket:57. We (Buginator, EvilGuru and Giel) decided to use the fix suggested in ticket:57 for now and to use [wiki:Proposal:ModMounting] on a later date. I.e. fix the problem now (however dirty the solution may be), and implement a properly designed one later on, instead of letting trunk remain broken until said proposal is worked out in enough detail.

This revision fixes bug #11847, bug #11875, bug #11898, bug #11976, bug #11989, bug #12017, bug #12250 and bug #12280.

Patch by Buginator and myself

(Browse SVN revision 6028)

Giel van Schijndel <muggenhor>
Project Member
Mon 08 Sep 2008 04:49:27 AM UTC, comment #4:

I am not so sure anymore, since with the fix that fixes the playlist issue, we may still see this...

also note bug #12280 & bug #11847

Bugs Buggy <buginator>
Project Administrator
Sat 12 Jul 2008 02:28:44 AM UTC, comment #3:

Looks like the issue with the playlist is the result of physfs 1.1.1 being bugged.

Revert back to 1.0, and it works as it should.

This also explains why per didn't have any issues with it, since he is using a older version of physfs than the rest of us.

--Buggy

Anonymous
Mon 07 Jul 2008 08:45:06 PM UTC, comment #2:

I suspect the valgrind warning appears when PHYSFS_removeFromSearchPath is called with a path that is not in the search path.

I can reproduce the problem simply by starting and quitting Warzone under valgrind. Fedora Core 9, physfs version 1.0.1.

Per I. Mathisen <per>
Project Administrator
Mon 07 Jul 2008 04:08:03 PM UTC, comment #1:

PhysFS internaly has a bug which causes invalid reads in case nothing is mounted? I am not exactly sure what you said the issue is, or under which conditions it appears.

I assume you use 1.0.0 from Debian?

We'd need to talk to Ryan whether that was fixed in 1.1.
If it is not, I'll have a look into the code and see what I can do.

Dennis Schridde <devurandom>
Project Administrator
Mon 07 Jul 2008 01:08:22 PM UTC, original submission:

valgrind reports:

==9340== Invalid read of size 8
==9340== at 0x4C29C27: freeDirInfo (physfs.c:604)
==9340== by 0x4C29CF0: PHYSFS_removeFromSearchPath (physfs.c:1006)
==9340== by 0x485D1D: removeSubdirs (main.c:190)
==9340== by 0x46BEA9: rebuildSearchPath (init.c:257)
==9340== by 0x46BDEE: rebuildSearchPath (init.c:240)
==9340== by 0x48072E: levLoadData (levels.c:676)
==9340== by 0x486828: startGameLoop (main.c:555)
==9340== by 0x486BC5: runTitleLoop (main.c:707)
==9340== by 0x486DEC: mainLoop (main.c:825)
==9340== by 0x48719B: main (main.c:971)
==9340== Address 0x11181528 is not stack'd, malloc'd or (recently) free'd
==9340==
==9340== Invalid read of size 8
==9340== at 0x4C29C27: freeDirInfo (physfs.c:604)
==9340== by 0x4C29CF0: PHYSFS_removeFromSearchPath (physfs.c:1006)
==9340== by 0x46BF52: rebuildSearchPath (init.c:268)
==9340== by 0x46BDEE: rebuildSearchPath (init.c:240)
==9340== by 0x48072E: levLoadData (levels.c:676)
==9340== by 0x486828: startGameLoop (main.c:555)
==9340== by 0x486BC5: runTitleLoop (main.c:707)
==9340== by 0x486DEC: mainLoop (main.c:825)
==9340== by 0x48719B: main (main.c:971)
==9340== Address 0x11181528 is not stack'd, malloc'd or (recently) free'd
==9340==
==9340== Invalid read of size 8
==9340== at 0x4C29C27: freeDirInfo (physfs.c:604)
==9340== by 0x4C29CF0: PHYSFS_removeFromSearchPath (physfs.c:1006)
==9340== by 0x46BFC0: rebuildSearchPath (init.c:276)
==9340== by 0x46BDEE: rebuildSearchPath (init.c:240)
==9340== by 0x48072E: levLoadData (levels.c:676)
==9340== by 0x486828: startGameLoop (main.c:555)
==9340== by 0x486BC5: runTitleLoop (main.c:707)
==9340== by 0x486DEC: mainLoop (main.c:825)
==9340== by 0x48719B: main (main.c:971)
==9340== Address 0x11181528 is not stack'd, malloc'd or (recently) free'd
==9340==
==9340== Invalid read of size 8
==9340== at 0x4C29C27: freeDirInfo (physfs.c:604)
==9340== by 0x4C29CF0: PHYSFS_removeFromSearchPath (physfs.c:1006)
==9340== by 0x46C3A7: rebuildSearchPath (init.c:354)
==9340== by 0x46BDEE: rebuildSearchPath (init.c:240)
==9340== by 0x48072E: levLoadData (levels.c:676)
==9340== by 0x486828: startGameLoop (main.c:555)
==9340== by 0x486BC5: runTitleLoop (main.c:707)
==9340== by 0x486DEC: mainLoop (main.c:825)
==9340== by 0x48719B: main (main.c:971)
==9340== Address 0x11181528 is not stack'd, malloc'd or (recently) free'd
==9340==
==9340== Invalid read of size 8
==9340== at 0x4C29C27: freeDirInfo (physfs.c:604)
==9340== by 0x4C29CF0: PHYSFS_removeFromSearchPath (physfs.c:1006)
==9340== by 0x46C0E0: rebuildSearchPath (init.c:299)
==9340== by 0x48072E: levLoadData (levels.c:676)
==9340== by 0x486828: startGameLoop (main.c:555)
==9340== by 0x486BC5: runTitleLoop (main.c:707)
==9340== by 0x486DEC: mainLoop (main.c:825)
==9340== by 0x48719B: main (main.c:971)
==9340== Address 0x11181528 is not stack'd, malloc'd or (recently) free'd

Checking the return values from the PHYSFS_removeFromSearchPath calls, indicates a great many bad calls, where the search path is not present. It seems physfs handles this badly.

Per I. Mathisen <per>
Project Administrator

 

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by devurandom (Posted a comment)
  • -unavailable- added by per (Submitted the item)
  • -unavailable- added by per
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follows 1 latest change.

    Date Changed By Updated Field Previous Value => Replaced By
    Mon 07 Jul 2008 01:08:23 PM UTCperCarbon-Copy-=>Added devurandom
    Show feedback again

    Back to the top


    Powered by Savane 3.1-cleanup