Bug 58451 - Base crash when Execute report with a empty database
Summary: Base crash when Execute report with a empty database
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
4.1.0.0.alpha0+ Master
Hardware: x86 (IA32) Linux (All)
: medium major
Assignee: Not Assigned
URL:
Whiteboard: target:4.1.0
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-18 09:32 UTC by Marcos Souza
Modified: 2013-11-16 22:47 UTC (History)
4 users (show)

See Also:
Crash report or crash signature:


Attachments
1 (95.77 KB, image/png)
2012-12-22 19:19 UTC, Marcos Souza
Details
The parameters of the new database (93.58 KB, image/png)
2012-12-22 19:20 UTC, Marcos Souza
Details
3 - Name of new database (120.67 KB, image/png)
2012-12-22 19:21 UTC, Marcos Souza
Details
After create the new database, click on Create Report in Design View (95.86 KB, image/png)
2012-12-22 19:22 UTC, Marcos Souza
Details
After crick in Create Report in Design View, just click Execute Report (108.80 KB, image/png)
2012-12-22 19:23 UTC, Marcos Souza
Details
Backtrace with --backtrace and crash (36.27 KB, text/plain)
2012-12-22 19:33 UTC, Marcos Souza
Details
valgrind log (747 bytes, text/plain)
2012-12-22 19:36 UTC, Marcos Souza
Details
bt + console logs on master (12.32 KB, text/plain)
2012-12-22 19:49 UTC, Julien Nabet
Details
valgrind log - now with valgrind installed!! (81.93 KB, text/plain)
2012-12-23 13:37 UTC, Marcos Souza
Details
vagrind report (1.71 MB, text/plain)
2012-12-23 14:56 UTC, Marcos Souza
Details
Now it works! (106.18 KB, image/png)
2012-12-31 16:15 UTC, Marcos Souza
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Marcos Souza 2012-12-18 09:32:33 UTC
Steps to reproduce:

1 - Open LO Database
2 - Create a new database
3 - Click in Reports
4 - Click Create Report in Design View
5 - Click in Execute Report
6 - BOOOM!

Tested with last master(today).

If you need more info, please ask!
Comment 1 Robert Großkopf 2012-12-18 19:29:41 UTC
You haven't chosen any version in this report.
I could not confirm this behavior. Just tested with LO Version 4.0.0.0.beta1+,
TinderBox: Linux-x86_10-Release-Configuration, Branch:libreoffice-4-0, Time: 2012-12-15_16:11:06.
If I want to create a report without any table a popup appears:
The report can not be executed unless it is bound to content.
When I create a table (what isn't described in the report) and connect to the report, I can execute it. There doesn't appear any content in the report, because there isn't any content in the table.
Comment 2 Marcos Souza 2012-12-18 20:40:10 UTC
Hi Robert!

Sorry, I'm using LO 4 Master.

But, the crash happens here. This is the error:

# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0xad79c6ff, pid=4749, tid=3036846528
#
# JRE version: 7.0_09
# Java VM: OpenJDK Client VM (23.2-b09 mixed mode linux-x86 )
# Problematic frame:
# C  [libdbulo.so+0x856ff]  com::sun::star::uno::cpp_release(void*)+0xc
#
# Core dump written. Default location: /mnt/dados/gitroot/core/solver/unxlngi6.pro/installation/opt/program/core or core.4749
#
# An error report file with more information is saved as:
# /tmp/hs_err_pid4749.log
#
# If you would like to submit a bug report, please include
# instructions on how to reproduce the bug and visit:
#   http://icedtea.classpath.org/bugzilla
#

[error occurred during error reporting , id 0xb]

This info give more help?

Thanks a lot!
Comment 3 pierre-yves samyn 2012-12-19 10:59:01 UTC
Hello

(In reply to comment #1)
> If I want to create a report without any table a popup appears:
> The report can not be executed unless it is bound to content.
> When I create a table (what isn't described in the report) and connect to
> the report, I can execute it. There doesn't appear any content in the
> report, because there isn't any content in the table.

I confirm this comment : I can not reproduce with windows 7 64bits &
Version 4.0.0.0.beta1+ (Build ID: b0eb7231a9643d71be3125be7248c91242339ab)

I also tried after creating a table.
Execute the report displays another message: 
"The report can not be executed unless at least on object has been inserted".

Note: my JRE is 1.6.0_38

Regards
Pierre-Yves
Comment 4 Julien Nabet 2012-12-20 21:34:35 UTC
It could help if you attach /tmp/hs_err_pid4749.log but I don't think you still have it since it's in /tmp and you must have already rebooted.

Could you retrieve a backtrace by following this link (https://wiki.documentfoundation.org/BugReport#How_to_get_a_backtrace_.28on_Linux.29)?
Comment 5 Alex Thurgood 2012-12-20 22:41:00 UTC
Can not confirm with :

Version 4.1.0.0.alpha0+ (Build ID: 74b960ef3cd96f0f0e170234bc0947bfb51723f)

on Linux Mint Maya 32bit.

When I click on Create Report in Design the Report Template opens. No crash.


Alex
Comment 6 Marcos Souza 2012-12-22 19:19:42 UTC
Created attachment 71989 [details]
1

After compile the LO with head 8e25844811ebcf313f4ae9d0caae1f97fd230a7d and open Base and creating a new database
Comment 7 Marcos Souza 2012-12-22 19:20:52 UTC
Created attachment 71990 [details]
The parameters of the new database
Comment 8 Marcos Souza 2012-12-22 19:21:27 UTC
Created attachment 71991 [details]
3 - Name of new database
Comment 9 Marcos Souza 2012-12-22 19:22:57 UTC
Created attachment 71992 [details]
After create the new database, click on Create Report in Design View
Comment 10 Marcos Souza 2012-12-22 19:23:58 UTC
Created attachment 71993 [details]
After crick in Create Report in Design View, just click Execute Report
Comment 11 Marcos Souza 2012-12-22 19:33:05 UTC
Created attachment 71994 [details]
Backtrace with --backtrace and crash
Comment 12 Marcos Souza 2012-12-22 19:36:51 UTC
Created attachment 71995 [details]
valgrind log
Comment 13 Marcos Souza 2012-12-22 19:48:33 UTC
Guys I hope this information could help us to fix this issue..

Maybe more useful information:
[marcos@jedi program]$ java -version
java version "1.7.0_09-icedtea"
OpenJDK Runtime Environment (fedora-2.3.3.fc17.1-i386)
OpenJDK Server VM (build 23.2-b09, mixed mode)

[marcos@jedi program]$ uname -a
Linux jedi 3.5.4-2.fc17.i686 #1 SMP Wed Sep 26 22:32:49 UTC 2012 i686 i686 i386 GNU/Linux

I'm using Fedora 17 with Xfce
Comment 14 Julien Nabet 2012-12-22 19:49:29 UTC
Created attachment 71996 [details]
bt + console logs on master

On pc Debian x86-64 with master sources updated today (commit bb97ecdbcc8d8dafd39e728b21bc68efee4eccbc), I reproduced the problem

Marcos: great for the detailed steps. It could be interesting you add the option "--enable-symbols" for having a even more useful backtrace. Anyway, I did it (I've got --enable-dbgutil to have symbols + debug logs)
Nonetheless, thank you for your bt and Valgrind.
Comment 15 Julien Nabet 2012-12-22 19:54:46 UTC
Marcos: should have read the content of Valgrind log, what you attached is not at a Valgrind log. see this link (https://wiki.documentfoundation.org/BugReport#How_to_get_a_valgrind_log_.28on_Linux.29)

(Update tracker to New)
Comment 16 Julien Nabet 2012-12-22 21:06:11 UTC
in a gdb session, I've got this:
Breakpoint 2, dbtools::showError (_rInfo=..., _xParent=
    uno::Reference to {<com::sun::star::lang::XComponent> = {<com::sun::star::uno::XInterface> = {_vptr.XInterface = 0x7f5ecc5b5f10}, <No data fields>}, <No data fields>}, 
    _rxContext=uno::Reference to {<com::sun::star::uno::XInterface> = {_vptr.XInterface = 0x7f5ece853b30}, <No data fields>})
    at /home/julien/compile-libreoffice/libo/connectivity/source/commontools/dbtools.cxx:1485
1485	    if (_rInfo.isValid())
(gdb) n
1489	            Reference< XExecutableDialog > xErrorDialog = ErrorMessageDialog::create( _rxContext, "", _xParent, _rInfo.get() );
(gdb) p _rxContext
$2 = uno::Reference to {<com::sun::star::uno::XInterface> = {_vptr.XInterface = 0x7f5ece853b30}, <No data fields>}
(gdb) p _xParent
$3 = uno::Reference to {<com::sun::star::lang::XComponent> = {<com::sun::star::uno::XInterface> = {_vptr.XInterface = 0x7f5ecc5b5f10}, <No data fields>}, <No data fields>}
(gdb) p _rInfo.get()
$4 = 
  uno::Any {<com::sun::star::sdbc::SQLWarning> = {<com::sun::star::sdbc::SQLException> = {<com::sun::star::uno::Exception> = {Message = "The report can not be executed unless it is bound to content.", Context = empty uno::Reference}, SQLState = "", ErrorCode = 0, NextException = empty uno::Any}, <No data fields>}, Details = ""}
(gdb) n

Program received signal SIGSEGV, Segmentation fault.
0x0000000001a89580 in ?? ()

I wonder if it could be due to: 19854e653be1dc01f5b655fca851a6e3a651a940  fdo#46808, Adapt sdb::ErrorMessageDialog UNO service to new style
Comment 17 Julien Nabet 2012-12-22 22:13:46 UTC
The problem could be the fact that getORB() function in dbaccess/inc/genericcontroller.hxx returns ::com::sun::star::lang::XMultiServiceFactory not ::com::sun::star::uno::XComponentContext

Noel: would you have some time to take a look at this?
The problem to change there are 3 files in DBAccess which use XMultiServiceFactory:
source/ui/app/AppController.cxx
source/ui/browser/sbagrid.cxx
source/ui/browser/genericcontroller.cxx
Comment 18 Noel Grandin 2012-12-23 06:56:54 UTC
I'll be happy to look at this, but I'll only be back at my hacking machine in a week.

Julien, you are correct, I need to propogate the 
  XMultiServiceFactory->XComponentContext
change up the hierarchy to 
   OGenericUnoController
and dump the unnecessary
  m_xContext
field in 
  OReportController.

That being said, the only way I can see this happening is if showError is being called after OGenericUnoController::disposing() has cleared it's m_xServiceFactory field. (why it is doing that is another question).

Probably just removing the clearing of m_xServiceFactory in OGenericUnoController will make this crash go away.
Comment 19 Julien Nabet 2012-12-23 08:18:38 UTC
(In reply to comment #18)
> I'll be happy to look at this, but I'll only be back at my hacking machine
> in a week.
> 
> Julien, you are correct, I need to propogate the 
>   XMultiServiceFactory->XComponentContext
> change up the hierarchy to 
>    OGenericUnoController
> and dump the unnecessary
>   m_xContext
> field in 
>   OReportController.
> 
> That being said, the only way I can see this happening is if showError is
> being called after OGenericUnoController::disposing() has cleared it's
> m_xServiceFactory field. (why it is doing that is another question).
> 
> Probably just removing the clearing of m_xServiceFactory in
> OGenericUnoController will make this crash go away.

Thank you Noel for your feedback. I sent a post on dev mailing list (see http://nabble.documentfoundation.org/About-fdo-58451-Base-crash-when-Execute-report-with-a-empty-database-td4025905.html). Perhaps someone may help before you come back :-)
Comment 20 Marcos Souza 2012-12-23 13:37:51 UTC
Created attachment 72027 [details]
valgrind log - now with valgrind installed!!

I tought that valgrind was installed here, but it doesn't..

I belive this is the right log message!
Comment 21 Marcos Souza 2012-12-23 14:56:01 UTC
Created attachment 72033 [details]
vagrind report

When i follow https://wiki.documentfoundation.org/BugReport#How_to_get_a_valgrind_log_.28on_Linux.29 it seems that an error occurs when trying to get the summary of icedtea...

So, attaching this...
Comment 22 Not Assigned 2012-12-31 09:53:22 UTC
Noel Grandin committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=63894cb4fed44aed01092cdee1fe30463eb5223e

fix fdo#58451



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 23 Marcos Souza 2012-12-31 16:15:36 UTC
Created attachment 72352 [details]
Now it works!

Thanks a lot Noel!

Now it works! See this print: now it gives a message of empty report when testing.

Closing the issue. Thanks again!