octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #57591] Segmentation faults when running the t


From: Rik
Subject: [Octave-bug-tracker] [bug #57591] Segmentation faults when running the test suite (mostly with clang)
Date: Fri, 14 Aug 2020 15:09:05 -0400 (EDT)
User-agent: Mozilla/5.0 (Windows NT 10.0; WOW64; Trident/7.0; rv:11.0) like Gecko

Follow-up Comment #51, bug #57591 (project octave):

What's interesting is that the failures all seem to be with files which are
not related to actual plotting.  It seems that it is the generation of images
in the ".txt" format which are failing, but looking at the m-files in
doc/interpreter one sees


  if (strcmp (typ , "txt"))
    image_as_txt (d, nm);


and then


## generate something for the texinfo @image command to process
function image_as_txt (d, nm)
  fid = fopen (fullfile (d, [nm ".txt"]), "wt");
  fputs (fid, "\n");
  fputs (fid, "+---------------------------------+\n");
  fputs (fid, "| Image unavailable in text mode. |\n");
  fputs (fid, "+---------------------------------+\n");
  fclose (fid);
endfunction


So, no real plotting is being done and it may be the speed with which the
graphics system is setup and torn down which is the problem.

Taking plotimages.m as representative, the function begins


function plotimages (d, nm, typ)
  set_graphics_toolkit ();
  set_print_size ();
  hide_output ();
  outfile = fullfile (d, [nm "." typ]);
  if (strcmp (typ, "png"))
    set (groot, "defaulttextfontname", "*");
  endif
  if (strcmp (typ, "eps"))
    d_typ = "-depsc2";
  else
    d_typ = ["-d", typ];
  endif

  if (strcmp (typ , "txt"))
    image_as_txt (d, nm);


and then ends with


  hide_output ();
endfunction


Shooting in the dark, what if we move the test for the "txt" format to the top
of the file with this code


function plotimages (d, nm, typ)

  if (strcmp (typ , "txt"))
    image_as_txt (d, nm);
    return;
  endif

  set_graphics_toolkit ();
  set_print_size ();


The graphics system will never get invoked.


    _______________________________________________________

Reply to this item at:

  <https://savannah.gnu.org/bugs/?57591>

_______________________________________________
  Message sent via Savannah
  https://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]