TADS Bug Database

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0000171TADS 3Interpreterpublic2012-09-30 22:132012-10-03 02:59
Assigned ToMichael Roberts 
PlatformAMDOSWindowsOS VersionXP SP3
Summary0000171: Date object creation fails
DescriptionAttempting to create a new Date object in any way causes the interpreter/workbench to crash to the desktop. If it is a member of another object that is viewed in the watch list, it will not be listed. This issue does not appear to extend to the TimeZone class, which is successfully created.
Steps To ReproduceCompiling and running the timezone.t test script included with the source code distribution will reproduce the crash.
TagsNo tags attached.
Fixed In Version3.1.3
Attached Files? file icon timezone.t [^] (2,523 bytes) 2012-09-30 22:13
txt file icon tadscrsh.txt [^] (52 bytes) 2012-09-30 22:15 [Show Content]
zip file icon datecrash.zip [^] (95,638 bytes) 2012-09-30 22:44
jpg file icon date-watch-expr.jpg [^] (35,922 bytes) 2012-10-02 01:42

png file icon case_of_the_missing_date.png [^] (19,866 bytes) 2012-10-02 02:30

- Relationships

-  Notes
Michael Roberts (administrator)
2012-09-30 22:39

I can't reproduce this - it seems to work fine for me. It would help if you could you give me the exact steps to reproduce. Specifically, are you running this in Workbench or on the command line via t3make/t3run command line? If it's Workbench, please provide the .t3m file and the exact series of steps (menu clicks, etc); if commadn line, please give me the exact commands you're running. I've tried it from both command line and Workbench without any problems.
MC (reporter)
2012-09-30 22:48

I'm running it via the Workbench. I've added a zipfile containing a project that repros the crash on my end. Steps followed:
Open Workbench
Create new Plain T3 project
Replace default code with timezone test code
Perform the "Full recompile for debugging" command
Start debugging (F5)
Michael Roberts (administrator)
2012-09-30 23:04

I'm still unable to reproduce it - the project you sent works fine for me. The tadscrsh.txt crash location makes me think that you might have a corrupted timezone database file. Try renaming timezones.t3tz in the TADS 3 program folder to some random other name (timezone.bak, say), then run the project again and see what happens - you should get an error ("invalid value for intrinsic function") at startup. If that goes as expected, KEEP THE BACKUP so I can debug it, and try installing afresh copy - I've posted one here: http://www.tads.org/patch/timezones.t3tz. [^] If that fixes it, please send me a copy of the original backup so that I can track down the bug - even with a corrupted database file the terp shouldn't crash, obviously.
MC (reporter)
2012-09-30 23:31

Hmm...no joy there. While renaming my timezones.t3tz did indeed produce that error, the one you provided still crashed. I ran a diff the two files, and they seem to be identical - I can't imagine that both files would be corrupted, so there has to be something else going on here.

I've also just now tested the debug executable in the Player Kit interpreter, and that also crashes, although the addresses are different:
    exc_handler = 005e71c0
    CS:EIP = 0000001b:004b55e2
Michael Roberts (administrator)
2012-10-01 00:41

Okay, it's not that. What's your Windows system time zone setting?
MC (reporter)
2012-10-01 01:24
edited on: 2012-10-01 01:55

Date and Time Properties shows "E. Australia Standard Time" under Date & Time, and "(GMT+10:00) Brisbane" under Time Zone.

Michael Roberts (administrator)
2012-10-01 19:32
edited on: 2012-10-01 19:34

"E. Australia Standard Time" is one of the known Windows zones in the database, so that shouldn't be a problem.

I found one possible problem that might be causing the crash, although I'm still not clear on how it's getting there. I've created an instrumented version of Workbench for you to try out - this should show one or more message boxes with some internal information. If you could run it and let me know what messages appear, that might help me understand what's going on. It's at http://www.tads.org/patch/htmltdb3-20121001.zip; [^] unzip it and replace your current htmltdb3.exe (after saving a backup) with the one from the zip file. Hopefully it'll fix the crash as well as displaying the diagnostic information, but the diagnostics should still be useful as there could be something else going wrong besides the crash.

MC (reporter)
2012-10-01 23:09

That seems to have done the trick. The Date object is created, I get a message box with the following message:
    [7] entry=no entry, local zone=E. Australia St-10
and the game goes on running. A Date object that is a member of another object still doesn't appear in the watch list, but adding it on its own will work, and local Date objects will correctly display in the locals list.

Thanks for looking into this, it's very much appreciated!
Michael Roberts (administrator)
2012-10-02 01:41
edited on: 2012-10-02 01:42

Good to hear the crash is resolved, and thanks for sending back the diagnostic info. There does still appear to be something wrong, but the particular thing wrong at least corroborates what I guessed about the code path leading to the crash. Apparently your local system time zone isn't getting matched to anything in the timezone database, so the system is creating an ad hoc timezone descriptor instead of using a database entry; that was where the errant code causing the crash was, so in a way it's good that this code got exercised so I could find and fix the bug. Even so, it *shouldn't* be running that code in the first place on your system, because you have a time zone setting that *should* be matching a database entry, namely Australia/Brisbane. I'd like to track down what's going wrong there, so I've uploaded another instrumented version for you to try out: http://www.tads.org/patch/htmltdb3-20121001a.zip. [^] This one should display an additional message box indicating the timezone information that TADS gets from Windows; hopefully that will shed some light on why TADS isn't able to match it to the appropriate entry in its database.

For the watch list problem, could you give me some more detail on what you're doing? I tried what I think you're describing and it's working fine for me. I'm attaching a screen shot (date-watch-expr.jpg) showing a watch window with an object with Date properties displayed, which seems to be what you're describing. If you could describe the exact steps you're taking, and maybe include a screen shot of the missing information, that might help me reproduce it.

MC (reporter)
2012-10-02 02:28
edited on: 2012-10-02 02:30

The new message box shows:
    [1a] no TZI; no zoneinfo key
As for the watch list issue, I wasn't creating a new instance of the Date object's parent, but doing that still doesn't make it appear. I can reproduce it on my end by modifying the cache object in datecrash.t so it reads:
    cache: object
        foobar = new Date()
        tz = static new TimeZone('America/Los_Angeles')
and, for testing purposes, adding these two lines to the end of main() (and setting a breakpoint on the last line):
    local foo = new cache();
I'm attaching a screenshot of the watch list and locals list, which shows the issue in action.

Michael Roberts (administrator)
2012-10-02 18:30

Thanks for explaining the watch list test case. That's actually correct behavior. When you set a property value to an expression in an object definition, you're creating a method - what you're doing is equivalent to this:

cache: object
  // foobar = new Date is identical to writing:
  foobar() { return new Date(); }

Expanding an object in the watch list or local variable list only shows property values, not methods, so that's why it's not listed. If you want to initialize it to a Date value statically, rather than make it a method, add the 'static' keyword:

  foobar = static new Date()

Thanks also for the new test run and diagnostic info. The "no TZI" message means that the Windows API call to ask for the system timezone setting failed, which isn't what I expected but does explain the other symptoms. I'll have to do a little research to find out what could cause that API call to fail; I'll let you know when I have more information.
Michael Roberts (administrator)
2012-10-02 19:39

Okay, I think I've figured it out - I was misinterpreting one of the return codes from the Windows API for fetching the timezone ID, which happens to be the return code that I think applies for your zone; MSFT confusingly refers to the code as "unknown" when it really means that the zone doesn't have an annual switch to daylight time (the "unknown" refers to the transition date, I suppose, but what they really mean is "known not to exist" rather than that it's a mystery). Anyway, I've uploaded another testing version to http://www.tads.org/patch/htmltdb3-20121002.zip. [^] If all goes well, you should get these messages now:

[1] entry=Australia/Brisbane, local zone=Australia/Brisbane
[1a] TZI.StandardName=E. Australia Standard Time; zoneinfo key=Australia/Brisbane

When you have a chance, give it a try and let me know how it goes - if you do indeed get those messages, I think that means it's finally working properly.
MC (reporter)
2012-10-02 20:31

Ah, I see. Thanks for explaining the watch list thing - I should have guessed it was something like that! As for the debug messages, all values are as expected except for entry, which is reported as "no tz".
Michael Roberts (administrator)
2012-10-03 02:59

Great - the "no tz" message is actually correct now that I look at it again. I think this is all working correctly now; the fix will be in the next update, and I've also uploaded a copy with the fixes (and sans message boxes) to http://www.tads.org/patch/workbench-fix-bug171.zip [^] in case you need a working copy in the meantime. Thanks again for your help tracking it down.

- Issue History
Date Modified Username Field Change
2012-09-30 22:13 MC New Issue
2012-09-30 22:13 MC File Added: timezone.t
2012-09-30 22:15 MC File Added: tadscrsh.txt
2012-09-30 22:39 Michael Roberts Note Added: 0000272
2012-09-30 22:39 Michael Roberts Status new => feedback
2012-09-30 22:39 Michael Roberts Resolution open => unable to reproduce
2012-09-30 22:44 MC File Added: datecrash.zip
2012-09-30 22:48 MC Note Added: 0000273
2012-09-30 23:04 Michael Roberts Note Added: 0000274
2012-09-30 23:05 Michael Roberts Assigned To => Michael Roberts
2012-09-30 23:31 MC Note Added: 0000275
2012-10-01 00:41 Michael Roberts Note Added: 0000276
2012-10-01 01:24 MC Note Added: 0000277
2012-10-01 01:55 MC Note Edited: 0000277
2012-10-01 19:32 Michael Roberts Note Added: 0000278
2012-10-01 19:34 Michael Roberts Note Edited: 0000278
2012-10-01 23:09 MC Note Added: 0000279
2012-10-02 01:41 Michael Roberts Note Added: 0000280
2012-10-02 01:42 Michael Roberts File Added: date-watch-expr.jpg
2012-10-02 01:42 Michael Roberts Note Edited: 0000280
2012-10-02 02:28 MC Note Added: 0000281
2012-10-02 02:28 MC Note Edited: 0000281
2012-10-02 02:29 MC Note Edited: 0000281
2012-10-02 02:30 MC Note Edited: 0000281
2012-10-02 02:30 MC File Added: case_of_the_missing_date.png
2012-10-02 18:30 Michael Roberts Note Added: 0000282
2012-10-02 19:39 Michael Roberts Note Added: 0000283
2012-10-02 20:31 MC Note Added: 0000284
2012-10-03 02:59 Michael Roberts Fixed In Version => 3.1.3
2012-10-03 02:59 Michael Roberts Note Added: 0000285
2012-10-03 02:59 Michael Roberts Status feedback => resolved
2012-10-03 02:59 Michael Roberts Resolution unable to reproduce => fixed

Copyright © 2000 - 2018 MantisBT Team
Powered by Mantis Bugtracker