| Summary: | Task scheduler: crashes if user discards printing crontab | ||
|---|---|---|---|
| Product: | [Applications] kcron | Reporter: | Oleg Solovyov <mcpain> |
| Component: | general | Assignee: | Gary Meyer <gary> |
| Status: | RESOLVED FIXED | ||
| Severity: | normal | CC: | tmassimi |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Linux | ||
| Latest Commit: | https://invent.kde.org/system/kcron/commit/884a2d1c98ac1f633d63eb8e58a91f26544d9482 | Version Fixed/Implemented In: | |
| Sentry Crash Report: | |||
|
Description
Oleg Solovyov
2021-09-23 14:56:03 UTC
That's what happens when I press "Cancel" on print dialog:
#0 CrontabWidget::~CrontabWidget (this=0x555555fb59f0, __in_chrg=<optimized out>) at ./src/crontabWidget.cpp:75
#1 0x00007ffff68df39e in QObjectPrivate::deleteChildren (this=this@entry=0x555555e78bd0) at kernel/qobject.cpp:2104
#2 0x00007ffff75076a6 in QWidget::~QWidget (this=0x55555567e550, __in_chrg=<optimized out>) at kernel/qwidget.cpp:1522
#3 0x00007ffff76828bd in QStackedWidget::~QStackedWidget (this=0x55555567e550, __in_chrg=<optimized out>)
at widgets/qstackedwidget.cpp:145
#4 0x00007ffff68df39e in QObjectPrivate::deleteChildren (this=this@entry=0x555557c267b0) at kernel/qobject.cpp:2104
#5 0x00007ffff75076a6 in QWidget::~QWidget (this=0x555555ecbf60, __in_chrg=<optimized out>) at kernel/qwidget.cpp:1522
#6 0x00007ffff76a5aad in QTabWidget::~QTabWidget (this=0x555555ecbf60, __in_chrg=<optimized out>)
at widgets/qtabwidget.cpp:372
#7 0x00007ffff68df39e in QObjectPrivate::deleteChildren (this=this@entry=0x55555599d790) at kernel/qobject.cpp:2104
#8 0x00007ffff75076a6 in QWidget::~QWidget (this=0x5555560e9b50, __in_chrg=<optimized out>) at kernel/qwidget.cpp:1522
#9 0x00007ffff750789d in QWidget::~QWidget (this=0x5555560e9b50, __in_chrg=<optimized out>) at kernel/qwidget.cpp:1400
#10 0x00007ffff68df39e in QObjectPrivate::deleteChildren (this=this@entry=0x55555812b790) at kernel/qobject.cpp:2104
#11 0x00007ffff75076a6 in QWidget::~QWidget (this=0x555557c99590, __in_chrg=<optimized out>) at kernel/qwidget.cpp:1522
#12 0x00007ffff50c77ad in QPrintDialog::~QPrintDialog() () from /lib/x86_64-linux-gnu/libQt5PrintSupport.so.5
#13 0x00007fffabfbf967 in CrontabPrinter::start (this=this@entry=0x7fffffffcc10) at ./src/crontabPrinter.cpp:64
#14 0x00007fffabfbb247 in CrontabWidget::print (this=<optimized out>) at ./src/crontabWidget.cpp:368
I don't understand why CrontabWidget d-tor is called
> I don't understand why CrontabWidget d-tor is called
here a CrontabPrinter is create, and a CrontabWidget is passed to the c-tor
void CrontabWidget::print()
{
CrontabPrinter printer(this);
and named mCrontabWidget
CrontabPrinter::CrontabPrinter(CrontabWidget *crontabWidget)
: mCrontabWidget(crontabWidget)
then (crontabPrinter.cpp:60)
printDialog->setOptionTabs(QList<QWidget *>() << mCrontabWidget);
probably when the printDialog d-tor is called (crontabPrinter.cpp:64),
mCrontabWidget d-tor is called
(In reply to Tommaso Massimi from comment #2) > then (crontabPrinter.cpp:60) > printDialog->setOptionTabs(QList<QWidget *>() << mCrontabWidget); Maybe we can remove this line? A possibly relevant merge request was started @ https://invent.kde.org/system/kcron/-/merge_requests/1 Git commit 884a2d1c98ac1f633d63eb8e58a91f26544d9482 by Oleg Solovyov. Committed on 24/09/2021 at 15:36. Pushed by mlaurent into branch 'master'. Don't set option tabs QPrintDialog deletes all tabs upon destructing, which causes double-free error. M +0 -1 src/crontabPrinter.cpp https://invent.kde.org/system/kcron/commit/884a2d1c98ac1f633d63eb8e58a91f26544d9482 |