Bug 53872 - CRASH - opening database report
Summary: CRASH - opening database report
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
3.5 Daily
Hardware: x86-64 (AMD64) All
: highest critical
Assignee: Michael Stahl (allotropia)
URL:
Whiteboard: target:3.5.7 target:3.7.0 target:3.6.2
Keywords: regression
Depends on:
Blocks: mab3.5
  Show dependency treegraph
 
Reported: 2012-08-21 09:17 UTC by Alex Thurgood
Modified: 2012-09-14 09:05 UTC (History)
10 users (show)

See Also:
Crash report or crash signature:


Attachments
test odb file with report (34.75 KB, application/vnd.oasis.opendocument.database)
2012-08-21 09:21 UTC, Alex Thurgood
Details
apple crash trace (75.40 KB, text/plain)
2012-08-21 09:22 UTC, Alex Thurgood
Details
bt with symbols on master (16.94 KB, text/plain)
2012-08-21 21:24 UTC, Julien Nabet
Details
proposed patch (1.49 KB, text/plain)
2012-08-21 21:32 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Thurgood 2012-08-21 09:17:39 UTC
Downloaded the daily build no-moz (21/08) of Mac OSX

1) Loaded a ODB file (attached)
2) Clicked on Reports
3) Double-clicked on ELEVE
4) Crash 

Mac OSX 10.8 Mountain Lion


Alex
Comment 1 Alex Thurgood 2012-08-21 09:21:11 UTC
Created attachment 65870 [details]
test odb file with report
Comment 2 Alex Thurgood 2012-08-21 09:22:04 UTC
Created attachment 65871 [details]
apple crash trace
Comment 3 Alex Thurgood 2012-08-21 09:26:28 UTC
The same file, opened with LO 3.5.5.3, does not cause a crash, but an error message is displayed.
Comment 4 Alex Thurgood 2012-08-21 10:15:18 UTC
reproducible every time
Comment 5 Julien Nabet 2012-08-21 21:24:37 UTC
Created attachment 65912 [details]
bt with symbols on master

On pc Debian x86-64 with master sources updated today, I reproduced the problem.
I attached bt with symbols
Comment 6 Julien Nabet 2012-08-21 21:32:19 UTC
Created attachment 65914 [details]
proposed patch

The problem is on this line:
1189         sal_Int32 nSectionHeight = xFixedLine->getSection()->getHeight();
No test is made to know if xFixedLine->getSection() exists or not.

I attached a proposed patch, perhaps naive/wrong but which allows to open the report.
Comment 7 Julien Nabet 2012-08-21 21:33:20 UTC
lionel: what do you think about this patch? If ok, I can push it on master.
Comment 8 Alex Thurgood 2012-08-22 05:44:47 UTC
As Julien also reproduced on Debian, updating OS/platform and changing subject line.


Alex
Comment 9 Alex Thurgood 2012-08-22 05:47:25 UTC
@Julien
Have there been any recent changes in section height calculation that might have inadvertently caused this ?


Alex
Comment 10 Julien Nabet 2012-08-22 05:54:42 UTC
(In reply to comment #9)
> Have there been any recent changes in section height calculation that might
> have inadvertently caused this ?
By looking at the git history of the file reportdesign/source/filter/xml/xmlExport.cxx, it's like this since the beginning (09/07/2007).

BTW, could you indicate how did you create this report? Did you use a specific option for example?
Comment 11 Alex Thurgood 2012-08-22 06:05:48 UTC
(In reply to comment #10)

> By looking at the git history of the file
> reportdesign/source/filter/xml/xmlExport.cxx, it's like this since the
> beginning (09/07/2007).

Ah OK.


> 
> BTW, could you indicate how did you create this report? Did you use a specific
> option for example?

I didn't create it, it was supplied by someone from the French user/discussion list with a problem they were attempting to solve.

In LO 3.5.5, the same report causes a Java AWT thread attachment error on MacOSX, and refuses to load. I've opened a separate bug report for that because it is Mac specific (no-one else could reproduce it on other OSes, and Lionel doesn't have a Mac to test on, so I put Thorsten on CC). 

Alex
Comment 12 Lionel Elie Mamane 2012-08-22 06:09:39 UTC
(In reply to comment #10)
> (In reply to comment #9)
>> Have there been any recent changes in section height calculation that might
>> have inadvertently caused this ?

> By looking at the git history of the file
> reportdesign/source/filter/xml/xmlExport.cxx, it's like this since the
> beginning (09/07/2007).

My money is on "for some reason, the control in xFixedLine, when it was *created* / loaded, was not attached to a section, while it should have been".

It could be for a reason similar to what happened in bug 52399, but that is just a wild guess.
Comment 13 Julien Nabet 2012-08-22 09:51:39 UTC
Alex: I'll try your file tonight with 3.5 and 3.6 sources.

Just thinking for possible changes which could have happened between different versions:
- section management
- exception management
About your comment11, what's the fdo?
Comment 14 Julien Nabet 2012-08-22 19:40:57 UTC
With 3.5 sources updated yesterday and 3.6 sources updated today, I reproduced the pb with an equivalent stacktrace.
Comment 15 Julien Nabet 2012-08-22 21:39:19 UTC
I submited the patch for reviewing (see http://nabble.documentfoundation.org/PATCH-Related-fdo-53872-CRASH-opening-database-report-td4003012.html)
Comment 16 Lionel Elie Mamane 2012-08-23 05:50:38 UTC
There is something wrong with fixed lines in reportbuilder reports for a long time... See e.g. bug 33617, bug 52471, ...

I wouldn't be too surprised if the ultimate reason for all these bugs were one and the same.
Comment 17 Lionel Elie Mamane 2012-08-23 15:13:55 UTC
This is *definitely* a larger problem with linking controls to their enclosing section: With a debug build, I get:


warn:legacy.osl:23098:1:/home/master/src/libreoffice/workdirs/libreoffice-3.6/reportdesign/source/ui/report/FixedTextColor.cxx:161: caught an exception!
in function:virtual void rptui::FixedTextColor::handle(const com::sun::star::uno::Reference<com::sun::star::uno::XInterface>&)
type: com.sun.star.uno.RuntimeException
message: unsatisfied query for interface of type com.sun.star.report.XSection!
context: N12reportdesign15OReportDrawPageE

warn:legacy.osl:23098:1:/home/master/src/libreoffice/workdirs/libreoffice-3.6/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx:132: FormattedFieldBeautifier::setPlaceholderText: invalid peer!
warn:legacy.osl:23098:1:/home/master/src/libreoffice/workdirs/libreoffice-3.6/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx:125: caught an exception!
in function:void rptui::FormattedFieldBeautifier::setPlaceholderText(const com::sun::star::uno::Reference<com::sun::star::uno::XInterface>&)
type: com.sun.star.uno.RuntimeException

warn:legacy.osl:23098:1:/home/master/src/libreoffice/workdirs/libreoffice-3.6/reportdesign/source/ui/report/FixedTextColor.cxx:161: caught an exception!
in function:virtual void rptui::FixedTextColor::handle(const com::sun::star::uno::Reference<com::sun::star::uno::XInterface>&)
type: com.sun.star.uno.RuntimeException
message: unsatisfied query for interface of type com.sun.star.report.XSection!
context: N12reportdesign15OReportDrawPageE

warn:legacy.osl:23098:1:/home/master/src/libreoffice/workdirs/libreoffice-3.6/reportdesign/source/ui/report/FixedTextColor.cxx:161: caught an exception!
in function:virtual void rptui::FixedTextColor::handle(const com::sun::star::uno::Reference<com::sun::star::uno::XInterface>&)
type: com.sun.star.uno.RuntimeException
message: unsatisfied query for interface of type com.sun.star.report.XSection!
context: N12reportdesign15OReportDrawPageE

warn:legacy.osl:23098:1:/home/master/src/libreoffice/workdirs/libreoffice-3.6/reportdesign/source/ui/report/FixedTextColor.cxx:161: caught an exception!
in function:virtual void rptui::FixedTextColor::handle(const com::sun::star::uno::Reference<com::sun::star::uno::XInterface>&)
type: com.sun.star.uno.RuntimeException
message: unsatisfied query for interface of type com.sun.star.report.XSection!
context: N12reportdesign15OReportDrawPageE

warn:legacy.osl:23098:1:/home/master/src/libreoffice/workdirs/libreoffice-3.6/reportdesign/source/ui/report/FixedTextColor.cxx:161: caught an exception!
in function:virtual void rptui::FixedTextColor::handle(const com::sun::star::uno::Reference<com::sun::star::uno::XInterface>&)
type: com.sun.star.uno.RuntimeException
message: unsatisfied query for interface of type com.sun.star.report.XSection!
context: N12reportdesign15OReportDrawPageE

warn:legacy.osl:23098:1:/home/master/src/libreoffice/workdirs/libreoffice-3.6/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx:132: FormattedFieldBeautifier::setPlaceholderText: invalid peer!
warn:legacy.osl:23098:1:/home/master/src/libreoffice/workdirs/libreoffice-3.6/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx:125: caught an exception!
in function:void rptui::FormattedFieldBeautifier::setPlaceholderText(const com::sun::star::uno::Reference<com::sun::star::uno::XInterface>&)
type: com.sun.star.uno.RuntimeException

warn:legacy.osl:23098:1:/home/master/src/libreoffice/workdirs/libreoffice-3.6/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx:132: FormattedFieldBeautifier::setPlaceholderText: invalid peer!
warn:legacy.osl:23098:1:/home/master/src/libreoffice/workdirs/libreoffice-3.6/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx:125: caught an exception!
in function:void rptui::FormattedFieldBeautifier::setPlaceholderText(const com::sun::star::uno::Reference<com::sun::star::uno::XInterface>&)
type: com.sun.star.uno.RuntimeException

warn:legacy.osl:23098:1:/home/master/src/libreoffice/workdirs/libreoffice-3.6/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx:132: FormattedFieldBeautifier::setPlaceholderText: invalid peer!
warn:legacy.osl:23098:1:/home/master/src/libreoffice/workdirs/libreoffice-3.6/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx:125: caught an exception!
in function:void rptui::FormattedFieldBeautifier::setPlaceholderText(const com::sun::star::uno::Reference<com::sun::star::uno::XInterface>&)
type: com.sun.star.uno.RuntimeException

warn:legacy.osl:23098:1:/home/master/src/libreoffice/workdirs/libreoffice-3.6/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx:132: FormattedFieldBeautifier::setPlaceholderText: invalid peer!
warn:legacy.osl:23098:1:/home/master/src/libreoffice/workdirs/libreoffice-3.6/reportdesign/source/ui/report/FormattedFieldBeautifier.cxx:125: caught an exception!
in function:void rptui::FormattedFieldBeautifier::setPlaceholderText(const com::sun::star::uno::Reference<com::sun::star::uno::XInterface>&)
type: com.sun.star.uno.RuntimeException

warn:legacy.osl:23098:1:/home/master/src/libreoffice/workdirs/libreoffice-3.6/dbaccess/source/ui/browser/genericcontroller.cxx:1350: SbaTableQueryBrowser::openHelpAgent: could not get a dispatcher!
warn:configmgr:23098:14:/home/master/src/libreoffice/workdirs/libreoffice-3.6/configmgr/source/propertynode.cxx:83: non-nillable property without value
Comment 18 Lionel Elie Mamane 2012-08-31 04:30:43 UTC
Setting version to 3.5 daily as per comment 14
Comment 19 Roman Eisele 2012-09-03 08:34:19 UTC
(In reply to comment #18)
> Setting version to 3.5 daily as per comment 14

Therefore removed from "LibO 3.6 most annyoing bugs" and "LibO 3.7 most annyoing bugs", and added to "LibO 3.5 most annyoing bugs".
Comment 20 Lionel Elie Mamane 2012-09-03 23:19:30 UTC
Aha! Reverting:

 commit 05218c101df486302bf4cfe8be23ad840daa3f73
 Author: Michael Stahl <mstahl@redhat.com>
 Commit: Miklos Vajna <vmiklos@suse.cz>

    fdo#53154: fix report design wizard crash:
    
    As described by Stephan in the bug report, the XAggregation usage in
    OSection of SvxFmDrawPage is broken; replace it by explicit forwarding
    of the XDrawPage, XShapeGrouper, XFormsSupplier2 methods; it seems
    to fix the crash here.  Also get rid of horrid refcount manipulation
    etc. while at it.
    
    (cherry picked from commit 8ec791316c1d90b25e85c94ad105e9cc62e568e2)
    
    Change-Id: Ib08830d2092bd2026db5b57c1c2e165b946889b3
    Signed-off-by: Miklos Vajna <vmiklos@suse.cz>


Fixes this crash. Michael Stahl, this is your commit, so you might have a clue why it makes controls orphan of their section? Thanks in advance for taking a look.
Comment 21 Lionel Elie Mamane 2012-09-04 00:38:35 UTC
(In reply to comment #20)
> Aha! Reverting:
> 
>  commit 05218c101df486302bf4cfe8be23ad840daa3f73
>  Author: Michael Stahl <mstahl@redhat.com>

> Fixes this crash. Michael Stahl, this is your commit, so you might have a clue
> why it makes controls orphan of their section?

I'm trying to understand that commit. One weird thing catches my eye: it introduces a private m_xDrawPage_Tunnel data member to class reportdesign::OSection, but never sets it.
Comment 22 Michael Stahl (allotropia) 2012-09-04 16:27:29 UTC
yes that is evidently caused by the XAggregation removal;

the call to getSection accesses (through a pile of macros) the un-aggregated SvxDrawPage:

#0  SdrPage::getUnoPage (this=0x4bfc3a0) at svx/source/svdraw/svdpage.cxx:1798
#1  0x00007fe4e51dfd42 in SvxShape::getParent (this=0x463dcd8) at svx/source/unodraw/unoshape.cxx:3856
#2  0x00007fe4e1359157 in reportdesign::OShapeHelper::getParent<reportdesign::OFixedLine> (_pShape=0x4872f30) at reportdesign/source/core/inc/Tools.hxx:174
#3  0x00007fe4e1351fb3 in reportdesign::OFixedLine::getParent (this=0x4872f30) at reportdesign/source/core/api/FixedLine.cxx:445
#4  0x00007fe4e1350e55 in reportdesign::OFixedLine::getSection (this=0x4872f30) at reportdesign/source/core/api/FixedLine.cxx:255
#5  0x00007fe4e0849ac3 in rptxml::ORptExport::exportAutoStyle

which is then queried for reportdesign::XSection unsuccessfully:

#0  SdrPage::getUnoPage (this=0x4bfc3a0) at svx/source/svdraw/svdpage.cxx:1798
#1  0x00007fe4e51dfd42 in SvxShape::getParent (this=0x463dcd8) at svx/source/unodraw/unoshape.cxx:3856
#2  0x00007fe4e1359157 in reportdesign::OShapeHelper::getParent<reportdesign::OFixedLine> (_pShape=0x4872f30) at reportdesign/source/core/inc/Tools.hxx:174
Comment 23 Michael Stahl (allotropia) 2012-09-04 16:29:57 UTC
oops, query is here:

#0  reportdesign::lcl_getSection (_xReportComponent=uno::Reference to {
  _vptr.XInterface = 0x7fe4e16c0368
}) at reportdesign/source/core/api/Tools.cxx:34
#1  0x00007fe4e1350e97 in reportdesign::OFixedLine::getSection (this=0x4872f30) at reportdesign/source/core/api/FixedLine.cxx:255
Comment 24 Not Assigned 2012-09-14 08:20:06 UTC
Michael Stahl committed a patch related to this issue.
It has been pushed to "libreoffice-3-5":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=3be6139a01436712405cb7698903b57c0eee2aea&g=libreoffice-3-5

fdo#53872: reportdesign: fix section drawpage crash:


It will be available in LibreOffice 3.5.7.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.