Bug 127548 - Assertion when creating table in Design
Summary: Assertion when creating table in Design
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Base (show other bugs)
Version:
(earliest affected)
6.4.0.0.alpha1+
Hardware: x86-64 (AMD64) Linux (All)
: medium normal
Assignee: Julien Nabet
URL:
Whiteboard: target:6.4.0
Keywords: bibisectRequest, haveBacktrace, regression
Depends on:
Blocks: Crash-Assert
  Show dependency treegraph
 
Reported: 2019-09-14 17:12 UTC by Julien Nabet
Modified: 2020-06-14 15:51 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments
bt (6.67 KB, text/plain)
2019-09-14 17:18 UTC, Julien Nabet
Details
bt2 with patch (13.38 KB, text/plain)
2019-09-15 14:46 UTC, Julien Nabet
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Julien Nabet 2019-09-14 17:12:34 UTC
Description:
On pc Debian x86-64 with master sources updated today, I got an assertion during table creation in Design part.

Steps to Reproduce:
1. Create a brand new embedded hsqldb file
2. Go to Table panel
3. Click on Design part to launch table creation
4. Type "ID" in "Field Name"
5. Try to fill "Field Type"

Actual Results:
Assertion
with:
warn:vcl.layout:6901:6901:include/vcl/builder.hxx:444: .ui widget "DefaultValue" needs to correspond to vcl type 14FormattedField
soffice.bin: /home/julien/lo/libreoffice/include/vcl/builder.hxx:446: T* VclBuilder::get(const rtl::OString&) [with T = FormattedField]: Assertion `!w || dynamic_cast<T*>(w)' failed.

Thread 1 "soffice.bin" received signal SIGABRT, Aborted.
__GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
50	../sysdeps/unix/sysv/linux/raise.c: Aucun fichier ou dossier de ce type.
(gdb) bt
#0  0x00007ffff7afa7bb in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:50
#1  0x00007ffff7ae5535 in __GI_abort () at abort.c:79
#2  0x00007ffff7ae540f in __assert_fail_base
    (fmt=0x7ffff7c47ee0 "%s%s%s:%u: %s%sAssertion `%s' failed.\n%n", assertion=0x7ffff135024c "!w || dynamic_cast<T*>(w)", file=0x7ffff1350218 "/home/julien/lo/libreoffice/include/vcl/builder.hxx", line=446, function=<optimized out>) at assert.c:92
#3  0x00007ffff7af3102 in __GI___assert_fail
    (assertion=0x7ffff135024c "!w || dynamic_cast<T*>(w)", file=0x7ffff1350218 "/home/julien/lo/libreoffice/include/vcl/builder.hxx", line=446, function=0x7ffff1350740 "T* VclBuilder::get(const rtl::OString&) [with T = FormattedField]") at assert.c:101
#4  0x00007ffff0be428e in VclBuilder::get<FormattedField>(rtl::OString const&) (this=0x555559029a80, sID="DefaultValue") at /home/julien/lo/libreoffice/include/vcl/builder.hxx:446
#5  0x00007ffff0bda378 in SalInstanceBuilder::weld_spin_button(rtl::OString const&, bool) (this=0x5555590297a0, id="DefaultValue", bTakeOwnership=false)
    at /home/julien/lo/libreoffice/vcl/source/app/salvtables.cxx:5718
#6  0x00007fffdca99a9e in dbaui::OFieldDescControl::ActivateAggregate(dbaui::EControlType) (this=0x555559028e80, eType=dbaui::tpDefault)
    at /home/julien/lo/libreoffice/dbaccess/source/ui/control/FieldDescControl.cxx:424
#7  0x00007fffdcd1f817 in dbaui::OTableFieldControl::ActivateAggregate(dbaui::EControlType) (this=0x555559028e80, eType=dbaui::tpDefault)
    at /home/julien/lo/libreoffice/dbaccess/source/ui/tabledesign/TableFieldControl.cxx:82
#8  0x00007fffdca9ce91 in dbaui::OFieldDescControl::DisplayData(dbaui::OFieldDescription*) (this=0x555559028e80, pFieldDescr=0x555558f91d40)
    at /home/julien/lo/libreoffice/dbaccess/source/ui/control/FieldDescControl.cxx:785
#9  0x00007fffdccfd800 in dbaui::OFieldDescGenWin::DisplayData(dbaui::OFieldDescription*) (this=0x5555590284a0, pFieldDescr=0x555558f91d40)
    at /home/julien/lo/libreoffice/dbaccess/source/ui/tabledesign/FieldDescGenWin.cxx:77
#10 0x00007fffdcd2090e in dbaui::OTableFieldDescWin::DisplayData(dbaui::OFieldDescription*) (this=0x555558cadc20, pFieldDescr=0x555558f91d40)
    at /home/julien/lo/libreoffice/dbaccess/source/ui/tabledesign/TableFieldDescWin.cxx:98
#11 0x00007fffdcd2b08f in dbaui::OTableEditorCtrl::CellModified(long, unsigned short) (this=0x5555591f7f00, nRow=0, nColId=1) at /home/julien/lo/libreoffice/dbaccess/source/ui/tabledesign/TEditControl.cxx:663
#12 0x00007fffdcd2b5fe in dbaui::OTableEditorCtrl::CellModified() (this=0x5555591f7f00) at /home/julien/lo/libreoffice/dbaccess/source/ui/tabledesign/TEditControl.cxx:699
#13 0x00007ffff29096ac in svt::EditBrowseBox::CellModifiedHdl(void*) (this=0x5555591f7f00) at /home/julien/lo/libreoffice/svtools/source/brwbox/editbrowsebox.cxx:1057
#14 0x00007ffff2909671 in svt::EditBrowseBox::LinkStubCellModifiedHdl(void*, void*) (instance=0x5555591f7f00, data=0x0) at /home/julien/lo/libreoffice/svtools/source/brwbox/editbrowsebox.cxx:1054


Expected Results:
No assertion


Reproducible: Always


User Profile Reset: No



Additional Info:
Comment 1 Julien Nabet 2019-09-14 17:17:44 UTC
I removed LO profile just to be sure.
Precision: assertion is triggered when I begin to type in "Field Name".
Comment 2 Julien Nabet 2019-09-14 17:18:12 UTC
Created attachment 154162 [details]
bt
Comment 3 MM 2019-09-14 20:43:17 UTC
Confirmed on mint 19.2 with Version: 6.4.0.0.alpha0+
Build ID: 0d0e8533afe565564835e6d51500e64066fd565b
CPU threads: 2; OS: Linux 4.15; UI render: default; VCL: gtk3; 
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2019-09-14_06:19:54
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Calc: threaded

but not with

Version: 6.4.0.0.alpha0+
Build ID: 41cd3e8e817c8c33a13608e62eeb06ce2c6977e4
CPU threads: 2; OS: Linux 4.15; UI render: default; VCL: gtk3; 
TinderBox: Linux-rpm_deb-x86_64@86-TDF, Branch:master, Time: 2019-09-01_22:30:33
Locale: en-US (en_US.UTF-8); UI-Language: en-US
Calc: threaded
Comment 4 Julien Nabet 2019-09-14 21:32:47 UTC
Caolán: taking a look to bt, it might be related to https://cgit.freedesktop.org/libreoffice/core/commit/?id=8c66efa030e98cfdf5da20be368566d64e43c5d1
(weld OCopyTableWizard cluster)
Comment 5 Julien Nabet 2019-09-15 14:46:08 UTC
Created attachment 154173 [details]
bt2 with patch

With this patch, I don't reproduce the assertion:
diff --git a/dbaccess/source/ui/control/FieldDescControl.cxx b/dbaccess/source/ui/control/FieldDescControl.cxx
index e04ac5500a08..5c12e4ed0a42 100644
--- a/dbaccess/source/ui/control/FieldDescControl.cxx
+++ b/dbaccess/source/ui/control/FieldDescControl.cxx
@@ -421,7 +421,7 @@ void OFieldDescControl::ActivateAggregate( EControlType eType )
         m_xDefaultText = m_xBuilder->weld_label("DefaultValueText");
         m_xDefaultText->show();
         m_xDefault = std::make_unique<OPropEditCtrl>(
-                m_xBuilder->weld_spin_button("DefaultValue"), STR_HELP_DEFAULT_VALUE, FIELD_PROPERTY_DEFAULT);
+                m_xBuilder->weld_entry("DefaultValue"), STR_HELP_DEFAULT_VALUE, FIELD_PROPERTY_DEFAULT);
         InitializeControl(m_xDefault->GetWidget(),HID_TAB_ENT_DEFAULT);
         m_xDefault->show();
         break;
@@ -581,7 +581,7 @@ void OFieldDescControl::ActivateAggregate( EControlType eType )
             m_xFormatText->show();
 
             m_xFormatSample = std::make_unique<OPropEditCtrl>(
-                    m_xBuilder->weld_spin_button("FormatText"), STR_HELP_FORMAT_CODE, -1);
+                    m_xBuilder->weld_entry("FormatText"), STR_HELP_FORMAT_CODE, -1);
             m_xFormatSample->set_editable(false);
             m_xFormatSample->set_sensitive(false);
             InitializeControl(m_xFormatSample->GetWidget(),HID_TAB_ENT_FORMAT_SAMPLE);

but got an segfault (bt attached)
Comment 6 Julien Nabet 2019-09-15 16:39:56 UTC
https://gerrit.libreoffice.org/#/c/78942/
Comment 7 Commit Notification 2019-09-15 16:42:29 UTC
Julien Nabet committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/+/0f85a718dc0d241a8aa1b2d27accb575367691fe%5E%21

tdf#127548: Assertion when creating table in Design

It will be available in 6.4.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.