Ofunniku / dwarftherapist

Automatically exported from code.google.com/p/dwarftherapist
Other
0 stars 0 forks source link

is_valid_address(creature_vector) fails due to not properly calculating memory_correction #261

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Steps to reproduce on my system...
1. Start up Dwarf Fortress and run a save file or start a new region.  Start 
playing.
2. Start up Dwarf Therapist.
3. Watch as Dwarf Therapist says that you unloaded Dwarf Fortress.  The 
"Connect to DF" button becomes unselectable.

Error message: "Dwarf Fortress has either stopped running, or you unloaded your 
game.  Please re-connect when a fort is loaded."

0.5.5 of DT, Dwarf Fortress 0.31.08, both were downloaded TODAY from the 
respective official websites.  On Windows Vista Home SP2.

If I reverse steps 1 and 2, and instead start up Dwarf Therapist then Dwarf 
Fortress, Dwarf Therapist gives me a normal "cannot find Dwarf Fortress in 
memory, are you sure you're running it?" error and "Connect to DF" is 
selectable.  However, once I start up Dwarf Fortress and load a save/start a 
game, and hit "Connect to DF", the same error ("Dwarf fortress has either 
stopped running...") comes up and "Connect to DF" becomes unselectable the same 
as before.  So the error occurs whether I start DF then DT, or DT then DF.  It 
also occurs when each program is run under administrator mode.

run.log provided.

Original issue reported on code.google.com by redi...@gmail.com on 29 Jun 2010 at 1:01

Attachments:

GoogleCodeExporter commented 9 years ago
This also occurs with no modifications to Dwarf Fortress, no graphics packs, 
only minor config file changes (change from 2D to Standard mode, etc....) Many 
people report it happens on Mayday but I guess that just because a lot of 
people use Mayday. I am not using Mayday.  I have tried with 5 different 
regions and 2 different existing save files and all of them come up with this 
error.

Original comment by redi...@gmail.com on 29 Jun 2010 at 1:05

GoogleCodeExporter commented 9 years ago
Okay after many previous failed attempts, it randomly started working just now 
on a file that had previously given me this error on multiple occasions, about 
5 times, I had restarted my computer in between and even installed windows 
updates that I was missing and restarted again and tried it and it hadn't 
worked.

Yet, now, there it is... working peacefully with Dwarf Fortress.  I didn't 
change a thing.

Original comment by redi...@gmail.com on 29 Jun 2010 at 1:11

GoogleCodeExporter commented 9 years ago
I saw this exact issue just as you described it. Restarted my computer and it 
was gone. Twilight Zone.

Original comment by TylerCo...@gmail.com on 29 Jun 2010 at 5:44

GoogleCodeExporter commented 9 years ago
(Was:Dwarf Fortress has either stopped running, or you unloaded your game.)

Wow I just figured this out. Thank you for the report + the log. The issue is 
that DT asks the windows kernel for a list of memory pages that DF is using. 
These pages make up a series of valid regions of memory that DT will then use 
to determine valid vs invalid memory addresses. Since DF changes its 
base_address on each launch there is a possibility of the creature_vector 
falling into an "invalid" memory range. But it's only invalid because of some 
bad math the code is doing. 

The only workaround may be to restart DF until it's base_address falls into a 
valid range. I will fix this ASAP! Thank you again for the report!

Original comment by treyst...@gmail.com on 29 Jun 2010 at 6:59

GoogleCodeExporter commented 9 years ago
This issue was closed by revision 2fc36930f1.

Original comment by treyst...@gmail.com on 30 Jun 2010 at 2:50