bugGNU Octave - Bugs: bug #46447, Octave fails to build docs / make...


bug #46447: Octave fails to build docs / make check when OpenGL present but FontConfig absent

Submitted by:  Lachlan Andrew <lachlan>
Submitted on:  Sat 14 Nov 2015 11:05:20 PM UTC  
Category:  Configuration and Build System Severity:  3 - Normal
Priority:  5 - Normal Item Group:  Installation Failure
Status:  Fixed Assigned to:  None
Originator Name:  Lachlan Open/Closed:  Closed
Release:  dev Operating System:  GNU/Linux

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


( Jump to the original submission)

Thu 07 Apr 2016 05:15:53 AM UTC, comment #10: 

I've finally checked, and can't reproduce the problem.  You made the right call by closing it, Rik.

Lachlan Andrew <lachlan>
Thu 24 Mar 2016 04:52:18 AM UTC, comment #9: 

Checking this is still on my to-do list, but not near the top...
I'll re-open this if necessary.

However, the patch is to check that pointers are non-NULL before use, and is probably worthwhile even if the config issues are fixed.

Lachlan Andrew <lachlan>
Thu 24 Mar 2016 04:38:02 AM UTC, comment #8: 

I'm going to assume this has been fixed since I haven't heard differently.  Closing report.

Rik <rik5>
Project Administrator
Tue 01 Mar 2016 07:24:45 PM UTC, comment #7: 

@Lachlan: Could you verify that this is still an issue now that jwe checked in a change to untangle the OpenGL/FLTK/FontConfig mess (http://hg.savannah.gnu.org/hgweb/octave/rev/1487a68a496a)?

Rik <rik5>
Project Administrator
Wed 20 Jan 2016 05:54:41 PM UTC, comment #6: 

Here, at last, is the patch to stop the segfault if something goes wrong loading fonts.

I think it will affect other font-related crashes like bug #39936, bug #45214 and perhaps bug #46926, but am not sure.  I haven't tested it yet, but checking for things being non-NULL before use is clearly a Good Thing(tm).

Rik, I'll try to find time to test your patch, too.

(file #36103)

Lachlan Andrew <lachlan>
Tue 24 Nov 2015 11:04:14 PM UTC, comment #5: 

Ooops.  See my second attached patch for the real thing.

(file #35542)

Rik <rik5>
Project Administrator
Tue 24 Nov 2015 11:02:00 PM UTC, comment #4: 

@Mike: I've attached a patch for the stable branch that won't build FLTK or the GUI (hence Qt) unless OpenGL, FreeType, and Fontconfig are present.  This could use some testing since it turned out to be a fairly large change.

I didn't put a dependency on OSmesa since I believe it is possible to have a working OpenGL implementation without offscreen rendering.

(file #35541)

Rik <rik5>
Project Administrator
Tue 24 Nov 2015 05:01:00 PM UTC, comment #3: 

Confirmed here, building without fontconfig.

Version 4.0.0 fails with "error: legend: A(I): index out of bounds; value 3 out of bound 0", the default branch fails with the mentioned segfault or with "error: extents(3); out of bound 0".

I notice that configure ends with "WARNING: Fontconfig library not found.  Native graphics will be disabled." but yet the fltk and qt toolkits are still enabled, not sure why that is. I agree this should probably be fixed, on the stable branch if possible.

Mike Miller <mtmiller>
Project Administrator
Sat 21 Nov 2015 04:26:30 AM UTC, comment #2: 

Building the docs only affects developers, but the fact that Octave crashes when trying to create a figure affects normal users.

Checking font->get_face () is non-NULL before dereferencing it is basic defensive programming.  With that fixed, the build fails because the image files don't get created, but at least Octave doesn't crash.

I can happily submit a patch that stops Octave crashing, but I think the cleaner approach is to disable native graphics (as configure says will happen, but seems not to) if the necessary libraries aren't found.

Lachlan Andrew <lachlan>
Tue 17 Nov 2015 07:32:00 PM UTC, comment #1: 

Is this only a problem for developers?

The distributed tarball includes all the documentation so it does not need to be built by an end user.  They still might want to run 'make check' before running 'make install' so I would like to verify that that sequence works.  But if it is only developers that have to suffer if they don't have the correct dependencies then that is less dire.

Rik <rik5>
Project Administrator
Sat 14 Nov 2015 11:05:20 PM UTC, original submission:  

When OpenGL is absent, ../configure correctly disables its use.  However, when OpenGL is present but FontConfig, FLTK config and OSMesa are absent, build fails with

warning: ft_render: invalid bounding box, cannot render
warning: called from
    __axis_label__ at line 30 column 3
    ylabel at line 53 column 8
    plotimages at line 93 column 5
warning: ft_render: invalid bounding box, cannot render
warning: called from
    __axis_label__ at line 30 column 3
    title at line 51 column 8
    plotimages at line 94 column 5
panic: Segmentation fault -- stopping myself...
attempting to save variables to 'octave-workspace'...
save to 'octave-workspace' complete
/bin/bash: line 1: 21281 Segmentation fault      /tmp/octavetmp/run-octave -f -q -H -p /home/lachlan/src/octave/doc/interpreter/ --eval "plotimages ('doc/interpreter/', 'extended', 'eps');"
make[2]: *** [doc/interpreter/extended.eps] Error 139
make[2]: Leaving directory `/tmp/octavetmp'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/tmp/octavetmp'
make: *** [all] Error 2

From memory, the SEGV is in libinterp/corefcn/txt-eng-ft.cc

ft_render::update_line_bbox (void)
  // Called after a font change, when in MODE_BBOX mode, to update the
  // current line bbox with the new font metrics. This also includes the
  // current yoffset, that is the offset of the current glyph's baseline
  // the line's baseline.

  if (mode == MODE_BBOX)
      int asc = font.get_face ()->size->metrics.ascender >> 6;

because font.get_face () is NULL.  However, the "correct" fix is probably to disable OpenGL.  I haven't yet chased down which particular dependency is causing the crash, but I assume it is FontConfig.

Being unable to make the docs is unfortunate, but I'm particularly worried that it seems impossible to "make check" if making the docs fails.  Would it be possible allow "make check" to run without requiring the docs to be built?

Lachlan Andrew <lachlan>


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

Attached Files
file #36103:  bug_46447_segv.cset added by lachlan (2KiB - application/octet-stream)
file #35542:  configure.ac.patch2 added by rik5 (4KiB - application/octet-stream)
file #35541:  configure.ac.patch added by rik5 (4KiB - text/x-diff)


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by mtmiller (Posted a comment)
  • -email is unavailable- added by rik5 (Posted a comment)
  • -email is unavailable- added by lachlan (Submitted the item)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    Follow 6 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2016-03-24 rik5 StatusConfirmed => Fixed
        Open/ClosedOpen => Closed
    2016-01-20 lachlan Attached File- => Added bug_46447_segv.cset, #36103
    2015-11-24 rik5 Attached File- => Added configure.ac.patch2, #35542
    2015-11-24 rik5 Attached File- => Added configure.ac.patch, #35541
    2015-11-24 mtmiller StatusNone => Confirmed

    Back to the top

    Powered by Savane 3.6