Skip to content

Core dump with use.tex #2670

Closed
Closed

Description

@kyleam

With the current master branch (16ed8be), I'm getting an error when text.usetex is set to true. It fails with this core dump.

Running git bisect suggests that f4adec7 ("Use six instead of 2to3") is the first bad commit. One hiccup is that the test script was also showing failure for the use of basestring in line 174 of texmanager.py, but if that line is replaced with a fix from a later commit (d042e90), f4adec7 still seems to be the first commit to show the error.

I've pushed the bisect command ran to this branch.
latex-plot-bisect/latex_plot.py should reproduce the error on the master branch, and run-latex-bisect.sh will run the whole bisect (although it may need to be tweaked because it assumes the presence of /tmp and passes the --user flag to python setup.py install.

I'd guess the error is coming from src/ft2cpp.{cpp,h}, but I don't have enough of a handle on those files to know which changes in f4adec7 are likely culprits.

Hopefully this can be reproduced on other systems. I'm running python 3.3.3 and numpy 1.9.0.dev-3aa76ba on Arch Linux.

Thanks

Activity

  1. mdboom commented on Dec 11, 2013

    @mdboom
    Member

    Unfortunately, I'm having trouble reproducing this on Fedora with python 3.3.3 and numpy 1.9.0.dev-3aa76ba. I suspect it's somehow related to the fonts (or lack thereof) on your system. Can you test with Python 2.x and see whether that also fails for you?

    This may be related to #2635, and you could try applying the patch suggested there (which isn't really a fix, but it may move along to the root cause of the issue).

  2. mdboom commented on Dec 11, 2013

    @mdboom
    Member

    You may also want to try removing your font cache in ~/.cache/matplotlib/fontList.py3k.cache and see if that helps. Let us know if it does so we can work toward a true solution.

  3. kyleam commented on Dec 11, 2013

    @kyleam
    Author

    Thanks for response.

    You may also want to try removing your font cache in
    ~/.cache/matplotlib/fontList.py3k.cache` and see if that helps.

    I still get the failure after removing fontList.py3k.cache and
    tex.cache. I've also tried removing .cache/fontconfig.

    Unfortunately, I'm having trouble reproducing this on Fedora with python
    3.3.3 and numpy 1.9.0.dev-3aa76ba. I suspect it's somehow related to the
    fonts (or lack thereof) on your system.

    That seems reasonable. It's interesting that a recent commit seems to be
    exposing the issue. I'm seeing the error on two machines, but they are
    set up very similarly, so that doesn't say much.

    I have a record of how I customized the fonts, so I'll try to set those
    back to the base install and then test from there.

    Can you test with Python 2.x and see whether that also fails for you?

    I should have included that information that in the initial report. It
    also fails with a
    core dump.

    This may be related to #2635, and you could try applying the patch
    suggested there (which isn't really a fix, but it may move along to
    the root cause of the issue).

    Thanks for pointing that out. Somehow I missed issue in my initial
    searches. I'll have a look.

  4. kyleam commented on Dec 11, 2013

    @kyleam
    Author

    The main font changes I've made are installing ttf-droid fonts and
    adding a custom .config/fontconfig/fonts.conf file. When I remove both
    of these, I still get an error. Perhaps it's something not on my
    system.

  5. mdboom commented on Dec 11, 2013

    @mdboom
    Member

    Or unexpected content in one of the fonts on your system.

    You can print out the files that Freetype is trying to load by applying this patch:

    diff --git a/src/ft2font.cpp b/src/ft2font.cpp
    index 0fb3b8b..b048f28 100644
    --- a/src/ft2font.cpp
    +++ b/src/ft2font.cpp
    @@ -854,6 +854,8 @@ FT2Font::FT2Font(Py::PythonClassInstance *self, Py::Tuple &args, Py::Dict &kwds)
          * that we'll always be able to print. */
         std::string facefile = Py::String(args[0]).encode("unicode_escape");
    
    +    printf("%s\n", facefile.c_str());
    +
         args.verify_length(1);
    
         clear(Py::Tuple(0));
    

    The last font printed may be the culprit. If you share that font with me (or I pull it from the Arch repo or something), I might be able to reproduce the problem here.

  6. WeatherGod commented on Dec 11, 2013

    @WeatherGod
    Member

    Just as a sanity check... did you delete the font cache after reverting
    your font customizations?

    On Wed, Dec 11, 2013 at 12:39 PM, Kyle Meyer notifications@github.comwrote:

    The main font changes I've made are installing ttf-droid fonts and
    adding a custom .config/fontconfig/fonts.conf file. When I remove both
    of these, I still get an error. Perhaps it's something not on my
    system.

    —
    Reply to this email directly or view it on GitHubhttps://github.com//issues/2670#issuecomment-30342733
    .

  7. kyleam commented on Dec 11, 2013

    @kyleam
    Author

    You can print out the files that Freetype is trying to load by applying this patch:

    diff --git a/src/ft2font.cpp b/src/ft2font.cpp
    index 0fb3b8b..b048f28 100644
    --- a/src/ft2font.cpp
    +++ b/src/ft2font.cpp
    @@ -854,6 +854,8 @@ FT2Font::FT2Font(Py::PythonClassInstance *self, Py::Tuple &args, Py::Dict &kwds)
          * that we'll always be able to print. */
         std::string facefile = Py::String(args[0]).encode("unicode_escape");
    
    +    printf("%s\n", facefile.c_str());
    +
         args.verify_length(1);
    
         clear(Py::Tuple(0));
    

    The last font printed may be the culprit. If you share that font
    with me (or I pull it from the Arch repo or something), I might be
    able to reproduce the problem here.

    The patch produces this output:

    /usr/share/texmf-dist/fonts/type1/public/amsfonts/cm/cmr12.pfb

    I've copied the file here:
    https://github.com/kyleam/matplotlib/blob/bisect-latex-plot-error/cmr12.pfb

  8. kyleam commented on Dec 11, 2013

    @kyleam
    Author

    On 12/11/13 12:54, Benjamin Root wrote:

    Just as a sanity check... did you delete the font cache after reverting
    your font customizations?

    The post-install/uninstall hook of the ttf-droid Arch package runs this

    post_install() {
    echo -n "Updating font cache... "
    fc-cache -f > /dev/null
    mkfontscale /usr/share/fonts/TTF
    mkfontdir /usr/share/fonts/TTF
    echo "done."
    }

    I am also deleting .cache/fontconfig and
    .cache/matploltlib/{fontList.py3k.cache,tex.cache}.

    Are there any other files I should be concerned about?

  9. tacaswell commented on Jan 24, 2014

    @tacaswell
    Member

    @kyleam What is the state of this?

  10. kyleam commented on Jan 24, 2014

    @kyleam
    Author

    What is the state of this?

    I'm still seeing this with the current master (c16d2c2).

  11. kyleam commented on Mar 31, 2014

    @kyleam
    Author

    When I last tested this with b5a6c49, it was still failing, but this seems to be working with the current master (b8cb6c3).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions