Bug 81883 - Macros: Libreoffice crash on exit
Summary: Macros: Libreoffice crash on exit
Status: RESOLVED WORKSFORME
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
4.2.5.2 release
Hardware: Other Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: BSA target:5.3.0
Keywords:
Depends on:
Blocks:
 
Reported: 2014-07-29 19:01 UTC by BlueEyes73
Modified: 2017-03-18 15:16 UTC (History)
8 users (show)

See Also:
Crash report or crash signature:


Attachments
Linux 4.3.2.2 backtrace (5.72 KB, text/plain)
2014-10-27 03:58 UTC, Matthew Francis
Details
Linux 4.4 master backtrace (15.18 KB, text/plain)
2014-10-27 09:35 UTC, Matthew Francis
Details
windbg backtrace (34.75 KB, text/plain)
2016-10-21 15:20 UTC, pierre-yves samyn
Details

Note You need to log in before you can comment on or make changes to this bug.
Description BlueEyes73 2014-07-29 19:01:04 UTC
Problem description: Libreoffice crash on exit all time that i use a Basic Macro to access to a database connected to a sheet of calc (sorry for my english...)

Steps to reproduce:
1. Create a simple document in calc anda save it.
Cod Description Price
1    test1       10
2    test2       20
3    test3       30

2. Create and register a Database connected to a calc file
3. Created the macro and execute
Sub TEST

DatabaseContext = createUnoService(“com.sun.star.sdb.DatabaseContext”)
DataSource = DatabaseContext.getByName(“TEST”)

If Not DataSource.IsPasswordRequired Then Connection = DataSource.GetConnection(”“,”“)
Else InteractionHandler = createUnoService(“com.sun.star.sdb.InteractionHandler”) Connection = DataSource.ConnectWithCompletion(InteractionHandler)
End If
end sub 

Current behavior: Now libreoffice crash on exit

Expected behavior:

              
Operating System: Windows 8
Version: 4.2.5.2 release
Comment 1 Buovjaga 2014-10-24 14:18:44 UTC
When trying to run the macro I get:
BASIC syntax error.
Unexpected symbol: .

It highlights the first “ in the second line.

Doesn't crash on exit either.

Can you test on 4.3.2.2 or a daily build from here http://dev-builds.libreoffice.org/daily/master/Win-x86@39/ ?

Tested on:
Version: 4.4.0.0.alpha1+
Build ID: 0a82645c360158f9cc0fdabe2a52f1ff8f981bed
TinderBox: Win-x86@39, Branch:master, Time: 2014-10-24_06:59:23
Comment 2 BlueEyes73 2014-10-25 17:06:23 UTC
Thanks for your replay. I have tested now with libo 4.3.2.2 and the problem persist.

BASIC syntax error. is caused by a problem with copy and past of ""
try this code:

Sub TEST
Dim DatabaseContext As Object
Dim DataSource As Object

DatabaseContext = CreateUnoService("com.sun.star.sdb.DatabaseContext")
DataSource = DatabaseContext.getByName("TEST")

If Not DataSource.IsPasswordRequired Then
 	Connection = DataSource.GetConnection("","")
Else
 	InteractionHandler = createUnoService("com.sun.star.sdb.InteractionHandler")
  	Connection = DataSource.ConnectWithCompletion(InteractionHandler)
End If

end sub


If problem persist rewrite "". Thanks and sorry for my english.
Comment 3 Buovjaga 2014-10-26 08:29:51 UTC
All right, thanks! I managed to reproduce this (same dev version as comment 1) so setting to NEW.
Comment 4 Matthew Francis 2014-10-27 03:58:41 UTC
Created attachment 108487 [details]
Linux 4.3.2.2 backtrace

The attached is a backtrace from a binary package of 4.3.2.2. I can't however reproduce this on current master
Comment 5 Matthew Francis 2014-10-27 09:35:33 UTC
Created attachment 108499 [details]
Linux 4.4 master backtrace

I take the above back, I did eventually manage to get the attached crash on 4.4 master - it looks completely different, so the two issues may be unrelated
Comment 6 Alex Thurgood 2015-01-03 17:41:25 UTC Comment hidden (no-value)
Comment 7 Claudio Negri 2015-03-05 15:14:00 UTC
I have the same crash on exit when connecting to a sheet of Calc using Mail Merge (Mail Merge creates a database connection).
LibreOffice version: 4.4.1.2
Operating system: Windows XP Professional SP3 Italian
Comment 8 Julien Nabet 2015-11-08 19:47:17 UTC
Any update with last stable LO version 5.0.3?
Comment 9 Buovjaga 2015-11-09 09:23:48 UTC
This is confirmed, so no need to change the status.
Comment 10 Julien Nabet 2015-11-09 09:28:01 UTC
(In reply to Beluga from comment #9)
> This is confirmed, so no need to change the status.

It's confirmed with a version belonging to a branch soon EOL.
Comment 11 Buovjaga 2015-11-09 09:42:44 UTC
(In reply to Julien Nabet from comment #10)
> (In reply to Beluga from comment #9)
> > This is confirmed, so no need to change the status.
> 
> It's confirmed with a version belonging to a branch soon EOL.

Mass pings are done regularly for old bugs, but they are never set to NEEDINFO, only a comment is added.
Comment 12 Caolán McNamara 2016-08-23 20:22:51 UTC
If you add a

Connection.dispose()

when you are finished with the Connection then it'll not crash on exit
Comment 13 Commit Notification 2016-08-28 10:01:59 UTC
Caolán McNamara committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=45e01be11111213f689ba5f1fa319e3dc48ea9c5

Resolves: tdf#81883 dispose OCalcConnection's doc before shutdown

It will be available in 5.3.0.

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.
Comment 14 pierre-yves samyn 2016-10-21 15:18:33 UTC
Hi

Sorry I still reproduce the crash on windows 7/64 & Version: 5.3.0.0.alpha1+
Build ID: 8a796410ec8f440b4163b15b928347c499da7a8f
CPU Threads: 2; OS Version: Windows 6.1; UI Render: default; 
TinderBox: Win-x86@42, Branch:master, Time: 2016-10-20_23:07:21
Locale: fr-FR (fr_FR); Calc: group

I have tested without & with Connection.dispose()
I join a windbg backtrace.

Regards
Comment 15 pierre-yves samyn 2016-10-21 15:20:42 UTC
Created attachment 128129 [details]
windbg backtrace
Comment 16 tommy27 2017-03-17 08:57:30 UTC
@Pierre-Yves
can you still confirm this issue with 5.3.0 final release or 5.3.1 release candidates?
Comment 17 pierre-yves samyn 2017-03-18 06:45:00 UTC
Hi

> @Pierre-Yves
> can you still confirm this issue with 5.3.0 final release or 5.3.1 release
> candidates?

I no longer reproduce the crash on Windows 7/64 with :

Version: 5.3.1.2
Build ID: e80a0e0fd1875e1696614d24c32df0f95f03deb2
CPU Threads: 2; OS Version: Windows 6.1; UI Render: default; Layout Engine: new; 
Locale: fr-FR (fr_FR); Calc: group

Regards
Pierre-Yves
Comment 18 Xisco Faulí 2017-03-18 15:16:58 UTC
Closing as RESOLVED WORKSFORME as per comment 17