Skip to content
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

Build times out waiting for string #640

Merged
merged 1 commit into from
Jun 20, 2018
Merged

Build times out waiting for string #640

merged 1 commit into from
Jun 20, 2018

Conversation

larsbrinkhoff
Copy link
Member

It always seems to die for me in the same place, waiting on the string EINIT even though it's right there.

build-log.txt

Steps to reproduce:

git clone https://github.com/PDP-10/its.git
cd its
git submodule init
git submodule update
make EMULATOR=klh10

I also tried building with simh. It still dies as the same place waiting for EINIT.

@36bit
Copy link
Contributor Author

36bit commented Jan 26, 2018

I should also say this is with Ubuntu 17.10 (Artful Aardvark.)
Lars mentioned in the IRC channel that it worked for him on 14.04 and 16.04 although I could not duplicate that success on 14.04.

@aap
Copy link
Member

aap commented Jan 26, 2018

There is a timeout defined in build.tcl (set timeout 100). I had to increase it when i built on a raspi once.

@36bit
Copy link
Contributor Author

36bit commented Jan 26, 2018

Thanks. I added an extra 0 to that, setting the timeout to 1000. The outcome was the same although it took longer to get there.

I also tried replacing expect "EINIT" with sleep 75 to see if that might get beyond this stage but it still timed out.

I also tried setting it to expect "IT IS NOW" in case it's looking just at the last line but that, too, did not make a difference. It still times out.

@larsbrinkhoff
Copy link
Member

I think we need some expect/TCL debugging to see what's really going on. I don't have such expertise myself.

@larsbrinkhoff
Copy link
Member

larsbrinkhoff commented Jan 26, 2018

https://wiki.tcl.tk/3173 suggests to invoke expect with -d.

Other hints are to use log_file, log_user, and exp_internal.

Some more here: http://wiki.tcl.tk/473#pagetoce1b59b05

@36bit
Copy link
Contributor Author

36bit commented Jan 26, 2018

Oh yes, that was helpful. Doing using -d shows that it is not hanging over EINIT as originally thought but it's waiting for the next thing in build.tcl. It is timing out waiting for :EJ which never appears.

expect: does " >\r\nIT IS NOW 3:09:15 PM EST, FRIDAY, JAN 26,20" (spawn_id exp10) match exact string ":EJ"? no
expect: timed out

The last command timed out.
make: *** [out/rp0.dsk] Error 1
Makefile:31: recipe for target 'out/rp0.dsk' failed

@larsbrinkhoff
Copy link
Member

In that case, I wonder why your build doesn't generate the -> DSK messages. This is what it looks like when I build:

Compressing file DSK: EMACS1; BUFFER >
Compressing file DSK: EMACS1; CRL >
Compressing file DSK: EMACS1; VARS >
 -> DSK: EMACS; [PURE] >
Compressing file DSK: EMACS1; PURIFY >
Compressing file DSK: EMACS1; CCL >
 -> DSK: EMACS; [PRFY] >
Compressing file DSK: EMACS1; EINIT >
 -> DSK: EMACS; EINIT ^Q:EJ

@larsbrinkhoff
Copy link
Member

Maybe we can look for > instead of :EJ.

@larsbrinkhoff
Copy link
Member

Hello @36bit,

I have made a branch called lars/colon-ej. Can you test it and see if you get past this section of the build script?

Maybe it'll grind to a halt further on, but let's try this first.

@36bit
Copy link
Contributor Author

36bit commented Feb 2, 2018

It does indeed seem to get further:

*:kill
*:link sys3;ts teco,.teco.;tecpur >
*
DB     HACTRN SYS3   TS     TECO   LINK   11:27:46
:link sys2;ts emacs,emacs;ts >
*
DB     HACTRN SYS2   TS     EMACS  LINK   11:27:47
:emacs


EMACS Editor, version 162 - type Help(^_H) for help.


M-X run Library$einit$? Generate
Compressing file DSK: EMACS1; DOC >
Compressing file DSK: EMACS1; USRCOM >
Compressing file DSK: EMACS1; ^RBASE >
Compressing file DSK: EMACS1; WRDLST >
Compressing file DSK: EMACS1; INDENT >
Compressing file DSK: EMACS1; SEARCH >
Compressing file DSK: EMACS1; FILES >
Compressing file DSK: EMACS1; SUPPRT >
Compressing file DSK: EMACS1; ISEARC >
Compressing file DSK: EMACS1; WINDOW >
Compressing file DSK: EMACS1; BUFFER >
Compressing file DSK: EMACS1; CRL >
Compressing file DSK: EMACS1; VARS >
Compressing file DSK: EMACS1; PURIFY >
Compressing file DSK: EMACS1; CCL >
Compressing file DSK: EMACS1; EINIT >


M-X generate Library$emacs;aux$emacs1;aux
Compressing file DSK: EMACS1; AUX >
 -> DSK: EMACS; AUX ^Q:EJ

*:kill
*:delete emacs;ts 126
*:delete [prfy] <
*:delete [pure] 162
*:rename [pure] 163, [pure
IT IS NOW 11:27:55 AM EST, FRIDAY, FEB 2,2018
] 162
DSK: EMACS; [PURE] 163 - FILE NOT FOUND

The last command timed out.
Makefile:31: recipe for target 'out/rp0.dsk' failed

From doing the build with the debug switch:

expect: does "ND
IDAY, FEB 2,2018\r\ne] 162\r\nDSK: EMACS; [PURE] 163 - FILE NOT FOUND\r\n" (spawn_id exp10) match exact string "*"? no
expect: timed out

@larsbrinkhoff
Copy link
Member

Thanks. Bad luck there, the "ITS IS NOW..." message interrupts the :rename command.

Does this happen consistently at this point?

@36bit
Copy link
Contributor Author

36bit commented Feb 2, 2018

Does this happen consistently at this point?

It does seem to. I've tried it 4 times and it seems to vary: It might chop [pure and the closing ] onto a separate line or maybe [pure] will be fine and the 162 will go onto a new line.

@larsbrinkhoff
Copy link
Member

@eswenson1 saw something similar when trying to build in macOS.

@larsbrinkhoff
Copy link
Member

I think the -> ... :EJ message comes from CCL. Could be a problem with timestamps?

    0[5                             !* If there's an old pure file more recent than!
    1:< er^]2^[ fs if cdate^[u5 ec>   !* all COMPRS files, no need to purify.!
    Q5"n q5-q4"g 0^\''

    FT_->_^]2                       !* Otherwise, we must purify, so tell user.!

@larsbrinkhoff
Copy link
Member

larsbrinkhoff commented Feb 24, 2018

I was experimenting with generating library files from EMACS. There was no -> message, and also there was no new :EJ file written out. Turns out the ITS clock was not set. After running :PDSET, the message appeared and the file was written.

So if there is no ->, there really is a problem. Expecting some other string only masks the problem.

I will now check if the clock is set correctly on every boot.

@larsbrinkhoff
Copy link
Member

The clock is not set correctly when running in SIMH after a call to maybe_pdset in build.tcl.

@larsbrinkhoff
Copy link
Member

Hello @36bit,

Can you try the lars/pdset branch?

@36bit
Copy link
Contributor Author

36bit commented Feb 26, 2018

*:load sysbin;teco bin  
*dumpit$g'TECO$:
$Y $
DSK: SYSBIN; TECO BIN   
DB     HACTRN SYSBIN _DUMP_ OUTPUT WRITE  16:30:01
DB     HACTRN SYSBIN TECO   BIN    DELRNM 16:30:01
*Purified
:PDUMP$
DSK: .TECO.; TECPUR 1212
*:kill
*:link sys3;ts teco,.teco.;tecpur >
*
DB     HACTRN SYS3   TS     TECO   LINK   16:30:05
:link sys2;ts emacs,emacs;ts >
*
DB     HACTRN SYS2   TS     EMACS  LINK   16:30:07
:emacs


EMACS Editor, version 162 - type Help(^_H) for help.


M-X run Library$einit$? Generate
Compressing file DSK: EMACS1; DOC >
Compressing file DSK: EMACS1; USRCOM >
Compressing file DSK: EMACS1; ^RBASE >
Compressing file DSK: EMACS1; WRDLST >
Compressing file DSK: EMACS1; INDENT >
Compressing file DSK: EMACS1; SEARCH >
Compressing file DSK: EMACS1; FILES >
Compressing file DSK: EMACS1; SUPPRT >
Compressing file DSK: EMACS1; ISEARC >
Compressing file DSK: EMACS1; WINDOW >
Compressing file DSK: EMACS1; BUFFER >
Compressing file DSK: EMACS1; CRL >
Compressing file DSK: EMACS1; VARS >
Compressing file DSK: EMACS1; PURIFY >
Compressing file DSK: EMACS1; CCL >
Compressing file DSK: EMACS1; EINIT >

The last command timed out.
Makefile:32: recipe for target 'out/rp0.dsk' failed
make: *** [out/rp0.dsk] Error 1

@36bit
Copy link
Contributor Author

36bit commented Feb 26, 2018

The process was the same except for checking out the branch:

git clone https://github.com/PDP-10/its.git
cd its
git checkout lars/pdset
git submodule init
git submodule update
make EMULATOR=klh10

@larsbrinkhoff
Copy link
Member

Thanks for testing!

@larsbrinkhoff
Copy link
Member

Can you check timestamps of :EJ and COMPRS files? I.e. log in and list the EMACS and EMACS1 directories.

@larsbrinkhoff
Copy link
Member

larsbrinkhoff commented Jun 15, 2018

I have now run into this myself, so I had a chance to examine the state of the system more closely.

It seems files written by DUMP have timestamps a few hours later than what the system clock is set to. This wrecks havoc with EMACS compression. It only compresses files when needed, i.e. the source files are old. In this case it looks to EMACS as if they are new.

@larsbrinkhoff
Copy link
Member

I'm checking a successful build and see that the EMACS1 file timestamps are weeks old. They match the files from the Unix host.

I'm rerunning a build on my machine with timestamps updated to "right now".

Maybe a fix would be to set back all timestamps in the src/emacs1 directory.

@larsbrinkhoff
Copy link
Member

Still works on my machine, but I see the timestamps in ITS are six hours before those in Unix.

@larsbrinkhoff
Copy link
Member

Setting back the timestamps two days seems to be a workaround on the previously failing build host.

@larsbrinkhoff
Copy link
Member

@36bit, can you test this?

@larsbrinkhoff larsbrinkhoff force-pushed the lars/emacs1 branch 2 times, most recently from 5991d9b to eeaf034 Compare June 18, 2018 10:00
@larsbrinkhoff
Copy link
Member

larsbrinkhoff commented Jun 18, 2018

This "24 hours ago" workaround didn't work for me on a fresh repository. So apparently it's something about checking out new files with git, and then starting a build.

I'll check in more detail what's going on with the timestamps.

  • What are the Unix atime, ctime, mtime timestamps?
  • Which one(s) is itstar picking up and putting in the tape image?
  • What is DUMP reading off the tape?
  • What are the ITS creation and reference timestamps?

@larsbrinkhoff
Copy link
Member

I was touching the filestamps of the wrong files. It's not the source files in EMACS1, but the purified files in EMACS.

@larsbrinkhoff
Copy link
Member

I tested this a few times by checkout out a fresh repository and building. It should work now.

Copy link
Member

@eswenson1 eswenson1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is gross!

Makefile Outdated
@@ -66,6 +66,8 @@ $(OUT)/ka-minsys.tape: $(ITSTAR)
$(OUT)/sources.tape: $(ITSTAR) build/$(EMULATOR)/stamp $(OUT)/syshst/$(H3TEXT)
mkdir -p $(OUT)
rm -f src/*/*~
touch -d "24 hours ago" bin/emacs/einit.*
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That kind of -d is a GNU extension - it won't work with (e.g.) FreeBSD's touch.

$ touch -d "24 hours ago" foo
touch: out of range or illegal time specification: YYYY-MM-DDThh:mm:SS[.frac][tz]

@larsbrinkhoff
Copy link
Member

Ok, instead of a gross hack which doesn't work on FreeBSD, I'll use the actual original filestamps for those three files.

See also #275.

@larsbrinkhoff larsbrinkhoff force-pushed the lars/emacs1 branch 2 times, most recently from a3d1c14 to f141662 Compare June 18, 2018 19:23
@larsbrinkhoff
Copy link
Member

I tried to use itstar's DIR.LIST feature, but it wouldn't work with just those three files. Because then it only added those three files to the tape image, and ignored those files not mentioned in DIR.LIST.

@larsbrinkhoff
Copy link
Member

@atsampson, can you test the "tmp" commit on FreeBSD? If it works, I'll squash it in.

@atsampson
Copy link
Contributor

Yep, that touch syntax works fine on FreeBSD:

$ touch -d 1981-10-06T19:03:37 foo
$ ls -l foo
-rw-r--r-- 1 ats users 0 Oct 6 1981 foo

Also make the build script ensure that EMACS; [PURE], [PRFY], and
EINIT are built.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants