Open benstox opened 2 years ago
Same on Fedora 36, building from source at 9967dec8ad76
EDIT: The crash only occurs on Wayland, on Xorg everything is fine.
Stacktrace:
#0 __pthread_kill_implementation
(threadid=<optimized out>, signo=signo@entry=6, no_tid=no_tid@entry=0)
at pthread_kill.c:44
#1 0x00007ffff608ec73 in __pthread_kill_internal
(signo=6, threadid=<optimized out>) at pthread_kill.c:78
#2 0x00007ffff603e986 in __GI_raise (sig=sig@entry=6)
at ../sysdeps/posix/raise.c:26
#3 0x00007ffff60287f4 in __GI_abort () at abort.c:79
#4 0x00007ffff64a2b77 in __gnu_cxx::__verbose_terminate_handler() ()
at ../../../../libstdc++-v3/libsupc++/vterminate.cc:95
#5 0x00007ffff64ae3bc in __cxxabiv1::__terminate(void (*)())
(handler=<optimized out>)
at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:48
#6 0x00007ffff64ae427 in std::terminate() ()
at ../../../../libstdc++-v3/libsupc++/eh_terminate.cc:58
#7 0x00007ffff64ae6db in __cxxabiv1::__cxa_rethrow() ()
at ../../../../libstdc++-v3/libsupc++/eh_throw.cc:136
#8 0x00007ffff6e857cc in QCoreApplication::notifyInternal(QObject*, QEvent*)
(this=0x7fffffffdac0, receiver=receiver@entry=0x7fffffffd9d0, event=event@entry=0x7fffffffd8f0) at kernel/qcoreapplication.cpp:958
#9 0x00007ffff74cdac5 in QCoreApplication::sendEvent(QObject*, QEvent*)
(event=0x7fffffffd8f0, receiver=0x7fffffffd9d0)
at ../../include/QtCore/../../src/corelib/kernel/qcoreapplication.h:231
#10 QWidgetPrivate::show_helper() (this=0x848600) at kernel/qwidget.cpp:7569
#11 0x00007ffff74cf6ec in QWidget::setVisible(bool)
(this=0x7fffffffd9d0, visible=<optimized out>) at kernel/qwidget.cpp:7791
#12 0x00000000004f2652 in QWidget::show() (this=0x7fffffffd9d0)
at /usr/include/QtGui/qwidget.h:497
#13 0x00000000004f22c2 in main(int, char**) (argc=1, argv=0x7fffffffdc78)
at /home/mk/src/android-file-transfer-linux/qt/main.cpp:85
Furthermore, the crash on wayland can be avoided by export GDK_BACKEND=x11
before invoking android-file-transfer
Below a simple patch which works around the issue (too lazy to make a PR, sorry, perhaps someone else is motivated)
iff --git a/qt/main.cpp b/qt/main.cpp
index 4a70feb..e5efbaf 100644
--- a/qt/main.cpp
+++ b/qt/main.cpp
@@ -25,6 +25,7 @@
#include <QMessageBox>
#include <QTranslator>
#include <mtp/log.h>
+#include <stdlib.h>
#if QT_VERSION >= 0x050000
# include <QGuiApplication>
#endif
@@ -52,6 +53,10 @@ namespace
int main(int argc, char *argv[])
{
+ if (getenv("WAYLAND_DISPLAY")) {
+ // See #322
+ setenv("GDK_BACKEND", "x11", true);
+ }
QApplication app(argc, argv);
Q_INIT_RESOURCE(android_file_transfer);
Setting GDK_BACKEND=x11 just forces aft to run under xwayland, you should instead set QT_QPA_PLATFORM=wayland
to run under wayland
Hello,
I am getting this error when I run
android-file-transfer
, built at commit5ae0221
, tagcontinuous
, version 4.3.0. I am running Ubuntu 22.04.1 LTS. It is trying to connect to a Motorola "Moto G (3rd Generation)", Android version 6.0.1.An UI window opens with the text: "Could not open MTP session: vector::_M_range_check: __n (which is 0) >= this->size() (which is 0)"
And I get the terminal output:
Running
aft-mtp-cli
gives: