Author Topic: Qt6 Application Testing  (Read 441459 times)

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2531
  • Karma: +195/-0
    • View Profile
Re: Qt6 Application Testing
« Reply #735 on: January 09, 2025, 10:12:32 am »
I wonder how Windows avoids such a fate with QT6.7+? Since it uses drives too...

OK found 1st problem.

For OS/2, we use qfsfileengine_unix.cpp

In 6.2.x - https://github.com/psmedley/qt6-base-os2/blob/main/src/corelib/io/qfsfileengine_unix.cpp#L528
In 6.8.1 - https://github.com/psmedley/qt6-base-os2/blob/6.8.x/src/corelib/io/qfsfileengine_unix.cpp#L504

So I think in 6.8.1 we need this to be something more like:
Code: [Select]
bool QFSFileEngine::isRelativePath() const
{
    Q_D(const QFSFileEngine);
    const QString fp = d->fileEntry.filePath();
#ifndef Q_OS_OS2
    return fp.isEmpty() || fp.at(0) != u'/';
#else
    return fp.isEmpty() || (fp.at(1) != u':' && fp.at(1) != u'/');
#endif
}

KO Myung-Hun

  • Jr. Member
  • **
  • Posts: 81
  • Karma: +11/-0
    • View Profile
Re: Qt6 Application Testing
« Reply #736 on: January 09, 2025, 10:22:17 am »
Hi/2.

Code: [Select]
bool QFSFileEngine::isRelativePath() const
{
    Q_D(const QFSFileEngine);
    const QString fp = d->fileEntry.filePath();
#ifndef Q_OS_OS2
    return fp.isEmpty() || fp.at(0) != u'/';
#else
    return fp.isEmpty() || (fp.at(1) != u':' && fp.at(1) != u'/');
#endif
}

Code: [Select]
fp.at(1) != u'/'
 should be

Code: [Select]
fp.at(0) != u'/'
right?

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2531
  • Karma: +195/-0
    • View Profile
Re: Qt6 Application Testing
« Reply #737 on: January 09, 2025, 07:37:47 pm »
well, for completeness, I guess it should be:
Code: [Select]
return fp.isEmpty() || (fp.at(1) != u':' && fp.at(1) != u'/')  || fp.at(0) != u'/'; ?

Rich Walsh

  • Sr. Member
  • ****
  • Posts: 405
  • Karma: +30/-0
  • ONU! (OS/2 is NOT Unix!)
    • View Profile
Re: Qt6 Application Testing
« Reply #738 on: January 09, 2025, 10:15:23 pm »
well, for completeness, I guess it should be:
Code: [Select]
return fp.isEmpty() || (fp.at(1) != u':' && fp.at(1) != u'/')  || fp.at(0) != u'/'; ?

Nope. "fp.at(1) != u'/'" would disqualify "./myapp.exe". I believe it should be:

Code: [Select]
return fp.isEmpty() || (fp.at(1) != u':' && fp.at(0) != u'/');

This should return FALSE for f/q DOSish paths (C:/blahblah) and f/q UNIX paths (/blahblah).


Paul Smedley

  • Hero Member
  • *****
  • Posts: 2531
  • Karma: +195/-0
    • View Profile
Re: Qt6 Application Testing
« Reply #739 on: January 09, 2025, 10:25:47 pm »
Yeah that was a typo, I meant:
Code: [Select]
return fp.isEmpty() || (fp.at(1) != u':' && fp.at(2) != u'/')  || fp.at(0) != u'/';
Thanks for the catch tho, I just tested and it didn't change the behaviour of removeRecursively() now I see why (of course, this might not be the root cause....)

Edit: seems it's not the root cause...
« Last Edit: January 09, 2025, 10:30:15 pm by Paul Smedley »

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2531
  • Karma: +195/-0
    • View Profile
Re: Qt6 Application Testing
« Reply #740 on: January 10, 2025, 01:04:02 am »
OK I understand what's happening. Basically some code is appending \\ to the temp directory, then somehow this then becomes \.

I hacked the code and made the remove recursive code not remove anything, and am also testing in a VM. Out for breakfast now but will dig more when I get home.

KO Myung-Hun

  • Jr. Member
  • **
  • Posts: 81
  • Karma: +11/-0
    • View Profile
Re: Qt6 Application Testing
« Reply #741 on: January 10, 2025, 04:42:05 am »
Hi/2.

Code: [Select]
return fp.isEmpty() || (fp.at(1) != u':' && fp.at(2) != u'/')  || fp.at(0) != u'/';
This is wrong, because 'x:/' is determined as a relative path. Correct is like:

Code: [Select]
return fp.isEmpty() || (fp.at(0) != u'/' && fp.at(1) != u':')
If fp.at(2) != u'/' is used, 'x:dir' style, which is a drive-relative path, is determined as a relative path. BTW, some codes making an absolute path concatenate a relative path to a current path. In this case, 'x:dir' is appended to a current path like '/curdir/x:dir', which is wrong. So a drive-relative path should not be treated as a relative path.

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2531
  • Karma: +195/-0
    • View Profile
Re: Qt6 Application Testing
« Reply #742 on: January 10, 2025, 05:16:30 am »
Thanks KO - I'm clearly overthinking this, howeer, I tried your solution, and it doesn't seem it's the problem for removerecursively....

Somehow, the following is happening.... but I cna't work out where...
Code: [Select]
QDEBUG : tst_QTemporaryDir::construction() filepath "C:/var/temp/tst_qtemporarydir-kVWTdl\\."
QDEBUG : tst_QTemporaryDir::construction() removeRecursively dirPath = "C:/var/temp/tst_qtemporarydir-kVWTdl/."
QDEBUG : tst_QTemporaryDir::construction() filepath "C:/var/temp/tst_qtemporarydir-kVWTdl/.\\."
QDEBUG : tst_QTemporaryDir::construction() removeRecursively dirPath = "C:/var/temp/tst_qtemporarydir-kVWTdl/./."
QDEBUG : tst_QTemporaryDir::construction() filepath "C:/var/temp/tst_qtemporarydir-kVWTdl/./.\\."
QDEBUG : tst_QTemporaryDir::construction() removeRecursively dirPath = "C:/var/temp/tst_qtemporarydir-kVWTdl/././."
QDEBUG : tst_QTemporaryDir::construction() filepath "C:/var/temp/tst_qtemporarydir-kVWTdl/././.\\."
QDEBUG : tst_QTemporaryDir::construction() removeRecursively dirPath = "C:/var/temp/tst_qtemporarydir-kVWTdl/./././."
QDEBUG : tst_QTemporaryDir::construction() filepath "C:/var/temp/tst_qtemporarydir-kVWTdl/./././.\\."
QDEBUG : tst_QTemporaryDir::construction() removeRecursively dirPath = "C:/var/temp/tst_qtemporarydir-kVWTdl/././././."
QDEBUG : tst_QTemporaryDir::construction() filepath "C:/var/temp/tst_qtemporarydir-kVWTdl/././././.\\."
QDEBUG : tst_QTemporaryDir::construction() removeRecursively dirPath = "C:/var/temp/tst_qtemporarydir-kVWTdl/./././././."
QDEBUG : tst_QTemporaryDir::construction() filepath "C:/var/temp/tst_qtemporarydir-kVWTdl/./././././.\\."
QDEBUG : tst_QTemporaryDir::construction() removeRecursively dirPath = "C:/var/temp/tst_qtemporarydir-kVWTdl/././././././."
QDEBUG : tst_QTemporaryDir::construction() filepath "C:/var/temp/tst_qtemporarydir-kVWTdl/././././././.\\."
QDEBUG : tst_QTemporaryDir::construction() removeRecursively dirPath = "C:/var/temp/tst_qtemporarydir-kVWTdl/./././././././."
QDEBUG : tst_QTemporaryDir::construction() filepath "C:/var/temp/tst_qtemporarydir-kVWTdl/./././././././.\\."

this is just a snip - eventually end up with some entries like:
Code: [Select]
"C:/var/temp/tst_qtemporarydir-kVWTdl/././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././..\\.."
QDEBUG : tst_QTemporaryDir::construction() removeRecursively dirPath = "C:/var/temp/tst_qtemporarydir-kVWTdl/././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././../.."
QDEBUG : tst_QTemporaryDir::construction() filepath "C:/var/temp/tst_qtemporarydir-kVWTdl/././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././././..\\.org.chromium.Chromium.4QbsiA"
Where we've gone up a directory from c:\var\temp and start removing files from c:. Driving me nuts as I can't seem to locate the code that's doing this.

Will have to try build a debug qt6core.dll and see if I can get the debugger to play nicely.

Edit: I *think* that what's supposed to be happening is that the '.' and '..' entries are supposed to be ignored, but they're not....

Yep... they're not:
Code: [Select]
QDEBUG : tst_QTemporaryDir::construction() removeRecursively dirPath = "C:/var/temp/tst_qtemporarydir-WuYeEF"
QDEBUG : tst_QTemporaryDir::construction() isDotorDotDot: "tst_qtemporarydir-WuYeEF\\."

I'm presuming that in theory, just the '.' should have bene passed to isDotorDotDot then it would have been skipped...
« Last Edit: January 10, 2025, 06:27:46 am by Paul Smedley »

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2531
  • Karma: +195/-0
    • View Profile
Re: Qt6 Application Testing
« Reply #743 on: January 10, 2025, 07:47:25 am »
OK, https://github.com/psmedley/qt6-base-os2/commit/ee029c7866a242ef8d8cbb1e6c7d393b9ef7d6ab fixes the issue with filepaths. Not really sure why this was required in 6.8.x but not earlier...

Edit: qtdeclarative from 6.8.x has got a LOT further now, and hasn't deleted any files in the root directory of my c: :)
« Last Edit: January 10, 2025, 09:58:18 am by Paul Smedley »

Flashback

  • Newbie
  • *
  • Posts: 15
  • Karma: +5/-1
    • View Profile
Re: Qt6 Application Testing
« Reply #744 on: January 10, 2025, 07:36:46 pm »
When accessing fp.at(N) make sure, that N is smaller than fp.size(). Don't rely on fp.at(fp.size) is the null terminator.

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2531
  • Karma: +195/-0
    • View Profile
Re: Qt6 Application Testing
« Reply #745 on: January 15, 2025, 09:00:05 am »
OK... took a little longer than expected, and still a bit hacky (I reverted https://github.com/psmedley/qt6-base-os2/blob/6.8.x/src/gui/text/unix/qfontconfigdatabase.cpp to the Qt 6.6.x version to avoid a crash) and building qtdeclarative is a PITA with the previously reported SIGABRT.. but....

https://smedley.id.au/tmp/qt6-6.8.1-os2-20250115.zip is now available. I've only tried a couple of the examples, and I haven't tried dooble with this (by copying over the Qt 6.2.x components).

YMMV

David McKenna

  • Hero Member
  • *****
  • Posts: 891
  • Karma: +32/-0
    • View Profile
Re: Qt6 Application Testing
« Reply #746 on: January 15, 2025, 12:22:43 pm »
 Thanks Paul. This one is a mixed bag, I did a quick test of some apps (with 6.2.10 Webengine) and Dooble doesn't work (silent exit) nor does focuswriter or LibreCAD or Tea or Tetzle. Media-Downloader, Soduku, ppineapplepicture, and QTPasswordgenerator do work. I'll try some examples later today...

Regards,
« Last Edit: January 15, 2025, 12:29:13 pm by David McKenna »

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2531
  • Karma: +195/-0
    • View Profile
Re: Qt6 Application Testing
« Reply #747 on: January 15, 2025, 08:52:27 pm »
Thanks Paul. This one is a mixed bag, I did a quick test of some apps (with 6.2.10 Webengine) and Dooble doesn't work (silent exit) nor does focuswriter or LibreCAD or Tea or Tetzle. Media-Downloader, Soduku, ppineapplepicture, and QTPasswordgenerator do work. I'll try some examples later today...

Thanks Dave, I won't be hugely surprised if apps built against Qt 6.2 don't work with Qt 6.8 libraries - I always expected apps might need to be rebuilt, just wanted to see how far I could push things!

TeLLie

  • Sr. Member
  • ****
  • Posts: 278
  • Karma: +16/-0
    • View Profile
Re: Qt6 Application Testing
« Reply #748 on: January 15, 2025, 08:53:38 pm »
Hi Paul,

I tried to compile some progs but i only get this when running qmake

Assertion failed: _UM_LUMP_STATUS (olump) == _UMS_FREE, file ./libc-0.1.13/src/emx/src/lib/malloc/ialloc.c, line 116

Killed by SIGABRT
pid=0x2190 ppid=0x218f tid=0x0001 slot=0x009b pri=0x0200 mc=0x0001 ps=0x0010
H:\USR\QT6-626\BIN\QMAKE6.EXE
Creating 2190_01.TRP
Moved 2190_01.TRP to C:\var\log\app\67881edb-2190_01-QMAKE6-exceptq.txt

I copied in the v6.2.10 dir
Will try later in a clean dir...

Paul Smedley

  • Hero Member
  • *****
  • Posts: 2531
  • Karma: +195/-0
    • View Profile
Re: Qt6 Application Testing
« Reply #749 on: January 15, 2025, 09:09:14 pm »
Hi Paul,

I tried to compile some progs but i only get this when running qmake

Assertion failed: _UM_LUMP_STATUS (olump) == _UMS_FREE, file ./libc-0.1.13/src/emx/src/lib/malloc/ialloc.c, line 116

Killed by SIGABRT
pid=0x2190 ppid=0x218f tid=0x0001 slot=0x009b pri=0x0200 mc=0x0001 ps=0x0010
H:\USR\QT6-626\BIN\QMAKE6.EXE
Creating 2190_01.TRP
Moved 2190_01.TRP to C:\var\log\app\67881edb-2190_01-QMAKE6-exceptq.txt

I copied in the v6.2.10 dir
Will try later in a clean dir...

Looks like the same trap I was getting with qmlcachegen.exe when building qtdeclarative.... Can you upload the exceptq txt?