Bug 84658

Summary: EDITING: Database crashes when trying to insert new record in a form.
Product: LibreOffice Reporter: ratrace <ypatis>
Component: DatabaseAssignee: Lionel Elie Mamane <lionel>
Status: RESOLVED FIXED QA Contact:
Severity: critical    
Priority: medium CC: lionel, serval2412
Version: 4.3.2.2 releaseKeywords: have-backtrace
Hardware: All   
OS: All   
Whiteboard: target:4.4.0
i915 platform: i915 features:
Attachments: Database crash messages
Database crash messages
My odb file
console bt
minimised reproduction case

Description ratrace 2014-10-04 09:52:45 UTC
Created attachment 107315 [details]
Database crash messages

Hello,

database crashes when i'm trying to insert new record using a form.

I open the .odb file
I open the form i'm using
I click on the "new record button" of the form
LO crashes and shows the message "Libreoffice 4.3 - Fatal Error - The group of results are only for reading."
After than message another message shows up, about MS Visual basic.

Thanks
Comment 1 ratrace 2014-10-04 09:57:15 UTC
Created attachment 107316 [details]
Database crash messages
Comment 2 Julien Nabet 2014-10-04 17:47:19 UTC
Would it be possible you attach the database file? (have in mind that any attachment are made automatically public so remove any private/confidential part)
Comment 3 ratrace 2014-10-04 18:04:48 UTC
Created attachment 107332 [details]
My odb file
Comment 4 Julien Nabet 2014-10-04 19:18:44 UTC
Created attachment 107334 [details]
console bt

On pc Debian x86-64 with master sources updated yesterday, I could reproduce this.

I attached a bt
Comment 5 Julien Nabet 2014-10-05 10:31:49 UTC
Lionel: bt shows a problem with iterators in baccess/source/core/api/RowSetCache.cxx, thought you might be interested in this one.
Comment 6 Lionel Elie Mamane 2014-10-05 12:46:11 UTC
Cannot reproduce on master of 26 sep, Debian GNU/Linux amd64. Could someone please give more detailed reproduction instructions? Thanks.

I open form "Καταχώρηση ΝΟΜΟΥ".
Click on "new record".
Enter "74" into "A/A".
Click in "next record".

Works for me.
Comment 7 ratrace 2014-10-05 12:52:21 UTC
(In reply to Lionel Elie Mamane from comment #6)
> Cannot reproduce on master of 26 sep, Debian GNU/Linux amd64. Could someone
> please give more detailed reproduction instructions? Thanks.
> 
> I open form "Καταχώρηση ΝΟΜΟΥ".
> Click on "new record".
> Enter "74" into "A/A".
> Click in "next record".
> 
> Works for me.

Hello,

open form "Καταχώρηση ΠΟΛ"
click the button "new record" in the same height as blue and red button
base crashes
Comment 8 Julien Nabet 2014-10-05 12:59:48 UTC
Indeed, I don't reproduce the problem with the first form but with the second one.
Comment 9 Lionel Elie Mamane 2014-10-06 08:23:31 UTC
OK, reproduced with form "Καταχώρηση ΠΟΛ".

The crash is linked to subform "Νέο Άρθρο Νόμου"; if one removes all forms except "Κύρια" and "Νέο Άρθρο Νόμου", then it still crashes. If one removes "Νέο Άρθρο Νόμου" then it does not crash anymore.

"Νέο Άρθρο Νόμου" is a subform of form "Κύρια" *but* has no master/slave fields, meaning it is actually independent and not a subform. I moved "Νέο Άρθρο Νόμου" to be a "sister" of "Κύρια" instead of a daughter (a top-level form instead of a subform) and it does not crash.

(For full clarity, I agree it should not crash. Just documenting I found what is the exact condition that makes it crash.)
Comment 10 Lionel Elie Mamane 2014-10-06 08:30:02 UTC
The crash is also not specific to "new record". It happens with *any* movement (next record, jump to record 50, jump to record 20, ...)
Comment 11 ratrace 2014-10-06 08:58:40 UTC
(In reply to Lionel Elie Mamane from comment #9)
> OK, reproduced with form "Καταχώρηση ΠΟΛ".
> 
> The crash is linked to subform "Νέο Άρθρο Νόμου"; if one removes all forms
> except "Κύρια" and "Νέο Άρθρο Νόμου", then it still crashes. If one removes
> "Νέο Άρθρο Νόμου" then it does not crash anymore.
> 
> "Νέο Άρθρο Νόμου" is a subform of form "Κύρια" *but* has no master/slave
> fields, meaning it is actually independent and not a subform. I moved "Νέο
> Άρθρο Νόμου" to be a "sister" of "Κύρια" instead of a daughter (a top-level
> form instead of a subform) and it does not crash.
> 
> (For full clarity, I agree it should not crash. Just documenting I found
> what is the exact condition that makes it crash.)

Hello,

thanks for your help.

I changed the subforms "Νέος νόμος", "Νέο Άρθρο Νόμου" and "Νέα ετικέτα" to main forms, because they are not subforms to the "Κύρια" form. Their use is to insert only new records to the connected tables.

Now i can insert new records to the main (Κύρια) form. It works.
Comment 12 Lionel Elie Mamane 2014-10-06 10:20:11 UTC
Crash is also linked to the "new data only" property being set. It is because the RowSet is reexecuted while in insert mode, so the rowsetcache is reset with a new rowset, *but* the rowset is not anymore in insert mode, but the iterator to the rowsetcache (m_aCurrentRow) still points to the rowsetcache's insert row.
Comment 13 Lionel Elie Mamane 2014-10-06 10:27:48 UTC
Created attachment 107415 [details]
minimised reproduction case

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.