On Apr 30, 9:28 pm, Minh Nguyen <nguyenmi...@gmail.com> wrote:
> Hi folks,

Hi,

> I received the following segmentation fault when trying to use the
> show command with complex_plot():
>
> [mv...@sage ~]$ sage
> ----------------------------------------------------------------------
> | Sage Version 3.4.1, Release Date: 2009-04-21                       |
> | Type notebook() for the GUI, and license() for information.        |
> ----------------------------------------------------------------------
> sage: q = var("q")
> sage: f(q) = (q^4 - q^2 + 1) * (q^4 + q^3 + q^2 + q + 1) * (q^4 - q^3
> + q^2 - q + 1) * (q^6 + q^5 + q^4 + q^3 + q^2 + q + 1) * (q^6 - q^5 +
> q^4 - q^3 + q^2 - q + 1) * (q^(20) - q^(18) - q^(14) - q^(12) + q^(10)
> - q^8 - q^6 - q^2 + 1)
> sage: g(q) = q^8 * (q^4 + q^2 + 1)^2 * (q^4 + 1)^5
> sage: p = complex_plot(f/g, (-2,2), (-2,2))
> sage: p.show(figsize=[256,256])

please open a ticket. I think you might be using figsize wrong, i.e.
it isn't supposed to be a list or at least it isn't in MPL. If I pass
figsize=2 in for example it works. What might happen is that some kwd
argument gets passed into the wrong place and *boom*. The issue is
definitely in MPL:

sage: p.show(figsize=[256,256])

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x7fd9450736e0 (LWP 18359)]
0x00007fd91a02b0d4 in RendererAgg (this=0x4580ce0, width=25600,
height=25600, dpi=100, debug=0) at agg24/include/agg_pixfmt_rgba.h:
1874
1874    agg24/include/agg_pixfmt_rgba.h: No such file or directory.
        in agg24/include/agg_pixfmt_rgba.h
Current language:  auto; currently c++
(gdb) bt
#0  0x00007fd91a02b0d4 in RendererAgg (this=0x4580ce0, width=25600,
height=25600, dpi=100, debug=0) at agg24/include/agg_pixfmt_rgba.h:
1874
#1  0x00007fd91a02e5c0 in _backend_agg_module::new_renderer
(this=<value optimized out>, ar...@0x7fff4d087da0, kws=<value
optimized out>) at src/backend_agg.cpp:1700
#2  0x00007fd91a04551c in
Py::ExtensionModule<_backend_agg_module>::invoke_method_keyword
(this=0x450f100, na...@0x7fff4d087df0, ar...@0x7fff4d087da0,
keywor...@0x7fff4d087d70)
    at ./CXX/Extensions.hxx:404
<SNIP>


> ------------------------------------------------------------
> Unhandled SIGSEGV: A segmentation fault occured in SAGE.
> This probably occured because a *compiled* component
> of SAGE has a bug in it (typically accessing invalid memory)
> or is not properly wrapped with _sig_on, _sig_off.
> You might want to run SAGE under gdb with 'sage -gdb' to debug this.
> SAGE will now terminate (sorry).
> ------------------------------------------------------------
>
> --
> Regards
> Minh Van Nguyen


While playing around with this I came across this strangeness:

sage: q = var("q")
sage: f(q) = (q^4 - q^2 + 1) * (q^4 + q^3 + q^2 + q + 1) * (q^4 - q^3
....: )
---------------------------------------------------------------------------
RuntimeError                              Traceback (most recent call
last)

/home/mabshoff/.sage/temp/sage.math.washington.edu/18540/
_home_mabshoff__sage_init_sage_0.py in <module>()

/usr/local/sage/local/lib/python2.5/site-packages/sage/structure/
element.so in sage.structure.element.RingElement.__mul__ (sage/
structure/element.c:10558)()

/usr/local/sage/local/lib/python2.5/site-packages/sage/structure/
coerce.so in sage.structure.coerce.CoercionModel_cache_maps.bin_op
(sage/structure/coerce.c:6607)()

/usr/local/sage/local/lib/python2.5/site-packages/sage/structure/
coerce.so in
sage.structure.coerce.CoercionModel_cache_maps.canonical_coercion
(sage/structure/coerce.c:7850)()

/usr/local/sage/local/lib/python2.5/site-packages/sage/structure/
coerce.so in
sage.structure.coerce.CoercionModel_cache_maps._coercion_error (sage/
structure/coerce.c:14336)()

RuntimeError: There is a bug in the coercion code in SAGE.
Both x (=(q^4 - q^2 + 1)*(q^4 + q^3 + q^2 + q + 1)) and y (=q |--> q^4
- q^3) are supposed to have identical parents but they don't.
In fact, x has parent 'Symbolic Ring'
whereas y has parent 'Callable function ring with arguments (q,)'
Original elements (q^4 - q^2 + 1)*(q^4 + q^3 + q^2 + q + 1) (parent
Symbolic Ring) and q |--> q^4 - q^3 (parent Callable function ring
with arguments (q,)) and maps
<type 'NoneType'> None
<type 'sage.categories.morphism.CallMorphism'> Call morphism:
  From: Callable function ring with arguments (q,)
  To:   Symbolic Ring

It is important here to input all but the last closing parenthesis,
hit enter and then close the expression and hit enter again. The
result is the above complaint ;). Should I open a ticket for this one?

Cheers,

Michael
--~--~---------~--~----~------------~-------~--~----~
To post to this group, send email to sage-devel@googlegroups.com
To unsubscribe from this group, send email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to