Bug 84658 - EDITING: Database crashes when trying to insert new record in a form.
Summary: EDITING: Database crashes when trying to insert new record in a form.
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
4.3.2.2 release
Hardware: All All
: medium critical
Assignee: Lionel Elie Mamane
URL:
Whiteboard: target:4.4.0
Keywords: haveBacktrace
Depends on:
Blocks:
 
Reported: 2014-10-04 09:52 UTC by ratrace
Modified: 2015-10-14 13:26 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
Database crash messages (132.33 KB, application/vnd.oasis.opendocument.text)
2014-10-04 09:52 UTC, ratrace
Details
Database crash messages (106.42 KB, image/png)
2014-10-04 09:57 UTC, ratrace
Details
My odb file (378.79 KB, application/vnd.oasis.opendocument.database)
2014-10-04 18:04 UTC, ratrace
Details
console bt (6.54 KB, text/plain)
2014-10-04 19:18 UTC, Julien Nabet
Details
minimised reproduction case (377.17 KB, application/vnd.oasis.opendocument.database)
2014-10-06 10:27 UTC, Lionel Elie Mamane
Details
error message (17.79 KB, image/jpeg)
2015-10-14 09:17 UTC, Jonathan Camilleri
Details
database (odb) (56.98 KB, application/vnd.sun.xml.base)
2015-10-14 10:50 UTC, Jonathan Camilleri
Details

Note You need to log in before you can comment on or make changes to this bug.
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
Comment 15 Jonathan Camilleri 2015-10-14 09:16:51 UTC
I have a similar problem in LibreOffice Base 5.0.2.2 and I cannot insert new records.
Comment 16 Jonathan Camilleri 2015-10-14 09:17:49 UTC
Created attachment 119599 [details]
error message
Comment 17 Jonathan Camilleri 2015-10-14 10:50:45 UTC
Created attachment 119602 [details]
database (odb)
Comment 18 Lionel Elie Mamane 2015-10-14 13:25:49 UTC
(In reply to Jonathan Camilleri from comment #15)
> I have a similar problem in LibreOffice Base 5.0.2.2 and I cannot insert new
> records.

Jonathan, your "similar problem" is not a crash, so cannot possibly be the same bug. Unless you have pretty good reason to believe that the problem you get is the same bug that has regressed (that is reappeared after being fixed), PLEASE OPEN A NEW BUG and do *not* open an older bug that has not regressed.

Additionally, from glancing at your error message it seems that what you have is not a bug, but that you try to insert values with duplicate values in the primary key. So not a bug, but a design of your tables to forbid what you try to do.