#12221: Failures in gp pexpect interface with specific length of $DOT_SAGE
using a
"screen" terminal
--------------------------+-------------------------------------------------
Reporter: jdemeyer | Owner: was
Type: defect | Status: new
Priority: blocker | Milestone: sage-5.0
Component: interfaces | Keywords: gp pexpect
Work_issues: | Upstream: N/A
Reviewer: | Author:
Merged: | Dependencies:
--------------------------+-------------------------------------------------
Description changed by jdemeyer:
Old description:
> 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 (which 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:
> {{{
> ( export
> HOME=/mnt/usb1/scratch/jdemeyer/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx;
> mkdir -p $HOME; ./sage -t devel/sage/sage/schemes )
> [...]
> sage -t "devel/sage/sage/schemes/elliptic_curves/ell_rational_field.py"
> *** Warning: new stack size = 1003360 (0.957 Mbytes).
> *** Warning: new stack size = 1003360 (0.957 Mbytes).
> **********************************************************************
> File
> "/usr/local/src/sage-4.8.alpha4/devel/sage/sage/schemes/elliptic_curves/ell_rational_field.py",
> line 526:
> sage: E.conductor(algorithm="gp")
> Exception raised:
> Traceback (most recent call last):
> File "/usr/local/src/sage-4.8.alpha4/local/bin/ncadoctest.py", line
> 1231, in run_one_test
> self.run_one_example(test, example, filename, compileflags)
> File "/usr/local/src/sage-4.8.alpha4/local/bin/sagedoctest.py",
> line 38, in run_one_example
> OrigDocTestRunner.run_one_example(self, test, example, filename,
> compileflags)
> File "/usr/local/src/sage-4.8.alpha4/local/bin/ncadoctest.py", line
> 1172, in run_one_example
> compileflags, 1) in test.globs
> File "<doctest __main__.example_12[5]>", line 1, in <module>
> E.conductor(algorithm="gp")###line 526:
> sage: E.conductor(algorithm="gp")
> File "/usr/local/src/sage-4.8.alpha4/local/lib/python/site-
> packages/sage/schemes/elliptic_curves/ell_rational_field.py", line 552,
> in conductor
> self.__conductor_gp =
> Integer(gp.eval('ellglobalred(ellinit(%s,0))[1]'%list(self.a_invariants())))
> File "integer.pyx", line 681, in
> sage.rings.integer.Integer.__init__ (sage/rings/integer.c:6786)
> TypeError: unable to convert x
> (=read("/tmp/123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789/.sage/temp/arcanis/5630//interface//tmp5647")
> ) to an integer
> **********************************************************************
> File
> "/usr/local/src/sage-4.8.alpha4/devel/sage/sage/schemes/elliptic_curves/ell_rational_field.py",
> line 1430:
> sage: E.simon_two_descent()
> Exception raised:
> Traceback (most recent call last):
> File "/usr/local/src/sage-4.8.alpha4/local/bin/ncadoctest.py", line
> 1231, in run_one_test
> self.run_one_example(test, example, filename, compileflags)
> File "/usr/local/src/sage-4.8.alpha4/local/bin/sagedoctest.py",
> line 38, in run_one_example
> OrigDocTestRunner.run_one_example(self, test, example, filename,
> compileflags)
> File "/usr/local/src/sage-4.8.alpha4/local/bin/ncadoctest.py", line
> 1172, in run_one_example
> compileflags, 1) in test.globs
> File "<doctest __main__.example_28[4]>", line 1, in <module>
> E.simon_two_descent()###line 1430:
> sage: E.simon_two_descent()
> File "/usr/local/src/sage-4.8.alpha4/local/lib/python/site-
> packages/sage/schemes/elliptic_curves/ell_rational_field.py", line 1493,
> in simon_two_descent
> maxprob=maxprob, limbigprime=limbigprime)
> File "/usr/local/src/sage-4.8.alpha4/local/lib/python/site-
> packages/sage/schemes/elliptic_curves/gp_simon.py", line 117, in
> simon_two_descent
> ans = sage_eval(v, {'Mod': _gp_mod, 'y': K.gen(0)})
> File "/usr/local/src/sage-4.8.alpha4/local/lib/python/site-
> packages/sage/misc/sage_eval.py", line 199, in sage_eval
> return eval(source, sage.all.__dict__, locals)
> File "<string>", line 0
>
> ^
> SyntaxError: unexpected EOF while parsing
> **********************************************************************
> [...]
> The following tests failed:
>
> sage -t devel/sage/sage/schemes/elliptic_curves/lseries_ell.py #
> 1 doctests failed
> sage -t devel/sage/sage/schemes/elliptic_curves/gp_simon.py # 3
> doctests failed
> sage -t devel/sage/sage/schemes/elliptic_curves/BSD.py # 3
> doctests failed
> sage -t devel/sage/sage/schemes/elliptic_curves/sha_tate.py # 4
> doctests failed
> sage -t
> devel/sage/sage/schemes/elliptic_curves/ell_rational_field.py # 14
> doctests failed
> sage -t
> devel/sage/sage/schemes/elliptic_curves/ell_number_field.py # 11 doctests
> failed
> }}}
>
> -----
>
> 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. We want to directly call a read() command, controlling
> the filename length.
>
> Download [attachment:test12221.sage] and run
> {{{
> $ ./sage test12221.sage
> }}}
> I see
> {{{
> TERM = screen
> 18 char filename: ok
> 19 char filename: ok
> 20 char filename: ok
> [...]
> 68 char filename: ok
> 69 char filename: ok
> 70 char filename: fail
> 71 char filename: fail
> 72 char filename: fail
> [...]
> }}}
New description:
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:
{{{
( export
HOME=/mnt/usb1/scratch/jdemeyer/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx;
mkdir -p $HOME; ./sage -t devel/sage/sage/schemes )
[...]
sage -t "devel/sage/sage/schemes/elliptic_curves/ell_rational_field.py"
*** Warning: new stack size = 1003360 (0.957 Mbytes).
*** Warning: new stack size = 1003360 (0.957 Mbytes).
**********************************************************************
File
"/usr/local/src/sage-4.8.alpha4/devel/sage/sage/schemes/elliptic_curves/ell_rational_field.py",
line 526:
sage: E.conductor(algorithm="gp")
Exception raised:
Traceback (most recent call last):
File "/usr/local/src/sage-4.8.alpha4/local/bin/ncadoctest.py", line
1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/usr/local/src/sage-4.8.alpha4/local/bin/sagedoctest.py", line
38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/usr/local/src/sage-4.8.alpha4/local/bin/ncadoctest.py", line
1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_12[5]>", line 1, in <module>
E.conductor(algorithm="gp")###line 526:
sage: E.conductor(algorithm="gp")
File "/usr/local/src/sage-4.8.alpha4/local/lib/python/site-
packages/sage/schemes/elliptic_curves/ell_rational_field.py", line 552, in
conductor
self.__conductor_gp =
Integer(gp.eval('ellglobalred(ellinit(%s,0))[1]'%list(self.a_invariants())))
File "integer.pyx", line 681, in sage.rings.integer.Integer.__init__
(sage/rings/integer.c:6786)
TypeError: unable to convert x
(=read("/tmp/123456789_123456789_123456789_123456789_123456789_123456789_123456789_123456789/.sage/temp/arcanis/5630//interface//tmp5647")
) to an integer
**********************************************************************
File
"/usr/local/src/sage-4.8.alpha4/devel/sage/sage/schemes/elliptic_curves/ell_rational_field.py",
line 1430:
sage: E.simon_two_descent()
Exception raised:
Traceback (most recent call last):
File "/usr/local/src/sage-4.8.alpha4/local/bin/ncadoctest.py", line
1231, in run_one_test
self.run_one_example(test, example, filename, compileflags)
File "/usr/local/src/sage-4.8.alpha4/local/bin/sagedoctest.py", line
38, in run_one_example
OrigDocTestRunner.run_one_example(self, test, example, filename,
compileflags)
File "/usr/local/src/sage-4.8.alpha4/local/bin/ncadoctest.py", line
1172, in run_one_example
compileflags, 1) in test.globs
File "<doctest __main__.example_28[4]>", line 1, in <module>
E.simon_two_descent()###line 1430:
sage: E.simon_two_descent()
File "/usr/local/src/sage-4.8.alpha4/local/lib/python/site-
packages/sage/schemes/elliptic_curves/ell_rational_field.py", line 1493,
in simon_two_descent
maxprob=maxprob, limbigprime=limbigprime)
File "/usr/local/src/sage-4.8.alpha4/local/lib/python/site-
packages/sage/schemes/elliptic_curves/gp_simon.py", line 117, in
simon_two_descent
ans = sage_eval(v, {'Mod': _gp_mod, 'y': K.gen(0)})
File "/usr/local/src/sage-4.8.alpha4/local/lib/python/site-
packages/sage/misc/sage_eval.py", line 199, in sage_eval
return eval(source, sage.all.__dict__, locals)
File "<string>", line 0
^
SyntaxError: unexpected EOF while parsing
**********************************************************************
[...]
The following tests failed:
sage -t devel/sage/sage/schemes/elliptic_curves/lseries_ell.py #
1 doctests failed
sage -t devel/sage/sage/schemes/elliptic_curves/gp_simon.py # 3
doctests failed
sage -t devel/sage/sage/schemes/elliptic_curves/BSD.py # 3
doctests failed
sage -t devel/sage/sage/schemes/elliptic_curves/sha_tate.py # 4
doctests failed
sage -t
devel/sage/sage/schemes/elliptic_curves/ell_rational_field.py # 14
doctests failed
sage -t
devel/sage/sage/schemes/elliptic_curves/ell_number_field.py # 11 doctests
failed
}}}
-----
'''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:
{{{
$ ./sage test12221.sage
}}}
I see
{{{
TERM = screen
18 char filename: ok
19 char filename: ok
20 char filename: ok
[...]
68 char filename: ok
69 char filename: ok
70 char filename: fail
71 char filename: fail
72 char filename: fail
[...]
}}}
--
--
Ticket URL: <http://trac.sagemath.org/sage_trac/ticket/12221#comment:25>
Sage <http://www.sagemath.org>
Sage: Creating a Viable Open Source Alternative to Magma, Maple, Mathematica,
and MATLAB
--
You received this message because you are subscribed to the Google Groups
"sage-trac" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/sage-trac?hl=en.