-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Bare UNLOCK produces no response #16
Comments
A little more info: If you start a fresh game and enter
Since This all seems to match the original code in the PDF so it's not a transcription issue. tl;dr As to the segfaults I'm seeing, they are reproducible by enabling |
Neat — thanks for the writeup and diagnosis. As you surmise, I plan to leave the code as-is since it's not a transcription error and not a fatal bug (in the sense of "fatal to the player's experience," even if it is technically undefined behavior). If I ever get around to porting to C, I'll definitely want to plug these holes in some aesthetically pleasing way. I did a lot of that kind of thing with my ports of Adventure variants. Sample anecdote: Quuxplusone/Advent@39f13ab
I suspect that gfortran's default behavior is the same as if you said |
If we were really bored, we could look up the behavior of the OS/360 Fortran H Extended compiler ( I doubt that anyone would actually come across this in normal play so maybe the resolution is just to eventually document this as known and expected behavior. It's less for users than as a reminder of what to revise in an updated version. This is actually a pretty interesting edge case. It's not exactly a bug - it's not game-breaking and it's not an error with an obvious solution. It's more of an oversight or inconsistency in the UI. It's likely not intended behavior, but it's also not clear what the behavior was intended to be. Also, if you're interested I can send you a minimal PR to patch out the out-of-bounds array accesses in |
I'm not sure this is of interest for your goals of preserving the original gameplay but here goes:
If you enter a bare verb (single word) for a verb that expects an accompanying noun, you generally get a response like
You don't have it with you.
orThat would be a neat trick.
UNLO
(unlock) doesn't produce any output. Hittingreturn
will give you the expectedI didn't get that!!
response. The game isn't hung but you'd never know from looking at it.I'm not sure if this is a bug in the transcription or just an oversight in the original coding. I tested this on the
patches
branch, latest commit (ca1aac9) with and withoutasa
. I'm building withgfortran
10.2.0 on both OSX and Windows 10, and 9.3.0 on Linux; I see the same behavior on all three.tl; dr This came up during testing while modernizing the code from F66 (with a sprinkling of F77) to F2018. Eleven bare verbs were causing segfaults by setting
ACTION(2)
to zero and passing it upstream tomain
. Inmain
,ACTION(2)
is aliased toOBJECT
and in some cases this is used to index an array. Fortran array indices start at 1 (unless otherwise changed but that's F90 onward). I believe legacy behavior is to return a 0 or blank for an index of zero which might be why the code isn't segfaulting (I may have broken something while refactoringfread
andinput
) The other bare verbs that I've seen segfault areIn your unmodified code, the only issue I found was with
UNLO
; the others seem ok.The text was updated successfully, but these errors were encountered: