Bug 126022 - crash in drawinglayer when converting docx to odt
Summary: crash in drawinglayer when converting docx to odt
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
6.4.0.0.alpha1+
Hardware: All All
: medium normal
Assignee: Thorsten Behrens (allotropia)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-06-20 12:13 UTC by Noel Grandin
Modified: 2021-08-19 12:07 UTC (History)
5 users (show)

See Also:
Crash report or crash signature:


Attachments
helgrind log (9.20 MB, text/plain)
2019-06-20 12:15 UTC, Noel Grandin
Details
backtrace (278.70 KB, text/plain)
2019-06-20 12:16 UTC, Noel Grandin
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Noel Grandin 2019-06-20 12:13:57 UTC
Description:
Caolan's crash testing found a (hard to reproduce) crash.

Brain dump of stuff found when investigating this crash.

Steps to Reproduce:
x

Actual Results:
x

Expected Results:
x


Reproducible: Always


User Profile Reset: No



Additional Info:
x
Comment 1 Noel Grandin 2019-06-20 12:14:39 UTC
IRC discussion:

<caolan> https://dev-builds.libreoffice.org/crashtest/27e3ed0d25735603d2c82744e3a8f5f3e0a8d043/backtraces/task395-core.16181.backtrace.txt looks like some threading catastrophy
<vmiklos> caolan: 657413b5deea11a850970f23cba2cf34a5bdf8ea perhaps? but it's not new..
<IZBot> core - Refactor 3D renderer to use multithreading - http://cgit.freedesktop.org/libreoffice/core/commit/?id=657413b5deea11a850970f23cba2cf34a5bdf8ea
<noelgrandin> caolan, possibly somewhere in that stack is a o3tl::cow_wrapper that is not using thread-safe ref-counting
<caolan> hum, "typedef o3tl::cow_wrapper< Impl2DHomMatrix > ImplType;" while "typedef o3tl::cow_wrapper< Impl3DHomMatrix, o3tl::ThreadSafeRefCountingPolicy > ImplType;" most odd
<mst___> does 3d rendering use 2d matrices?
<thorsten> for putting pixel on the screen, not unlikely
<mst___> if we replace plain add instructions with locked add, is the multi-threaded code still faster :)
<noelgrandin> caolan, that isLastLineDefault method in ImplHomMatrixTemplate looks suspicious. Would be fairly easy there to end up working on freed memory
<caolan> sigh, dunno, not reproducing trivially
<noelgrandin> caolan, helgrind?
<noelgrandin> caolan, or rr --chaos, often good at triggering these kinds of timing issues
<caolan> never had any luck with helgrind and libreoffice
<noelgrandin> caolan, where do I get that file and what is that crash-test doing? some cloudon file?
<caolan> noelgrandin, I'll pass it on, it from cloudon's compatibility matrix collection, its just converting a .docx to .odt
Comment 2 Noel Grandin 2019-06-20 12:15:47 UTC
Created attachment 152309 [details]
helgrind log
Comment 3 Noel Grandin 2019-06-20 12:16:10 UTC
Created attachment 152310 [details]
backtrace
Comment 4 Noel Grandin 2019-06-20 12:24:26 UTC
Noel's notes:

(*) Helgrind dumps lots of stuff - grep for the drawinglayer related stuff, and look for "This conflicts with " for the (IMO) more serious races. Straight read races I don't think are likely to cause crashes.

(*) the getNormal() related stuff looks benign, even if we get inconsistent data for a bit, it will get rebuilt correctly.

(*) Stuff like SdrLathePrimitive3D::get3DDecomposition is the problem - it locks before writing to the relevant fields, but not before reading, which means the read side can see inconsistent data.

(*) my command line for testing was
VALGRIND="helgrind --track-lockorders=no --gen-suppressions=all" instdir/program/soffice --convert-to odt filename.docx
Comment 5 Xisco Faulí 2019-06-21 11:55:12 UTC
Hi Noel,
Could you please attach the document to reproduce the crash ?
Comment 6 Noel Grandin 2019-06-21 11:57:02 UTC
@X1sco the doc is private, I have forwarded the doc to thorsten - this bug is really just for thorsten
Comment 7 Xisco Faulí 2019-06-21 12:00:33 UTC
(In reply to Noel Grandin from comment #6)
> @X1sco the doc is private, I have forwarded the doc to thorsten - this bug
> is really just for thorsten

fair enough ;-)
Comment 8 Xisco Faulí 2021-02-09 14:34:57 UTC
Hi Noel, is this issue still reproducible in a master build ?
Comment 9 Noel Grandin 2021-02-14 17:33:31 UTC
Can't find the emails relevant to this, suggest we just close it
Comment 10 Roman Kuznetsov 2021-08-14 15:35:41 UTC
(In reply to Noel Grandin from comment #9)
> Can't find the emails relevant to this, suggest we just close it

Let's close it then as WFM

If Thorsten or Noel think different then just reopen it. Thanks
Comment 11 Thorsten Behrens (allotropia) 2021-08-19 12:07:55 UTC
Yeah, can't repro anymore here either