Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

KeyInputHelperTest failed with QT_QPA_PLATFORM=offscreen #335

Open
alexxy opened this issue Feb 27, 2024 · 3 comments
Open

KeyInputHelperTest failed with QT_QPA_PLATFORM=offscreen #335

alexxy opened this issue Feb 27, 2024 · 3 comments

Comments

@alexxy
Copy link

alexxy commented Feb 27, 2024

Hi!

We packages KImageAnnotator for Gentoo Linux and have 1 test faild when setting QT_QPA_PLATFORM=offscreen

23/49 Test: KeyInputHelperTest
Command: "/var/tmp/portage/media-libs/kimageannotator-0.7.0/work/kImageAnnotator-0.7.0_build/tests/KeyInputHelperTest"
Directory: /var/tmp/portage/media-libs/kimageannotator-0.7.0/work/kImageAnnotator-0.7.0_build/tests
"KeyInputHelperTest" start time: Feb 27 22:51 MSK
Output:
----------------------------------------------------------
********* Start testing of KeyInputHelperTest *********
Config: Using QtTest library 6.6.2, Qt 6.6.2 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 13.2.1 20240210), gentoo 2.14
PASS   : KeyInputHelperTest::initTestCase()
PASS   : KeyInputHelperTest::TestHandleKeyPress_Should_EmitRemoveSignal_When_KeyIsBackspace()
PASS   : KeyInputHelperTest::TestHandleKeyPress_Should_EmitRemoveSignal_When_KeyIsDelete()
PASS   : KeyInputHelperTest::TestHandleKeyPress_Should_EmitInsertSignalWithNewLine_When_KeyIsReturnAndModifierShift()
PASS   : KeyInputHelperTest::TestHandleKeyPress_Should_EmitInsertSignalWithNewLine_When_KeyIsEnterAndModifierShift()
PASS   : KeyInputHelperTest::TestHandleKeyPress_Should_EmitEscape_When_KeyIsReturnAndNoModifier()
PASS   : KeyInputHelperTest::TestHandleKeyPress_Should_EmitEscape_When_KeyIsEnterAndNoModifier()
PASS   : KeyInputHelperTest::TestHandleKeyPress_Should_EmitEscapeSignal_When_KeyIsEscape()
PASS   : KeyInputHelperTest::TestHandleKeyPress_Should_EmitMoveSignal_When_KeyIsHome()
PASS   : KeyInputHelperTest::TestHandleKeyPress_Should_EmitMoveSignal_When_KeyIsEnd()
PASS   : KeyInputHelperTest::TestHandleKeyPress_Should_EmitMoveSignal_When_KeyIsArrowLeft()
PASS   : KeyInputHelperTest::TestHandleKeyPress_Should_EmitMoveSignal_When_KeyIsArrowLeftAndModifierCtrl()
PASS   : KeyInputHelperTest::TestHandleKeyPress_Should_EmitMoveSignal_When_KeyIsArrowRight()
PASS   : KeyInputHelperTest::TestHandleKeyPress_Should_EmitMoveSignal_When_KeyIsArrowRightAndModifierCtrl()
PASS   : KeyInputHelperTest::TestHandleKeyPress_Should_EmitMoveSignal_When_KeyIsArrowUp()
PASS   : KeyInputHelperTest::TestHandleKeyPress_Should_EmitMoveSignal_When_KeyIsArrowDown()
PASS   : KeyInputHelperTest::TestHandleKeyPress_Should_EmitPasteSignal_When_KeyIsPaste()
PASS   : KeyInputHelperTest::TestHandleKeyPress_Should_EmitPasteSignal_When_KeySequenceIsPaste()
Received signal 11 (SIGSEGV), code 1, for address 0x00000000000000f8
         TestHandleKeyPress_Should_EmitInsertSignal_When_KeyIsCharacter function time: 0ms, total time: 0ms
<end of output>
Test time =   0.14 sec
----------------------------------------------------------
Test Failed.
"KeyInputHelperTest" end time: Feb 27 22:51 MSK
"KeyInputHelperTest" time elapsed: 00:00:00
----------------------------------------------------------

gentoo-bot pushed a commit to gentoo/gentoo that referenced this issue Feb 27, 2024
@DamirPorobic
Copy link
Member

I cannot reproduce this issue with latest 0.7.0. What Qt version are you using?

@dflogeras
Copy link
Contributor

@alexxy I assume you ran the unit tests against Qt6? Could you post your build env?

@dflogeras
Copy link
Contributor

I have built up an environment, and gotten the fail captured with stack trace

********* Start testing of KeyInputHelperTest *********
Config: Using QtTest library 6.6.2, Qt 6.6.2 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 13.2.1 20240113), gentoo 2.14
PASS : KeyInputHelperTest::initTestCase()
PASS : KeyInputHelperTest::TestHandleKeyPress_Should_EmitRemoveSignal_When_KeyIsBackspace()
PASS : KeyInputHelperTest::TestHandleKeyPress_Should_EmitRemoveSignal_When_KeyIsDelete()
PASS : KeyInputHelperTest::TestHandleKeyPress_Should_EmitInsertSignalWithNewLine_When_KeyIsReturnAndModifierShift()
PASS : KeyInputHelperTest::TestHandleKeyPress_Should_EmitInsertSignalWithNewLine_When_KeyIsEnterAndModifierShift()
PASS : KeyInputHelperTest::TestHandleKeyPress_Should_EmitEscape_When_KeyIsReturnAndNoModifier()
PASS : KeyInputHelperTest::TestHandleKeyPress_Should_EmitEscape_When_KeyIsEnterAndNoModifier()
PASS : KeyInputHelperTest::TestHandleKeyPress_Should_EmitEscapeSignal_When_KeyIsEscape()
PASS : KeyInputHelperTest::TestHandleKeyPress_Should_EmitMoveSignal_When_KeyIsHome()
PASS : KeyInputHelperTest::TestHandleKeyPress_Should_EmitMoveSignal_When_KeyIsEnd()
PASS : KeyInputHelperTest::TestHandleKeyPress_Should_EmitMoveSignal_When_KeyIsArrowLeft()
PASS : KeyInputHelperTest::TestHandleKeyPress_Should_EmitMoveSignal_When_KeyIsArrowLeftAndModifierCtrl()
PASS : KeyInputHelperTest::TestHandleKeyPress_Should_EmitMoveSignal_When_KeyIsArrowRight()
PASS : KeyInputHelperTest::TestHandleKeyPress_Should_EmitMoveSignal_When_KeyIsArrowRightAndModifierCtrl()
PASS : KeyInputHelperTest::TestHandleKeyPress_Should_EmitMoveSignal_When_KeyIsArrowUp()
PASS : KeyInputHelperTest::TestHandleKeyPress_Should_EmitMoveSignal_When_KeyIsArrowDown()
PASS : KeyInputHelperTest::TestHandleKeyPress_Should_EmitPasteSignal_When_KeyIsPaste()
PASS : KeyInputHelperTest::TestHandleKeyPress_Should_EmitPasteSignal_When_KeySequenceIsPaste()
Received signal 11 (SIGSEGV), code 1, for address 0x00000000000000f8
TestHandleKeyPress_Should_EmitInsertSignal_When_KeyIsCharacter function time: 0ms, total time: 0ms

=== Stack trace ===
[New LWP 3016]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
0x00007f2ade0fef77 in wait4 () from /lib64/libc.so.6

Thread 2 (Thread 0x7f2adb0b46c0 (LWP 3016) "QtTest Watchdog"):
#0 0x00007f2ade09fc8e in __futex_abstimed_wait_common () from /lib64/libc.so.6
#1 0x00007f2ade0a2a84 in pthread_cond_clockwait () from /lib64/libc.so.6
#2 0x00007f2adfb6a70d in std::__condvar::wait_until (__abs_time=..., __clock=1, __m=..., this=) at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/bits/std_mutex.h:137
#3 std::condition_variable::__wait_until_impl<std::chrono::duration<long, std::ratio<1l, 1000000000l> > > (__lock=..., __atime=..., this=) at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/condition_variable:203
#4 std::condition_variable::wait_until<std::chrono::duration<long, std::ratio<1l, 1000000000l> > > (__atime=..., __lock=..., this=) at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/condition_variable:113
#5 std::condition_variable::wait_until<std::chrono::_V2::steady_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> >, QTest::WatchDog::waitFor(std::unique_lockstd::mutex&, QTest::WatchDog::Expectation)::{lambda()#1}>(std::unique_lockstd::mutex&, std::chrono::time_point<std::chrono::_V2::steady_clock, std::chrono::duration<long, std::ratio<1l, 1000000000l> > > const&, QTest::WatchDog::waitFor(std::unique_lockstd::mutex&, QTest::WatchDog::Expectation)::{lambda()#1}) (__p=..., __atime=..., __lock=..., this=) at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/condition_variable:154
#6 std::condition_variable::wait_for<long, std::ratio<1l, 1000l>, QTest::WatchDog::waitFor(std::unique_lockstd::mutex&, QTest::WatchDog::Expectation)::{lambda()#1}>(std::unique_lockstd::mutex&, std::chrono::duration<long, std::ratio<1l, 1000l> > const&, QTest::WatchDog::waitFor(std::unique_lockstd::mutex&, QTest::WatchDog::Expectation)::{lambda()#1}) (__rtime=..., __p=..., __lock=..., this=) at /usr/lib/gcc/x86_64-pc-linux-gnu/13/include/g++-v13/condition_variable:177
#7 QTest::WatchDog::waitFor (e=70, m=..., this=) at /usr/src/debug/dev-qt/qtbase-6.6.2/qtbase-everywhere-src-6.6.2/src/testlib/qtestcase.cpp:1241
#8 QTest::WatchDog::run (this=) at /usr/src/debug/dev-qt/qtbase-6.6.2/qtbase-everywhere-src-6.6.2/src/testlib/qtestcase.cpp:1305
#9 0x00007f2ade72eaa6 in operator() (__closure=) at /usr/src/debug/dev-qt/qtbase-6.6.2/qtbase-everywhere-src-6.6.2/src/corelib/thread/qthread_unix.cpp:324
#10 (anonymous namespace)::terminate_on_exception<QThreadPrivate::start(void*)::<lambda()> > (t=...) at /usr/src/debug/dev-qt/qtbase-6.6.2/qtbase-everywhere-src-6.6.2/src/corelib/thread/qthread_unix.cpp:260
#11 QThreadPrivate::start (arg=0x557322e3d530) at /usr/src/debug/dev-qt/qtbase-6.6.2/qtbase-everywhere-src-6.6.2/src/corelib/thread/qthread_unix.cpp:283
#12 0x00007f2ade0a3109 in start_thread () from /lib64/libc.so.6
#13 0x00007f2ade1143a8 in clone3 () from /lib64/libc.so.6

Thread 1 (Thread 0x7f2adb3fc340 (LWP 3015) "KeyInputHelperT"):
#0 0x00007f2ade0fef77 in wait4 () from /lib64/libc.so.6
#1 0x00007f2adfb5f195 in generateStackTrace () at /usr/src/debug/dev-qt/qtbase-6.6.2/qtbase-everywhere-src-6.6.2/src/testlib/qtestcase.cpp:411
#2 0x00007f2adfb60f50 in generateStackTrace () at /usr/src/debug/dev-qt/qtbase-6.6.2/qtbase-everywhere-src-6.6.2/src/testlib/qtestcase.cpp:375
#3 (anonymous namespace)::FatalSignalHandler::actionHandler (signum=11, info=) at /usr/src/debug/dev-qt/qtbase-6.6.2/qtbase-everywhere-src-6.6.2/src/testlib/qtestcase.cpp:2179
#4
#5 0x00007f2adeae1a39 in XCloseDisplay () from /usr/lib64/libX11.so.6
#6 0x000055732189fefa in kImageAnnotator::CapsLockStatusChecker::isCapsLockEnabled () at /var/tmp/portage/media-libs/kimageannotator-0.7.0-r1/work/kImageAnnotator-0.7.0/src/annotations/items/text/CapsLockStatusChecker.cpp:50
#7 0x000055732189f5b5 in kImageAnnotator::KeyInputHelper::getTextWithCorrectCase (this=this@entry=0x7ffe796bda10, event=event@entry=0x7ffe796bda80) at /var/tmp/portage/media-libs/kimageannotator-0.7.0-r1/work/kImageAnnotator-0.7.0/src/annotations/items/text/KeyInputHelper.cpp:100
#8 0x000055732189fa4f in kImageAnnotator::KeyInputHelper::handleKeyPress (this=this@entry=0x7ffe796bda10, event=event@entry=0x7ffe796bda80) at /var/tmp/portage/media-libs/kimageannotator-0.7.0-r1/work/kImageAnnotator-0.7.0/src/annotations/items/text/KeyInputHelper.cpp:93
#9 0x000055732184f118 in KeyInputHelperTest::TestHandleKeyPress_Should_EmitInsertSignal_When_KeyIsCharacter (this=) at /var/tmp/portage/media-libs/kimageannotator-0.7.0-r1/work/kImageAnnotator-0.7.0/tests/annotations/items/helper/KeyInputHelperTest.cpp:252
#10 0x00007f2ade5d323d in QMetaMethodInvoker::invokeImpl (self=..., target=0x7ffe796be560, connectionType=connectionType@entry=Qt::DirectConnection, paramCount=paramCount@entry=1, parameters=parameters@entry=0x7ffe796bde40, typeNames=0x7ffe796bde48, metaTypes=0x7ffe796bde50) at /usr/src/debug/dev-qt/qtbase-6.6.2/qtbase-everywhere-src-6.6.2/src/corelib/kernel/qmetaobject.cpp:2713
#11 0x00007f2ade5d3c42 in QMetaMethod::invokeImpl (self=..., target=, connectionType=connectionType@entry=Qt::DirectConnection, paramCount=paramCount@entry=1, parameters=parameters@entry=0x7ffe796bde40, typeNames=0x7ffe796bde48, metaTypes=0x7ffe796bde50) at /usr/src/debug/dev-qt/qtbase-6.6.2/qtbase-everywhere-src-6.6.2/src/corelib/kernel/qmetaobject.cpp:2551
#12 0x00007f2adfb673ae in QMetaMethod::invoke<>(QObject*, Qt::ConnectionType, QMetaMethodReturnArgument) const (r=..., c=Qt::DirectConnection, obj=, this=) at /usr/src/debug/dev-qt/qtbase-6.6.2/qtbase-everywhere-src-6.6.2/src/corelib/kernel/qmetaobject.h:148
#13 QMetaMethod::invoke<>(QObject*, Qt::ConnectionType) const (c=Qt::DirectConnection, obj=, this=) at /usr/src/debug/dev-qt/qtbase-6.6.2/qtbase-everywhere-src-6.6.2/src/corelib/kernel/qmetaobject.h:160
#14 QTest::TestMethods::invokeTestOnData (this=0x7ffe796be3d0, index=) at /usr/src/debug/dev-qt/qtbase-6.6.2/qtbase-everywhere-src-6.6.2/src/testlib/qtestcase.cpp:1136
#15 0x00007f2adfb680f7 in QTest::TestMethods::invokeTest (this=this@entry=0x7ffe796be3d0, index=index@entry=17, tag=..., watchDog=0x557322e3d530) at /usr/src/debug/dev-qt/qtbase-6.6.2/qtbase-everywhere-src-6.6.2/src/testlib/qtestcase.cpp:1429
#16 0x00007f2adfb6890a in QTest::TestMethods::invokeTests (this=this@entry=0x7ffe796be3d0, testObject=) at /usr/src/debug/dev-qt/qtbase-6.6.2/qtbase-everywhere-src-6.6.2/src/testlib/qtestcase.cpp:1767
#17 0x00007f2adfb69349 in QTest::qRun () at /usr/src/debug/dev-qt/qtbase-6.6.2/qtbase-everywhere-src-6.6.2/src/testlib/qtestcase.cpp:2401
#18 0x00007f2adfb6988b in QTest::qExec (testObject=testObject@entry=0x7ffe796be560, argc=, argv=argv@entry=0x7ffe796be6b8) at /usr/src/debug/dev-qt/qtbase-6.6.2/qtbase-everywhere-src-6.6.2/src/testlib/qtestcase.cpp:2287
#19 0x000055732184c1e0 in main (argc=, argv=0x7ffe796be6b8) at /var/tmp/portage/media-libs/kimageannotator-0.7.0-r1/work/kImageAnnotator-0.7.0/tests/annotations/items/helper/KeyInputHelperTest.cpp:259
[Inferior 1 (process 3015) detached]
=== End of stack trace ===
Segmentation fault

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants