[CF-Devel] Re: [CF List] Server crashes during Dragon Quest (CVS 07/21)

Peter Mardahl peterm at tesla.EECS.Berkeley.EDU
Wed Jul 26 13:41:22 CDT 2000


Hello,
  
  This was fundamentally a problem with the style map
styles/wallstyles/cave2.

  I realized my wall code couldn't handle something named rough_wall
but could handle something called roughwall, so I made duplicate arches
of rough_wall named roughwall.  This provided backward compatibility with
existing maps without requiring a change, and allowed my random map code
to work properly.

  To fix it, I fixed styles/wallstyles/cave2 to use "roughwall" instead of
"rough_wall".

  I also patched "treasure.c" so that it won't crash even if the wallstyle
is improper.

  I do not believe that the failure to find "rough_2_1_1" caused the crashing
for Mr. McKenney, because that code was written to gracefully fail:  indeed,
in the map, it always uses the "+" style of wall (which looks ugly,
but still blocks movement) instead of failing on not finding "rough_2_1_1".

  Anyway, the QUICK fix to this is to simply change the name of the
archetype in
maps/styles/wallstyles/cave2
from
rough_wall
to roughwall

  I could not repeat Mr. McKenney's crash during my own testing:  instead
I found a different crash, which I fixed.

  I will continue trying to repeat Mr. McKenney's crash.

PeterM


 


>
     
      Frank McKenney wrote:
     
     >
     
      > Failure #1
     
     >
     
      > ----------
     
     >
     
      >     --snip--
     
     >
     
      >     Couldn't find archetype rough_2_1_1
     
     >
     
      >     Couldn't find archetype rough_2_1_1
     
     >
     
      >     Couldn't find archetype rough_2_1_1
     
     >
     
     
     >
     
       That object does not appear to exist.  I think it should in fact be a
     
     >
     
      rough_wall_2_1_1 - I don't see rough_2_1_1 being used in any of the map files
     
     >
     
      (include the styles), so my initial guess would be that the random_map code i
     
     >
     
     s
     
     >
     
      improperly truncating the name.
     
     >
     
     
     >
     
       Since I see the SIGSEGV right after that, my guess is that the removing a
     
     >
     
      removed object is just an after effect.
     
     >
     
     
     >
     
       Looking at random_map/wall.c (around line 170), it does appear that the code
     
     >
     
      there does not deal with wall codes that may have an underscore in the name.
     
     >
     
     
     >
     
       I'm not familiar specifically what that function does.  I do note that all t
     
     >
     
     he
     
     >
     
      styles/wall files are a format of ..._0 (ie, rough_wall_0, gwall_0, etc), so 
     
     >
     
     it
     
     >
     
      would seem possible that maybe that fact could be used in truncating the wall
     
     >
     
      name.
     
     >
     
     
     >
     
       The other possibilities I could think of in that function is to check the ne
     
     >
     
     xt
     
     >
     
      character - if a number, presume that is the underscore we want to stop at, i
     
     >
     
     f
     
     >
     
      another letter, presume it is part of the arch basename.
     
     >
     
     
     >
     
       Peter - you probably know more about that section of code than I do.
     
     >
     
     
     >
     
       I don't know if the editor or any other functions may have similar assumptio
     
     >
     
     ns
     
     >
     
      about the autojoining walls or not.  If so, either those need to be fixed or
     
     >
     
      perhaps we should rename rough_wall to be roughwall instead (I don't know how
     
     >
     
      many maps may be using the first form that would require updating)
     
     >
     
      _______________________________________________
     
     >
     
      crossfire-list mailing list
     
     >
     
     
      crossfire-list at lists.real-time.com
      
      
     >
     
     
      https://mailman.real-time.com/mailman/listinfo/crossfire-list
      
      
     
    


More information about the crossfire mailing list