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
Failures in gp pexpect interface with specific length of $DOT_SAGE using a "screen" terminal #12221
Comments
This comment has been minimized.
This comment has been minimized.
comment:2
I can't reproduce this, either on sage.math or an OS X box. What platform were you using? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
comment:5
It might really be caused by #11704 then. Need to do some more tests. |
comment:6
I should clarify: I couldn't reproduce this, either before applying the patch from #11704 or after. |
comment:8
Replying to @jdemeyer:
That combination doesn't cause me problems on sage.math: I have a copy of sage in |
This comment has been minimized.
This comment has been minimized.
comment:10
Now I also have problems reproducing it. It must be some strange interaction between several tickets. |
comment:11
Maybe it's a race condition of some sort being triggered by #11704? |
comment:12
I can't seem to reproduce this anymore... |
comment:13
Reproducing it again sometimes when merging #11073... must be some race condition, which makes it an even more annoying bug. |
This comment has been minimized.
This comment has been minimized.
comment:15
These errors happen much less frequently (but they still do happen) with python-2.7. At least that's my feeling. |
comment:17
Important data point: the failures seem to happen only (or at least mostly) during the first test run. Running "make ptest" from a fresh install causes a lot of failures. Running "make ptest" a second time gives no (or much less) failures. |
comment:18
This observation about the "first run" could be because of a cold disk cache causing some race condition. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
Author: Jeroen Demeyer |
comment:27
Very experimental fix seems to work on first sight, certainly needs more testing. |
Changed keywords from gp pexpect to gp pexpect spkg |
comment:29
For the record, I still can't reproduce it on Fedora 16:
|
comment:30
I haven't looked at this at all, but it's probably safer to set TERM to `dumb' than unsetting it. (As also evidenced by the termcap crash in #12282) |
comment:31
Volker: you need to actually use "screen", not just set TERM=screen. And then the obvious: is your |
This comment has been minimized.
This comment has been minimized.
Attachment: test12221.sage.gz |
comment:34
I tried it under
|
comment:35
I can reproduce the failing test12221.sage at home in a screen session, but it goes away with TERM=dumb. On sage.math the test doesn't fail for me, but I do get a lot of escape sequences (1b 4d, followed by a lot of 1b 5b 43, followed by a 1b 5b 4b) when the length hits 70. |
comment:36
With some terminal capabilities, gp is using escape sequences to "redraw" the current line once you send a newline after exactly the right (or wrong) input line length. This redrawing of the current line includes the prompt characters, and that triggers pexpect to output the next command prematurely, getting things out of sync. |
Diff for the pexpect spkg, for review only |
comment:37
Attachment: pexpect-2.0.p4-p5.diff.gz |
Merged: sage-5.0.beta0 |
comment:38
Well, However, none of these changes makes the situation worse than before, and the cleaning up of the pexpect spkg alone is worth to have this getting in the main tree as soon as possible. Cheers, |
Reviewer: Georg S. Weber |
comment:39
Replying to @sagetrac-GeorgSWeber:
Fair enough, see #12330. |
comment:40
Attachment: 12221_pexpect_unset_TERM.patch.gz |
comment:41
Georg, would you mind reviewing #12330 then? |
On Gentoo Linux x86_64 and on sage.math running sage-4.8.alpha6 + #11073 (but without #12263):
Use a "screen" terminal.
When $DOT_SAGE (and therefore, $HOME) contains a specific number of characters in relation to the number of columns on the pseudo-terminal ($COLUMNS), failures happen. I believe this is due to temporary filenames word-wrapping in the pseudo-terminal (pty). The pty seems to inherit properties of the actual terminal, that's why there are failures with screen but not with xterm.
For example, on a 138-column terminal:
How to reproduce this more artificially:
apply attachment: 12221_debug.patch. This will send all gp pexpect commands less than 200 characters directly to gp, without using a temporary file. The problem is the filename length of the temporary files used in the read() command. This depends on
$DOT_SAGE
, on the hostname, on process IDs.Download attachment: test12221.sage and run (from within a "screen" session). This will execute a read() command with increasing filename lengths:
I see
apply attachment: 12221_pexpect_unset_TERM.patch and the spkg http://boxen.math.washington.edu/home/jdemeyer/spkg/pexpect-2.0.p5.spkg
CC: @JohnCremona
Component: interfaces
Keywords: gp pexpect spkg
Author: Jeroen Demeyer
Reviewer: Georg S. Weber
Merged: sage-5.0.beta0
Issue created by migration from https://trac.sagemath.org/ticket/12221
The text was updated successfully, but these errors were encountered: