| Summary: | Crash in: SvxScriptErrorDialog::ShowDialog(SvxScriptErrorDialog *,void *) | ||
|---|---|---|---|
| Product: | LibreOffice | Reporter: | Mike Kaganski <mikekaganski> |
| Component: | BASIC | Assignee: | Caolán McNamara <caolan.mcnamara> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | caolan.mcnamara |
| Priority: | medium | ||
| Version: | 7.2.2.2 release | ||
| Hardware: | All | ||
| OS: | All | ||
| Whiteboard: | target:7.3.0 target:7.2.3 | ||
| Crash report or crash signature: | ["SvxScriptErrorDialog::ShowDialog(SvxScriptErrorDialog *,void *)"] | Regression By: | |
|
Description
Mike Kaganski
2021-10-29 09:23:33 UTC
Under debug build, it fails an assert. It seems to be a use-after-free case; the error message being shown in IMPL_LINK(SvxScriptOrgDialog, ButtonHdl, weld::Button&, rButton, void) in 'catch ( reflection::InvocationTargetException& ite )' uses getDialog(), and that gets posted as pData->pParent in SvxScriptErrorDialog::ShowAsyncErrorDialog; and in IMPL_STATIC_LINK( SvxScriptErrorDialog, ShowDialog, void*, p, void ), the dialog (or some parts of it?) is already destroyed. I suppose the dialog is the BeanShell Macros dialog, that is being closed on the "Run" button press. Caolan, could you please take a look at it? What could be done in this case? I'm guessing this became a problem at... commit 2b47c5f295589acb18d4404137c6b72d20f019b6 Date: Mon Jun 8 15:45:10 2020 +0200 remove the fake SvxScriptErrorDialog code which just forwards to an async real dialog. Seeing as the script dialog is dismissed by the m_xDialog->response(RET_CANCEL) before the error dialogs get a chance to run, then I would imagine just changing things to give the error dialogs the parent of the script dialog rather than the script dialog to use as their parent (In reply to Caolán McNamara from comment #2) > Seeing as the script dialog is dismissed by the > m_xDialog->response(RET_CANCEL) before the error dialogs get a chance to > run, then I would imagine just changing things to give the error dialogs the > parent of the script dialog rather than the script dialog to use as their > parent Independent of this specific fix: wouldn't it be more robust to pass some (pointer to) smart reference to the user event; and that would allow to find the real parent (e.g., the dialog itself if it's not disposed; otherwise, its parent, and so on in chain)? Caolán McNamara committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/d33703e26a926507637733612ef169b3f3e05002 Resolves: tdf#145377 don't use dismissed dialog as parent for error dialogs 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. done in trunk, backport to 7-2 in gerrit Caolán McNamara committed a patch related to this issue. It has been pushed to "master": https://git.libreoffice.org/core/commit/2afbef0037f022a59ed1198f1f84e454d070df92 Related: tdf#145377 call select handler if restoring previously selected script 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. Caolán McNamara committed a patch related to this issue. It has been pushed to "libreoffice-7-2": https://git.libreoffice.org/core/commit/68e3ed223eec7ccfe1a0a1f0cd8e09b88ca9e313 Resolves: tdf#145377 don't use dismissed dialog as parent for error dialogs 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. Caolán McNamara committed a patch related to this issue. It has been pushed to "libreoffice-7-2": https://git.libreoffice.org/core/commit/149df697ec2f4db0be891becef217312ded3ab88 Related: tdf#145377 call select handler if restoring previously selected script 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. |