| Summary: | Segfault importing Basic macros | ||
|---|---|---|---|
| Product: | LibreOffice | Reporter: | Jim Avera <jim.avera> |
| Component: | BASIC | Assignee: | Caolán McNamara <caolan.mcnamara> |
| Status: | VERIFIED FIXED | ||
| Severity: | normal | CC: | caolan.mcnamara, himajin100000, serval2412 |
| Priority: | medium | Keywords: | regression |
| Version: | 6.4.7.2 release | ||
| Hardware: | All | ||
| OS: | Linux (All) | ||
| Whiteboard: | target:7.3.0 target:7.2.3 | ||
| Crash report or crash signature: | Regression By: | ||
| Attachments: |
backtrace (pre-built executable, no symbols)
backtrace (local build from git, with symbols) AndrewPersonalLibs.odt |
||
|
Description
Jim Avera
2021-10-30 00:39:09 UTC
Created attachment 176013 [details]
backtrace (pre-built executable, no symbols)
Created attachment 176014 [details]
backtrace (local build from git, with symbols)
Created attachment 176015 [details]
AndrewPersonalLibs.odt
REGRESSION some time between 4.5.7.2 (which works) and 6.4.0.0.0+ (which faults) With gtk3 rendering, I don't reproduce the crash if I use this patch:
diff --git a/vcl/unx/gtk3/gtkinst.cxx b/vcl/unx/gtk3/gtkinst.cxx
index 504172208e74..8a032171c438 100644
--- a/vcl/unx/gtk3/gtkinst.cxx
+++ b/vcl/unx/gtk3/gtkinst.cxx
@@ -12698,6 +12698,8 @@ namespace
Search* search = static_cast<Search*>(data);
gchar *pStr = nullptr;
gtk_tree_model_get(model, iter, search->col, &pStr, -1);
+ if (!pStr)
+ return false;
bool found = strcmp(pStr, search->str.getStr()) == 0;
if (found)
{
BUT the file seems to contain all these libs:
AndrewBase
AndrewTestLib
ChangeStyles
DBUtil
MacroFormatterADP
OOoAuthorFormat
Pitonyak
PitonyakDatabase
PitonyakDialogs
PitonyakUtil
RemoveFormatting
Standard
TestLibrary
xyzzylib
and when using this patch, I see only the last one after 13 blank entries.
Caolán: thought you might be interested in this one.
With this patch:
diff --git a/basctl/source/basicide/moduldl2.cxx b/basctl/source/basicide/moduldl2.cxx
index 42bcccebd67b..8c3cf5028d94 100644
--- a/basctl/source/basicide/moduldl2.cxx
+++ b/basctl/source/basicide/moduldl2.cxx
@@ -638,10 +638,9 @@ void LibPage::InsertLib()
( xDlgLibContImport.is() && xDlgLibContImport->hasByName( aLibName ) && xDlgLibContImport->isLibraryLink( aLibName ) ) ) )
{
weld::TreeView& rView = xLibDlg->GetLibBox();
- rView.append();
+ rView.append_text(aLibName);
const int nRow = rView.n_children() - 1;
rView.set_toggle(nRow, TRISTATE_TRUE);
- rView.set_text(nRow, aLibName, 0);
rView.set_cursor(rView.find_text(aLibName));
}
}
I don't reproduce the crash and all the checkboxes are present and enabled on gtk3.
But with gen rendering, only the last checkbox is present and enabled.
I must recognize I don't know why.
I think the problem began at commit e8b3df5b9b0eb0a93c25b6dc2e445ae44a7e3f78 Date: Fri Aug 2 14:57:49 2019 +0200 tdf#93476 Sort Macro library list after creating/importing a macro Only set the widget as sorted in the ctor, it remains sorted where now the list set sorted in the LibBox ctor, so the line the text is inserted at is not a simple index based one where the line was just inserted at (the number of rows) - 1 https://gerrit.libreoffice.org/c/core/+/124542 should solve it Caolán McNamara committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/2ed921b0a56961c6937661258b44e1690c5f98d1 Resolves: tdf#145391 insertion code assumes unsorted treeview It will be available in 7.3.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. fixed in trunk, backport to 7-2 in gerrit and let's put this one to VERIFIED since I had tested the patch and everything was ok. Caolán McNamara committed a patch related to this issue. It has been pushed to "libreoffice-7-2": https://git.libreoffice.org/core/commit/2dc90967977617f58a9d47e6ae89175919eef4b2 Resolves: tdf#145391 insertion code assumes unsorted treeview It will be available in 7.2.3. 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. |