Bug 107297 - Crash in: StarBASIC::~StarBASIC() - Windows only
Summary: Crash in: StarBASIC::~StarBASIC() - Windows only
Status: RESOLVED INSUFFICIENTDATA
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Writer (show other bugs)
Version:
(earliest affected)
5.2.6.2 release
Hardware: All Windows (All)
: low major
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2017-04-20 15:10 UTC by Timur
Modified: 2017-12-15 10:35 UTC (History)
2 users (show)

See Also:
Crash report or crash signature: ["StarBASIC::~StarBASIC()"]
Regression By:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Timur 2017-04-20 15:10:06 UTC
This bug was filed from the crash reporting server and is br-dd78e6d2-a7c0-4766-8907-c08c19a85440.
=========================================

I don't know how I got this one, maybe on Writer close. But I had crash on paste before and restarted LO. 
This is working LO with add-ons, I can't say whether some of them caused this. 

There are 34 pages of this crash: http://crashreport.libreoffice.org/stats/signature/StarBASIC::~StarBASIC%28%29
Newest is for LO 5.3.1.2. 

BTW: how do we sort this crash list by version?
Comment 1 Xisco Faulí 2017-04-20 17:49:07 UTC
You can see it in the summary tab in http://crashreport.libreoffice.org/stats/signature/StarBASIC::~StarBASIC%28%29
It seems most of the reports are from 5.2.4.2 but there's still a few from the latest versions.
Did you copy something to clipboard before you close Writer ?
Comment 2 Timur 2017-04-28 16:48:37 UTC
I can't remember, maybe, or I printed this file.
Comment 3 LeMoyne Castle 2017-05-02 16:45:43 UTC
@Timur - can see reports by version with http://crashreport.libreoffice.org/stats/version/5.3.1.2  or other version number at the end

~~~~~><>~~~~~><>~~~~~><>~~~~~~~~~~~~~~

Went through several (>=10) of the stack traces on the crash reports with this signature.  They all showed evidence of this being a 'crash on close of LO'.  Reporter (Timur) said was using add-ons so added see also: bug 106294 (crash on close of LO with macro running).  Will do work under that bug (with test doc for repro), but leaving this open as non-dup to preserve visibility of crashreporter to see if fixes for that actually make this one go away too.

I think there are two issues here:
I am confident that there is at least one hardware independent issue here: all calls that start StarBasic need protection in case LO is closed (as in fix for Bug 88985).  However, the Linux crash stack traces I am getting directly show significant(?) differences in the way that the visual studio and gcc compilers generate and call the destructors for Basic objects.  It is striking that the *order* of the calls of Basic's coded destructors & compiler generated default destructors appears to be reversed between the Linux and Windows build systems, and that the same destructor appears to be called twice in Linux.  Will do the changes to try to flatten the destruction handling here as that is a separate problem from the lack of close protection for running Basic.  

The second issue:
There are  other signatures in crashreporter that show the 'crash on close of LO with Basic' under other Basic destructor signatures: e.g. SbiObject'vector deleting destructor' [IIRC], etc.  There are also suspiciously similar reports of issues with and MS bug fixes for Visual Studio's generation of default destructors.  The thing to try is to correct the Basic destructor declarations so that they are no longer oddly or ill-formed (outside modern C++ standards). In short, make Basic's destructors public.  I am quite sure that much of the Basic code predates all but the earliest C++ standards and best practices.  

The upshot (short version):
I will work on the separate issues uncovered by 'crash in Basic on close of LO' bugs in the following way and order: 
1.  Bug 106294 - establish consistent protection for Basic at ALL calls that start StarBasic as Caolan did for bug 88985.  External to Basic + a direct fix.  Can test directly with close during long-running macro.
2.  Bug 107297 - Make Basic's destructors public to bring the destruction of Basic objects in compliance with C++ standards/best practices in order to avoid compiler+linker confusion and gross differences between VS and gcc.  Internal to Basic - an indirect (compiler-mediated) potential(!) fix.  Might be hard to verify and will require much more thorough testing of Basic to try to avoid side effects.  Will be obvious as a separate issue if the protection fix only works reliably on Linux and we still get crashes on Windows.
Comment 4 Julien Nabet 2017-05-02 19:38:48 UTC
Let's put ASSIGNED status since there's an assignee
Comment 5 Xisco Faulí 2017-09-11 08:25:17 UTC
Dear developer,
This bug has been in ASSIGNED status for more than 3 months without any
activity. Resetting it to NEW.
Please assigned it back to yourself if you're still working on this.
Comment 6 Xisco Faulí 2017-12-14 11:35:55 UTC
Hi Timur,
The issues seems no longer reported in http://crashreport.libreoffice.org/stats/signature/StarBASIC::~StarBASIC().
Should be close this as RESOLVED WORKSFORME as there are no steps to reproduce it?
Comment 7 Xisco Faulí 2017-12-14 11:36:40 UTC
0 reports in 5.4.* or 5.3.7
Comment 8 Timur 2017-12-14 13:25:45 UTC
Can't say, question should be for developer. 
There are 66 pages and 3252 crashes, latest for Version: 5.3.6.1.
I'll close for the moment, unless there are more of this.