Closed GoogleCodeExporter closed 9 years ago
Here are two run.log files, one from 32-bit Ubuntu Lucid and one from 64-bit
Ubuntu Lucid. Both are running on the same physical hardware (the 32-bit Ubuntu
is inside a virtual machine). Both are running the official SDL Linux version
of DF downloaded from the Bay 12 front page, and in both I did the same set of
steps:
1) Embark on a new fort.
2) Pause DF, run DT.
3) In DT, choose a dwarf with neither Carpentry nor Wood Cutting. Give him
Carpentry.
4) Commit pending changes in DT.
5) Unpause DF.
6) Pause DF again.
7) Give the same dwarf Wood Cutting.
8) Commit pending changes in DT.
9) Unpause DF.
At this point, I had no problems on 32-bit DF. 64-bit DF, however, segfaulted
on me immediately.
Original comment by robin.m...@gmail.com
on 21 Jul 2010 at 7:26
Attachments:
Oops, I put the wrong log files up. Real ones coming in a couple minutes.
Original comment by robin.m...@gmail.com
on 21 Jul 2010 at 7:32
Okay, here are the correct log files. Looking through with a side-by-side
difference viewer (vimdiff), I don't see any significant difference in what
Dwarf Therapist is trying to do. However, DF kept running just fine on 32-bit
Linux when I did this sequence of steps, but the EXACT same sequence of steps
on 64-bit Linux caused a crash. Same memory mapping file, same version of DF,
same save file... I eliminated every difference I could find, but one segfaults
and the other doesn't.
Hope you have better luck than I did at figuring out why this is crashing.
Original comment by robin.m...@gmail.com
on 21 Jul 2010 at 7:45
Attachments:
By compiling Dwarf Therapist as a 32-bit application (which I did by adding
-m32 to the CFLAGS, CPPFLAGS, and LFLAGS in the Makefile, and also replacing
-L/usr/lib with -L/usr/lib32 in the Makefile's LIBS variable), this crash has
stopped happening.
I'm guessing there are places in the Dwarf Therapist code that assume that
"int" is a 32-bit value, which isn't true in 64-bit land. So they end up
writing more than they should into Dwarf Fortress's memory, and changing the
value of some pointer DF uses. Hence the segfault the instant DF unpauses.
At any rate, while the bug is not gone, I've found a workaround that makes DT
useable for me, so I'm happy. Hopefully this bug report will allow other 64-bit
Linux users to use DT as well.
Original comment by robin.m...@gmail.com
on 27 Jul 2010 at 3:47
Original comment by treyst...@gmail.com
on 13 Oct 2010 at 4:41
Hey, i could reproduce the bug, and it is indeed a problem with the word size
on 64bit systems. The ptrace call that is used to write data back to the DF
memory writes 8 bytes on x86-64, but the code assumed 4 bytes everywhere.
I'm pretty sure it killed my last fortress, because DF segfaulted when saving,
which pissed me of pretty bad, because that was an awesome location, and I
guess i can't recreate it anymore... Well, at least it pissed me of so much
that I stopped playing DF and fiddling around with DT, and I've fixed the bug.
It's in the attached patch, please test it on a 32bit system, but it seems
pretty straight forward.
Cheers, Andreas
Original comment by ANeumann...@googlemail.com
on 21 Nov 2010 at 7:11
Attachments:
Original comment by ehler...@gmail.com
on 23 Nov 2010 at 12:05
Accepted the change, doesn't seem to cause issue on 32-bit systems. Still need
to verify on a 64-bit system and start 64-bit distribution. The changeset
30211af284cc has these changes.
Original comment by ehler...@gmail.com
on 24 Nov 2010 at 12:38
Original issue reported on code.google.com by
robin.m...@gmail.com
on 21 Jul 2010 at 7:10