After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 743597 - segfault in goc_canvas_invalidate_region
segfault in goc_canvas_invalidate_region
Status: RESOLVED OBSOLETE
Product: Gnumeric
Classification: Applications
Component: GUI
1.12.x
Other Linux
: Normal normal
: ---
Assigned To: Jody Goldberg
Jody Goldberg
Depends on:
Blocks:
 
 
Reported: 2015-01-27 18:59 UTC by John Denker
Modified: 2018-05-22 14:16 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
vulnerable to segfault (14.98 KB, application/x-gnumeric)
2015-01-27 18:59 UTC, John Denker
Details
output from valgrind memcheck (3.48 KB, text/plain)
2015-01-28 17:11 UTC, John Denker
Details
output from valgrind sgcheck (2.21 KB, text/plain)
2015-01-28 17:12 UTC, John Denker
Details
gnmvalgrind results, as requested (61.66 KB, text/plain)
2015-01-29 04:24 UTC, John Denker
Details

Description John Denker 2015-01-27 18:59:45 UTC
Created attachment 295580 [details]
vulnerable to segfault

It might be good to take a look at goc_canvas_invalidate_region.

I've been getting segfaults.  The "priv" pointer is zero.

The attached file demonstrates the problem.  Type a single "="
sign in cell A1 (or anywhere else) and then click on cell B1
(or anywhere else).  Observe immediate segfault.

This is not urgent for me;  there are lots of obvious ways
of patching the code to make the problem go away.  Somebody
who knows more than me can decide what is best.


$x/gnumeric --version
gnumeric version '1.12.20'
datadir := '/usr/src/gnumeric/gitball/gnumeric/1.12.20'
libdir := '/usr/src/gnumeric/gitball/'


uname -a
Linux asclepias 3.18.0+ #2 SMP Sun Dec 21 18:25:03 MST 2014 x86_64 x86_64 x86_64 GNU/Linux
Comment 1 Andreas J. Guelzow 2015-01-27 23:28:40 UTC
works fine for me....
Comment 2 Jean Bréfort 2015-01-28 10:43:45 UTC
works for me as well.
Comment 3 Jean Bréfort 2015-01-28 11:02:56 UTC
Which goffice version?
Can you provide a stack trace?

GcoCanvas::priv is initaliazed in goc_canvas_init() it can't be NULL unless some code changes it, but this should just not happen.
Comment 4 Morten Welinder 2015-01-28 16:01:27 UTC
This is quite strange.

Could you try running under Valgrind?
Comment 5 John Denker 2015-01-28 16:31:13 UTC
Status update:  
I have recompiled since the original report.
Now I am getting a different symptom:  not segfault,
but other very weird behavior.  Smells like memory
corruption, but hard to be sure.

Previously it was 100% reproducible chez moi;  now
it is only about 30% reproducible, but sticky.  That
is to say, sometimes when I start the program, it
works fine, but other times it goes bad.  Once a bad 
instance is started, it does bad things repeatedly.

The details probably don't mean much, but here are
the latest observations:
  Start the program
  Type an = sign in cell A1
  Click on B1.
  In good mode, this enters into A1 a reference to B1.
  In bad mode, it just /selects/ B1, 
     leaving just an = sign in A1.
  Further typing and further clicks behave the same.

I'll do some valgrinding when I get a chance.
Comment 6 John Denker 2015-01-28 17:11:38 UTC
Created attachment 295682 [details]
output from valgrind memcheck
Comment 7 John Denker 2015-01-28 17:12:07 UTC
Created attachment 295683 [details]
output from valgrind sgcheck
Comment 8 John Denker 2015-01-28 17:44:50 UTC
A clue:

With valgrind --malloc-fill=00 $x/gnumeric segfault.gnumeric
I observed bad behavior 5 times in a row.

With valgrind --malloc-fill=99 $x/gnumeric segfault.gnumeric
i.e. different fill, I observed normal behavior 10 times in a row.
Comment 9 Morten Welinder 2015-01-28 19:13:30 UTC
It looks like you are running Gnumeric from the build tree.
There's a libtool wrapper in the way at that point.

The best way to valgrind there is to do something like

    cd .../src
    ../tools/gnmvalgrind ./gnumeric segfault.gnumeric

This also sets various environment variables that improve the valgrind
effectiveness.
Comment 10 John Denker 2015-01-29 04:24:22 UTC
Created attachment 295714 [details]
gnmvalgrind results, as requested
Comment 11 Morten Welinder 2015-01-30 20:13:58 UTC
There is, strangely, nothing in that valgrind report that suggests the
program crashed.
Comment 12 John Denker 2015-01-30 20:33:33 UTC
The program behaves differently in each of the following cases:
  a) when run directly
  b) when run under valgrind --malloc-fill=0
  c) when run under valgrind --malloc-fill=99

Note that gnmvalgrind seems always similar to case (c)
above, not case (b), even when I ask for --malloc-fill=0.

Strange, indeed.
Comment 13 GNOME Infrastructure Team 2018-05-22 14:16:25 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to GNOME's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.gnome.org/GNOME/gnumeric/issues/272.