Repository: spyder-ide/spyder

Issue:
Spyder crashes after typing plt.plot( at the ipython console
## Description of your problem
Typing plt.plot( at the ipython console results in Spyder crashing. If I open Spyder via a terminal, then the following message appears: Segmentation fault (core dumped). 

**What steps will reproduce the problem?**

1. Run Spyder
2. Type plt.plot( at the ipython console

**What is the expected output? What do you see instead?**
I expect to see documentation relevant to plt.plot at the help window. Instead, Spyder crashes to the desktop.

**Please provide any additional information below**

The problem does not occur when:

1. I type plt.plot( at the editor. However, the help window shows only the basic arguments of the command and displays the following message: No further help available

2. I type matplotlib.pyplot.plot( at the ipython console

3. I turn off help for the ipython console

3. I type other pyplot functions (e.g. scatter, loglog etc)

4. I run Anaconda/Spyder on macOS High Sierra

## Versions and main components

* Spyder Version: 3.2.4
* Python Version: 3.6.3 (also 2.7.14)
* Qt Version: 5.6.2
* PyQt Version: 5.6.0
* Operating system: Ubuntu 16.04 LTS


* Matplotlib: 2.1.0 and 2.0.2

## Dependencies

IPython >=4.0    :  6.1.0 (OK)
cython >=0.21    :  0.26.1 (OK)
jedi >=0.9.0     :  0.10.2 (OK)
nbconvert >=4.0  :  5.3.1 (OK)
numpy >=1.7      :  1.13.3 (OK)
pandas >=0.13.1  :  0.20.3 (OK)
psutil >=0.3     :  5.4.0 (OK)
pycodestyle >=2.3:  2.3.1 (OK)
pyflakes >=0.6.0 :  1.6.0 (OK)
pygments >=2.0   :  2.2.0 (OK)
pylint >=0.25    :  1.7.4 (OK)
qtconsole >=4.2.0:  4.3.1 (OK)
rope >=0.9.4     :  0.10.5 (OK)
sphinx >=0.6.6   :  1.6.3 (OK)
sympy >=0.7.3    :  1.1.1 (OK)



Discussion:
> I run Anaconda/Spyder on macOS High Sierra

This is the problem, and it's not related to Spyder. Anaconda has not updated Qt to work with High Sierra, so you'll have to wait a couple of weeks until that happens.
Qt is the graphical toolkit upon which Spyder is built.
But the problem does not happen on High Sierra, only on Ubuntu 16.04 LTS.

On Fri, Oct 20, 2017 at 4:27 PM, Carlos Cordoba <notifications@github.com>
wrote:

> I run Anaconda/Spyder on macOS High Sierra
>
> This is the problem, and it's not related to Spyder. Anaconda has not
> updated Qt to work with High Sierra, so you'll have to wait a couple of
> weeks until that happens.
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/spyder-ide/spyder/issues/5514#issuecomment-338222361>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AfbqC0PDZudHRCiC65M3g5fhXfOxpTo3ks5suK27gaJpZM4QAq6l>
> .
>

You said you were working on High Sierra, I don't understand...
No, I tried it on High Sierra just to see if I could reproduce it on that
OS too (but I could not). It only occurs on Ubuntu 16.04 LTS.

On Fri, Oct 20, 2017 at 4:38 PM, Carlos Cordoba <notifications@github.com>
wrote:

> You said you were working on High Sierra, I don't understand...
>
> —
> You are receiving this because you authored the thread.
> Reply to this email directly, view it on GitHub
> <https://github.com/spyder-ide/spyder/issues/5514#issuecomment-338225306>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AfbqC6NuSoXEzo99AogZOf-53nLJGYNqks5suLBTgaJpZM4QAq6l>
> .
>

@rlaverde, please try to reproduce this one.
@evangelos1 From your report it seem that you have the preference `Help -> Automatic connections -> IPython` enabled. Is this correct?

I can't reproduce this bug. I didn't try matplotlib 2.1.

Did you install matplotlib 2.1 through pip? If so it could mess with anaconda.

My system:
Python 3.6.2 64bits, Qt 5.6.2, PyQt5 5.6 Ubuntu 6.04
matplotlib 2.02

IPython >=4.0    :  6.1.0 (OK)
cython >=0.21    :  0.26.1 (OK)
jedi >=0.9.0     :  0.10.2 (OK)
nbconvert >=4.0  :  5.3.1 (OK)
numpy >=1.7      :  1.12.1 (OK)
pandas >=0.13.1  :  0.20.3 (OK)
psutil >=0.3     :  5.4.0 (OK)
pycodestyle >=2.3:  2.3.1 (OK)
pyflakes >=0.6.0 :  1.6.0 (OK)
pygments >=2.0   :  2.2.0 (OK)
pylint >=0.25    :  1.7.4 (OK)
qtconsole >=4.2.0:  4.3.1 (OK)
rope >=0.9.4     :  0.10.5 (OK)
sphinx >=0.6.6   :  1.6.3 (OK)
sympy >=0.7.3    :  1.1.1 (OK)


That is correct. The crash happens only if the automatic connection to
IPython is enabled and as soon as I type plt.plot( at the IPython console.
Interestingly, if I type matplotlib.pyplot.plot( then Spyder does not
crash; but it doesn't display plot's documentation either.

On Sat, Oct 21, 2017 at 12:06 AM, bcolsen <notifications@github.com> wrote:

> @evangelos1 <https://github.com/evangelos1> From your report it seem that
> you have the preference Help -> Automatic connections -> IPython enabled.
> Is this correct?
>
> I can't reproduce this.
>
> My system:
> Python 3.6.2 64bits, Qt 5.6.2, PyQt5 5.6 Ubuntu 6.04
> matplotlib 2.02
>
> IPython >=4.0 : 6.1.0 (OK)
> cython >=0.21 : 0.26.1 (OK)
> jedi >=0.9.0 : 0.10.2 (OK)
> nbconvert >=4.0 : 5.3.1 (OK)
> numpy >=1.7 : 1.12.1 (OK)
> pandas >=0.13.1 : 0.20.3 (OK
> <https://maps.google.com/?q=20.3+(OK&entry=gmail&source=g>)
> psutil >=0.3 : 5.4.0 (OK)
> pycodestyle >=2.3: 2.3.1 (OK)
> pyflakes >=0.6.0 : 1.6.0 (OK)
> pygments >=2.0 : 2.2.0 (OK)
> pylint >=0.25 : 1.7.4 (OK)
> qtconsole >=4.2.0: 4.3.1 (OK)
> rope >=0.9.4 : 0.10.5 (OK)
> sphinx >=0.6.6 : 1.6.3 (OK)
> sympy >=0.7.3 : 1.1.1 (OK)
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/spyder-ide/spyder/issues/5514#issuecomment-338333400>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AfbqC-GJhpw8jhw-fNu6AKxremTyRi75ks5suRlYgaJpZM4QAq6l>
> .
>

I didn't see your second question in time: No, I've installed all packages
via Anaconda Navigator.

On Sat, Oct 21, 2017 at 12:06 AM, bcolsen <notifications@github.com> wrote:

> @evangelos1 <https://github.com/evangelos1> From your report it seem that
> you have the preference Help -> Automatic connections -> IPython enabled.
> Is this correct?
>
> I can't reproduce this.
>
> My system:
> Python 3.6.2 64bits, Qt 5.6.2, PyQt5 5.6 Ubuntu 6.04
> matplotlib 2.02
>
> IPython >=4.0 : 6.1.0 (OK)
> cython >=0.21 : 0.26.1 (OK)
> jedi >=0.9.0 : 0.10.2 (OK)
> nbconvert >=4.0 : 5.3.1 (OK)
> numpy >=1.7 : 1.12.1 (OK)
> pandas >=0.13.1 : 0.20.3 (OK
> <https://maps.google.com/?q=20.3+(OK&entry=gmail&source=g>)
> psutil >=0.3 : 5.4.0 (OK)
> pycodestyle >=2.3: 2.3.1 (OK)
> pyflakes >=0.6.0 : 1.6.0 (OK)
> pygments >=2.0 : 2.2.0 (OK)
> pylint >=0.25 : 1.7.4 (OK)
> qtconsole >=4.2.0: 4.3.1 (OK)
> rope >=0.9.4 : 0.10.5 (OK)
> sphinx >=0.6.6 : 1.6.3 (OK)
> sympy >=0.7.3 : 1.1.1 (OK)
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/spyder-ide/spyder/issues/5514#issuecomment-338333400>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AfbqC-GJhpw8jhw-fNu6AKxremTyRi75ks5suRlYgaJpZM4QAq6l>
> .
>

> I didn't see your second question in time: No, I've installed all packages via Anaconda Navigator.

I only asked because I don't see matplotlib 2.1 in the standard channel yet through the `conda upgrade` command.
With the auto help off, what happens if you press `ctrl-i` at the end of `plt.plot`?
I see that the documentation for plt.plot appears in the help window and
Spyder crashes immediately. If I do the same thing but with plt.scatter
instead, then everything works.

On Sat, Oct 21, 2017 at 12:33 AM, bcolsen <notifications@github.com> wrote:

> With the auto help off, what happens if you press ctrl-i at the end of
> plt.plot
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/spyder-ide/spyder/issues/5514#issuecomment-338337653>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AfbqC-A1P1wiDrCV0fSRHJlXCK1CtgbDks5suR_AgaJpZM4QAq6l>
> .
>

Try changing the help widget to render in `plain text` 
The option is under the gear drop down menu on the help widget
IPython console + Plain text works; Spyder doesn't crash. It looks like the
entire documentation for plt.plot is shown in this case.

Editor + plain text doesn't crash Spyder. But only the arguments of
plt.plot are shown in the help window.

On Sat, Oct 21, 2017 at 1:00 AM, bcolsen <notifications@github.com> wrote:

> Try changing the help widget to render in plain text
> The option is under the gear drop down menu on the help widget
>
> —
> You are receiving this because you were mentioned.
> Reply to this email directly, view it on GitHub
> <https://github.com/spyder-ide/spyder/issues/5514#issuecomment-338341301>,
> or mute the thread
> <https://github.com/notifications/unsubscribe-auth/AfbqC5rwhmtWsJh5S_qafP0RmMAcPfDtks5suSYTgaJpZM4QAq6l>
> .
>

Good so the problem is with the rich text conversion. We're getting somewhere!

Can you post the plain text of the the plt.plot help here? or to pastebin 
```
====
plot
====

Definition: plot(*args, **kwargs)
Type: Function of matplotlib.pyplot module

----

Plot lines and/or markers to the
:class:`~matplotlib.axes.Axes`.  *args* is a variable length
argument, allowing for multiple *x*, *y* pairs with an
optional format string.  For example, each of the following is
legal::

    plot(x, y)        # plot x and y using default line style and color
    plot(x, y, 'bo')  # plot x and y using blue circle markers
    plot(y)           # plot y using x as index array 0..N-1
    plot(y, 'r+')     # ditto, but with red plusses

If *x* and/or *y* is 2-dimensional, then the corresponding columns
will be plotted.

If used with labeled data, make sure that the color spec is not
included as an element in data, as otherwise the last case
``plot("v","r", data={"v":..., "r":...)``
can be interpreted as the first case which would do ``plot(v, r)``
using the default line style and color.

If not used with labeled data (i.e., without a data argument),
an arbitrary number of *x*, *y*, *fmt* groups can be specified, as in::

    a.plot(x1, y1, 'g^', x2, y2, 'g-')

Return value is a list of lines that were added.

By default, each line is assigned a different style specified by a
'style cycle'.  To change this behavior, you can edit the
axes.prop_cycle rcParam.

The following format string characters are accepted to control
the line style or marker:

================    ===============================
character           description
================    ===============================
``'-'``             solid line style
``'--'``            dashed line style
``'-.'``            dash-dot line style
``':'``             dotted line style
``'.'``             point marker
``','``             pixel marker
``'o'``             circle marker
``'v'``             triangle_down marker
``'^'``             triangle_up marker
``'<'``             triangle_left marker
``'>'``             triangle_right marker
``'1'``             tri_down marker
``'2'``             tri_up marker
``'3'``             tri_left marker
``'4'``             tri_right marker
``'s'``             square marker
``'p'``             pentagon marker
``'*'``             star marker
``'h'``             hexagon1 marker
``'H'``             hexagon2 marker
``'+'``             plus marker
``'x'``             x marker
``'D'``             diamond marker
``'d'``             thin_diamond marker
``'|'``             vline marker
``'_'``             hline marker
================    ===============================


The following color abbreviations are supported:

==========  ========
character   color
==========  ========
'b'         blue
'g'         green
'r'         red
'c'         cyan
'm'         magenta
'y'         yellow
'k'         black
'w'         white
==========  ========

In addition, you can specify colors in many weird and
wonderful ways, including full names (``'green'``), hex
strings (``'#008000'``), RGB or RGBA tuples (``(0,1,0,1)``) or
grayscale intensities as a string (``'0.8'``).  Of these, the
string specifications can be used in place of a ``fmt`` group,
but the tuple forms can be used only as ``kwargs``.

Line styles and colors are combined in a single format string, as in
``'bo'`` for blue circles.

The *kwargs* can be used to set line properties (any property that has
a ``set_*`` method).  You can use this to set a line label (for auto
legends), linewidth, anitialising, marker face color, etc.  Here is an
example::

    plot([1,2,3], [1,2,3], 'go-', label='line 1', linewidth=2)
    plot([1,2,3], [1,4,9], 'rs',  label='line 2')
    axis([0, 4, 0, 10])
    legend()

If you make multiple lines with one plot command, the kwargs
apply to all those lines, e.g.::

    plot(x1, y1, x2, y2, antialiased=False)

Neither line will be antialiased.

You do not need to use format strings, which are just
abbreviations.  All of the line properties can be controlled
by keyword arguments.  For example, you can set the color,
marker, linestyle, and markercolor with::

    plot(x, y, color='green', linestyle='dashed', marker='o',
         markerfacecolor='blue', markersize=12).

See :class:`~matplotlib.lines.Line2D` for details.

The kwargs are :class:`~matplotlib.lines.Line2D` properties:


  =====================================================================================   ===============================================================================================================================================
  Property                                                                                Description                                                                                                                                    
  =====================================================================================   ===============================================================================================================================================
  :meth:`agg_filter <matplotlib.artist.Artist.set_agg_filter>`                            unknown                                                                                                                                        
  :meth:`alpha <matplotlib.artist.Artist.set_alpha>`                                      float (0.0 transparent through 1.0 opaque)                                                                                                     
  :meth:`animated <matplotlib.artist.Artist.set_animated>`                                [True | False]                                                                                                                                 
  :meth:`antialiased <matplotlib.lines.Line2D.set_antialiased>` or aa                     [True | False]                                                                                                                                 
  :meth:`clip_box <matplotlib.artist.Artist.set_clip_box>`                                a :class:`matplotlib.transforms.Bbox` instance                                                                                                 
  :meth:`clip_on <matplotlib.artist.Artist.set_clip_on>`                                  [True | False]                                                                                                                                 
  :meth:`clip_path <matplotlib.artist.Artist.set_clip_path>`                              [ (:class:`~matplotlib.path.Path`, :class:`~matplotlib.transforms.Transform`) | :class:`~matplotlib.patches.Patch` | None ]                    
  :meth:`color <matplotlib.lines.Line2D.set_color>` or c                                  any matplotlib color                                                                                                                           
  :meth:`contains <matplotlib.artist.Artist.set_contains>`                                a callable function                                                                                                                            
  :meth:`dash_capstyle <matplotlib.lines.Line2D.set_dash_capstyle>`                       ['butt' | 'round' | 'projecting']                                                                                                              
  :meth:`dash_joinstyle <matplotlib.lines.Line2D.set_dash_joinstyle>`                     ['miter' | 'round' | 'bevel']                                                                                                                  
  :meth:`dashes <matplotlib.lines.Line2D.set_dashes>`                                     sequence of on/off ink in points                                                                                                               
  :meth:`drawstyle <matplotlib.lines.Line2D.set_drawstyle>`                               ['default' | 'steps' | 'steps-pre' | 'steps-mid' | 'steps-post']                                                                               
  :meth:`figure <matplotlib.artist.Artist.set_figure>`                                    a :class:`matplotlib.figure.Figure` instance                                                                                                   
  :meth:`fillstyle <matplotlib.lines.Line2D.set_fillstyle>`                               ['full' | 'left' | 'right' | 'bottom' | 'top' | 'none']                                                                                        
  :meth:`gid <matplotlib.artist.Artist.set_gid>`                                          an id string                                                                                                                                   
  :meth:`label <matplotlib.artist.Artist.set_label>`                                      string or anything printable with '%s' conversion.                                                                                             
  :meth:`linestyle <matplotlib.lines.Line2D.set_linestyle>` or ls                         ['solid' | 'dashed', 'dashdot', 'dotted' | (offset, on-off-dash-seq) | ``'-'`` | ``'--'`` | ``'-.'`` | ``':'`` | ``'None'`` | ``' '`` | ``''``]
  :meth:`linewidth <matplotlib.lines.Line2D.set_linewidth>` or lw                         float value in points                                                                                                                          
  :meth:`marker <matplotlib.lines.Line2D.set_marker>`                                     :mod:`A valid marker style <matplotlib.markers>`                                                                                               
  :meth:`markeredgecolor <matplotlib.lines.Line2D.set_markeredgecolor>` or mec            any matplotlib color                                                                                                                           
  :meth:`markeredgewidth <matplotlib.lines.Line2D.set_markeredgewidth>` or mew            float value in points                                                                                                                          
  :meth:`markerfacecolor <matplotlib.lines.Line2D.set_markerfacecolor>` or mfc            any matplotlib color                                                                                                                           
  :meth:`markerfacecoloralt <matplotlib.lines.Line2D.set_markerfacecoloralt>` or mfcalt   any matplotlib color                                                                                                                           
  :meth:`markersize <matplotlib.lines.Line2D.set_markersize>` or ms                       float                                                                                                                                          
  :meth:`markevery <matplotlib.lines.Line2D.set_markevery>`                               [None | int | length-2 tuple of int | slice | list/array of int | float | length-2 tuple of float]                                             
  :meth:`path_effects <matplotlib.artist.Artist.set_path_effects>`                        unknown                                                                                                                                        
  :meth:`picker <matplotlib.lines.Line2D.set_picker>`                                     float distance in points or callable pick function ``fn(artist, event)``                                                                       
  :meth:`pickradius <matplotlib.lines.Line2D.set_pickradius>`                             float distance in points                                                                                                                       
  :meth:`rasterized <matplotlib.artist.Artist.set_rasterized>`                            [True | False | None]                                                                                                                          
  :meth:`sketch_params <matplotlib.artist.Artist.set_sketch_params>`                      unknown                                                                                                                                        
  :meth:`snap <matplotlib.artist.Artist.set_snap>`                                        unknown                                                                                                                                        
  :meth:`solid_capstyle <matplotlib.lines.Line2D.set_solid_capstyle>`                     ['butt' | 'round' |  'projecting']                                                                                                             
  :meth:`solid_joinstyle <matplotlib.lines.Line2D.set_solid_joinstyle>`                   ['miter' | 'round' | 'bevel']                                                                                                                  
  :meth:`transform <matplotlib.lines.Line2D.set_transform>`                               a :class:`matplotlib.transforms.Transform` instance                                                                                            
  :meth:`url <matplotlib.artist.Artist.set_url>`                                          a url string                                                                                                                                   
  :meth:`visible <matplotlib.artist.Artist.set_visible>`                                  [True | False]                                                                                                                                 
  :meth:`xdata <matplotlib.lines.Line2D.set_xdata>`                                       1D array                                                                                                                                       
  :meth:`ydata <matplotlib.lines.Line2D.set_ydata>`                                       1D array                                                                                                                                       
  :meth:`zorder <matplotlib.artist.Artist.set_zorder>`                                    any number                                                                                                                                     
  =====================================================================================   ===============================================================================================================================================


kwargs *scalex* and *scaley*, if defined, are passed on to
:meth:`~matplotlib.axes.Axes.autoscale_view` to determine
whether the *x* and *y* axes are autoscaled; the default is
*True*.

.. note::
    In addition to the above described arguments, this function can take a
    **data** keyword argument. If such a **data** argument is given, the
    following arguments are replaced by **data[<arg>]**:

    * All arguments with the following names: 'x', 'y'.
```
Git hub sort of mangled that.  Can you edit it so it has ` ``` ` (triple backticks..to the left of 1) at the top and the bottom of your last post 
If the problem only occurs with the rich docs generation, then this should be a problem with Sphinx.
I can reproduce this with the latest anaconda updates. It might be graphics related

Spyder Crashes right to `Segmentation fault (core dumped)` nothing on debug level=3

spyder 3.2.4 and latest master

Python 3.6.2 64bits, Qt 5.6.2, PyQt5 5.6 on Linux 
Ubuntu 16.04 64-bit
matplotlib 2.1 or 2.0.2

IPython >=4.0    :  6.1.0 (OK)
cython >=0.21    :  0.26.1 (OK)
jedi >=0.9.0     :  0.10.2 (OK)
nbconvert >=4.0  :  5.3.1 (OK)
numpy >=1.7      :  1.13.1 (OK)
pandas >=0.13.1  :  0.20.3 (OK)
psutil >=0.3     :  5.2.2 (OK)
pycodestyle >=2.3:  2.3.1 (OK)
pyflakes >=0.6.0 :  1.5.0 (OK)
pygments >=2.0   :  2.2.0 (OK)
pylint >=0.25    :  1.7.2 (OK)
qtconsole >=4.2.0:  4.3.1 (OK)
rope >=0.9.4     :  0.10.5 (OK)
sphinx >=0.6.6   :  1.6.3 (OK)
sympy >=0.7.3    :  1.1.1 (OK)

It's not graphics related.  I reproduced on a different machine

It has to do with the super long 2Dlines `properties` and `description`  section
### Solution 1:
 Find out why Sphinx is crashing and fix it. This could be hard.

### Solution 2:

This is a work around, but it would be fixed if you know why `plt.plot?` in jupyter-qtconsole doesn't have the super long 2Dlines `properties` and `description` section and it does in the spyder-qtconsole. We can stop it from crashing.
@bcolsen, what if we wrap MPL docstrings using the `textwrap` module, before sending them to Sphinx?
Hi, sorry for the late reply, thanks @bcolsen for figuring out that the problem was the help richtext. After some debugging I achieve to reproduce this bug, and It's caused by the docs lines mentioned by @bcolsen 

>If the problem only occurs with the rich docs generation, then this should be a problem with Sphinx.

It's not a Sphinx problem (the html generation is working)

The segmentation fault is caused after setting the generated html to the QWebEngineView. (I wasn't able to reproduce it with a basic Qt example), and the html actually renders and after a second crashes

The segfault is caused by something else executed after setting the html, although I haven't found exactly what
@rlaverde I agree. The doc does come up for a second.  


I couldn't reproduce this at work until I updated to matplotlib 2.1 in conda and all this comes in with it and now I can reproduce the crash.
```
The following NEW packages will be INSTALLED:

    graphite2:        1.3.10-hc526e54_0

The following packages will be UPDATED:

    cairo:            1.14.8-0          --> 1.14.10-haa5651f_5  
    dbus:             1.10.20-0         --> 1.10.22-h3b5a359_0  
    fontconfig:       2.12.1-3          --> 2.12.4-h88586e7_1   
    freetype:         2.5.5-2           --> 2.8-h52ed37b_0      
    glib:             2.50.2-1          --> 2.53.6-hc861d11_1   
    gst-plugins-base: 1.8.0-0           --> 1.12.2-he3457e5_0   
    gstreamer:        1.8.0-0           --> 1.12.2-h4f93127_0   
    harfbuzz:         0.9.39-2          --> 1.5.0-h2545bd6_0    
    icu:              54.1-0            --> 58.2-h211956c_0     
    jpeg:             8d-2              --> 9b-h376031c_1       
    libtiff:          4.0.6-2           --> 4.0.8-h90200ff_9    
    matplotlib:       2.0.2-np112py36_0 --> 2.1.0-py36hba5de38_0
    pango:            1.40.3-1          --> 1.40.11-h8191d47_0  
    pillow:           3.4.2-py36_0      --> 4.2.1-py36h9119f52_0
    qt:               5.6.2-2           --> 5.6.2-h974d657_12
```
Yeah, I figured the problem was with MPL 2.1
@rlaverde, please work on this one.
Sorry for not being clear, but the problem is in MPL 2.0.2 as well if I downgrade to 2.0.2 from 2.1.

I included all the packages that were updated because I think that one of those updates might actually be at fault. Unfortunately. I can't update or down grade any of those packages individually, so I can't narrow it down.

As a work around:
```
conda install cairo=1.14.8
```
Will downgrade several packages including MPL to 2.0.2, but spyder doesn't crash afterwards.
After a lot of debugging I found the cause of the error, the mathjax library, commenting it out fix the problem

Although I don't know how to fix it, I tried updating mathjax to the latest version but It didn't work

For a really weird reason, changing the base_url argument of `setHtml()` to a wrong Url fix the problem, is like the mathjax library where trying to load something and that caused the segfault

Maybe the problem is that we aren't loading  correctly the mathjax library
I made a minimal test that crashed Qt5 web view in anaconda.  Both the html and the python don't use spyder code just mathjax from the internet and `[‘miter’ | ‘round’ | ‘bevel’]` in the html makes it crash.

`[‘miter’ | ‘round’ | ‘bevel’]` (note the utf-8 single quotes) is the only thing that I could get it to crash with even `[‘a’ | ‘a’ | ‘a’]` and  `$$ x = y $$` work find.  Very strange.

I works on firefox and chrome so I seems like a Qt problem.

``` python
import PyQt5
from PyQt5.QtCore import QUrl 
from PyQt5.QtWidgets import QApplication, QWidget 
from PyQt5.QtWebKitWidgets import QWebView , QWebPage
from PyQt5.QtWebKit import QWebSettings
from PyQt5.QtNetwork import *
import sys
from optparse import OptionParser
 
 
class MyBrowser(QWebPage):
    ''' Settings for the browser.'''
 
    def userAgentForUrl(self, url):
        ''' Returns a User Agent that will be seen by the website. '''
        return "Mozilla/5.0 (Windows NT 6.1) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/41.0.2228.0 Safari/537.36"
 
class Browser(QWebView):
    def __init__(self):
        # QWebView
        self.view = QWebView.__init__(self)
        #self.view.setPage(MyBrowser())
        self.setWindowTitle('Loading...')
        self.titleChanged.connect(self.adjustTitle)
        #super(Browser).connect(self.ui.webView,QtCore.SIGNAL("titleChanged (const QString&)"), self.adjustTitle)
 
    def load(self,url):  
        self.setUrl(QUrl(url)) 
 
    def adjustTitle(self):
        self.setWindowTitle(self.title())
 
    def disableJS(self):
        settings = QWebSettings.globalSettings()
        settings.setAttribute(QWebSettings.JavascriptEnabled, False)
 
 
 
app = QApplication(sys.argv) 
view = Browser()
view.showMaximized()
view.load("file:////path/to/test.html")  # Change me
app.exec_()
```
test.html:

``` html
<html><head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
    <script type="text/javascript"
        src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML">
    </script>
</head>

<body>

<div>
<p>[‘miter’ | ‘round’ | ‘bevel’]</p>
</div>


</body></html>
```

Thanks a lot @bcolsen for the minimal reproducible example

>It works on firefox and chrome so I seems like a Qt problem.

Yes, I think we should report it upstream, although I'm not sure if this is a Qt issue or anaconda Qt packages

Btw, what we should do to prevent the segfaults in spyder? deactivate mathjax?  😕  @ccordoba12 ?
Yeah, It might not be a Qt problem either. I forgot about the work around I mentioned above, which still works in this minimal example.  That downgrades a bunch of support packages as well as Qt.

Here is another minimal text that crashes `a` can be replaced by any character but the spaces, the quotes and the number of characters are important(there has to be 5 `a`'s in the quotes) and it must be in html tags that are on the same line.  This might be from some weird comping error in qt or one of its dependencies.

``` html
<p>a‘aaaaa’ a ‘aaaaa’ a ‘aaaaa’a</p>
```
As for a work around, the crash is incredibly text specific, so simply disabling `smart-quotes` in docutils might work:

http://docutils.sourceforge.net/docs/user/config.html#smart-quotes 
>As for a work around, the crash is incredibly text specific, so simply disabling smart-quotes in docutils might work

I searched the Sphinx documentation also the code and I didn't find a way to deactivate smart-quotes

This is the option but it's depreciated:
http://www.sphinx-doc.org/en/stable/config.html#confval-html_use_smartypants

They suggest instead to change smart-quotes...

http://docutils.sourceforge.net/docs/user/config.html#smart-quotes

in a separate `docutils.conf` file:

From http://www.sphinx-doc.org/en/stable/config.html:

>The configuration directory must contain a file named conf.py. This file (containing Python code) is called the “build configuration file” and contains (almost) all configuration needed to customize Sphinx input and output behavior.

   > An optional file docutils.conf can be added to the configuration directory to adjust Docutils configuration if not otherwise overriden or set by Sphinx.
I tried adding a `docutils.conf` to the `scrdir`, but it doesn't work, I don't know what i'm doing wrong:

```
# Docutils configurations
[restructuredtext parser]
smart_quotes: no
```

>As for a work around, the crash is incredibly text specific, so simply disabling smart-quotes in docutils might work:

Btw, `smart-quotes` are disabled by default
> Btw, `smart-quotes` are disabled by default

This is true for docutils, but sphinx has it enabled by default:

```

html_use_smartypants

    If true, SmartyPants will be used to convert quotes and dashes to typographically correct entities. Default: True.

    Deprecated since version 1.6: To disable or customize smart quotes, use the Docutils configuration file (docutils.conf) instead to set there its smart_quotes option.
```

I have confirmed that changing this line:

https://github.com/spyder-ide/spyder/blob/79fe9cb50221db6bd808d39a8836e73b7f329d86/spyder/utils/help/conf.py#L102  

to:

```python
    html_use_smartypants = False
```
removes the smart quotes and `plt.plot()` docs to not crash.

This is a work around of course, but it is simple. Hopefully next time anaconda compiles Qt the problem will be fixed.

Resolving patch:
diff --git a/spyder/utils/help/conf.py b/spyder/utils/help/conf.py
--- a/spyder/utils/help/conf.py
+++ b/spyder/utils/help/conf.py
@@ -99,7 +99,8 @@
 
 # If true, SmartyPants will be used to convert quotes and dashes to
 # typographically correct entities.
-#html_use_smartypants = True
+# Spyder: Disabled to fix conflict with qtwebview and mathjax. See issue #5514
+html_use_smartypants = False
 
 # If false, no module index is generated.
 html_use_modindex = False


Test patch: