Comments (7)
Confirmed:
#0 0x00007fecfa738dbe in QImage::QImage(QImage const&) () at /usr/lib/libQt5Gui.so.5
#1 0x000000000041b921 in ()
#2 0x00007fecfa1bae72 in QObject::event(QEvent*) () at /usr/lib/libQt5Core.so.5
#3 0x00007fecfaef7473 in QWidget::event(QEvent*) () at /usr/lib/libQt5Widgets.so.5
#4 0x00007fecfafe8b7b in QMainWindow::event(QEvent*) () at /usr/lib/libQt5Widgets.so.5
#5 0x00007fecfaeb646c in QApplicationPrivate::notify_helper(QObject*, QEvent*) ()
at /usr/lib/libQt5Widgets.so.5
#6 0x00007fecfaebdcf4 in QApplication::notify(QObject*, QEvent*) () at /usr/lib/libQt5Widgets.so.5
#7 0x00007fecfa18bb98 in QCoreApplication::notifyInternal2(QObject*, QEvent*) ()
at /usr/lib/libQt5Core.so.5
#8 0x00007fecfa18e02d in QCoreApplicationPrivate::sendPostedEvents(QObject*, int, QThreadData*) ()
at /usr/lib/libQt5Core.so.5
#9 0x00007fecfa1e3a63 in () at /usr/lib/libQt5Core.so.5
#10 0x00007fecfb5fba47 in g_main_context_dispatch () at /usr/lib/libglib-2.0.so.0
#11 0x00007fecfb5fbc78 in () at /usr/lib/libglib-2.0.so.0
#12 0x00007fecfb5fbd0c in g_main_context_iteration () at /usr/lib/libglib-2.0.so.0
#13 0x00007fecfa1e3e7f in QEventDispatcherGlib::processEvents(QFlags<QEventLoop::ProcessEventsFlag>) ()
at /usr/lib/libQt5Core.so.5
#14 0x00007fecfa18a21a in QEventLoop::exec(QFlags<QEventLoop::ProcessEventsFlag>) ()
at /usr/lib/libQt5Core.so.5
#15 0x00007fecfa192a74 in QCoreApplication::exec() () at /usr/lib/libQt5Core.so.5
#16 0x0000000000412761 in ()
#17 0x00007fecfd2ad43a in __libc_start_main () at /usr/lib/libc.so.6
#18 0x0000000000412c7a in _start ()
At first, I though it might be related to Qt 5.9 but the Qt image viewer I've made for my personal use doesn't show this symptom.
from lximage-qt.
You're right, it's not a Qt 5.9.0 bug since I can reproduce this on Qt 5.8.0 too. Can be a Qt 5.x.x bug though :D
from lximage-qt.
Can be a Qt 5.x.x bug though
No, the bug is lximage-qt. I'll look into it whenever I find some free time.
from lximage-qt.
This is a race condition accessing the loadJob_
member of MainWindow
, between loadImage
(main thread) and onImageLoaded
(job thread). The crash is because the when the job emits finished
at a point after the main thread set loadJob_
to nullptr
.
Disconnecting the finished
signal from the job before cancelling it makes the issue a bit harder to hit but it's not a proper fix:
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 16191d9..f6e7c6f 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -583,7 +584,9 @@ void MainWindow::updateUI() {
void MainWindow::loadImage(const Fm::FilePath & filePath, QModelIndex index) {
// cancel loading of current image
if(loadJob_) {
+ disconnect(loadJob_, &Fm::Job::finished, this, &MainWindow::onImageLoaded);
loadJob_->cancel(); // the job object will be freed automatically later
loadJob_ = nullptr;
}
if(imageModified_) {
Maybe loadJob_
could be guarded by a mutex, but maybe there's a nicer way to do it, before, onImageLoaded
took a pointer to the job thus avoiding that issue, using QObject::sender
could do the trick.
from lximage-qt.
@npmiller Great analysis... in #95 I've made something rather similar as your suggestion.
from lximage-qt.
I can confirm that the new patch fixed it. I'm closing this issue.
Thanks, @npmiller and @palinek!
from lximage-qt.
reopening... as the solution wasn't approved and merged into master yet
from lximage-qt.
Related Issues (20)
- erase in the menu "View" the checkbox next to "Full Screen" HOT 1
- dark system-theme is not respected HOT 1
- Use of the spacebar key to pause/resume a slideshow HOT 3
- Top of image gets corrupted when toolbar extension popup slides back HOT 3
- Add Finnish language to Weblate [Feature request] HOT 2
- [Feature request] `Open with` does not auto-save or suggest to save HOT 1
- Support changing implicit sort order HOT 2
- Window size is not remembered when pressing F11 one or two times HOT 6
- PCX not supported by QImageReader, should not be listed in .desktop file HOT 15
- [Feature request] Switch to toggle antialiasing filter HOT 1
- [Feature request] Add line wrap support to SVG HOT 2
- Small app icon HOT 7
- [Feature request] Option to disable partial rendering HOT 4
- [Feature request] Crop + Compress + save in original quality HOT 1
- Opening an image opens another image in the folder instead of the double clicked image HOT 1
- Confusing and contradictory licensing information HOT 1
- [Feature request] Support heif format HOT 10
- Checkbox for annotations toolbar resets always to non checked HOT 5
- TGA support HOT 1
- Wrong mimetype for PGM (image/x-portable-graymap) files HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from lximage-qt.