Re: [Interest] ASAN (Qt 6.4 + Glib) build shows stackoverflow in trivial Qt program

2022-11-17 Thread Dennis Luehring

Am 13.11.2022 um 18:03 schrieb Henry Skoglund:

I can confirm "several tiny libraries" i.e. I had the same problem when
building Qt on Ubuntu 22.04.
After fiddling for a while, I took the easy way out:
sudo apt-get install libxcb*

That installed 68 libs (all beginning with libxcb-) probably overkill
but at least it solved the problem :-)
/Henry


install all the libxcb* - will sort out the correct dependency later

works - thanks
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] ASAN (Qt 6.4 + Glib) build shows stackoverflow in trivial Qt program

2022-11-16 Thread Thiago Macieira
On Wednesday, 16 November 2022 05:52:35 PST Dennis Luehring wrote:
> > Fixed in https://codereview.qt-project.org/c/qt/qtbase/+/442720
> 
> your fix was rejected for 6.4.1

It's not "rejected". I never requested it be included in 6.4.1 branch because 
it's not release-critical. It'll be in 6.4.2.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Cloud Software Architect - Intel DCAI Cloud Engineering



___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] ASAN (Qt 6.4 + Glib) build shows stackoverflow in trivial Qt program

2022-11-16 Thread Dennis Luehring

Am 10.11.2022 um 20:40 schrieb Thiago Macieira:

On Thursday, 10 November 2022 00:23:52 PST Dennis Luehring wrote:
>  #1 0x7f08b15289a1 in g_object_get_valist ../glib/gobject/gobject.c:2659
>  #2 0x7f08b1529029 in g_object_get ../glib/gobject/gobject.c:2754
>  #3 0x7f08b3eee24b in gtkSetting

template 
static T gtkSetting(const gchar *propertyName)
{
 GtkSettings *settings = gtk_settings_get_default();
 T value;
 g_object_get(settings, propertyName, , NULL);
 return value;
}

The GLib line is:

   G_VALUE_LCOPY (, var_args, 0, );

Which uses this macro:
https://gitlab.gnome.org/GNOME/glib/-/blob/2.72.1/gobject/
gvaluecollector.h#L213-252

There's no support in it for boolean (1-byte) properties. The problem is that
f*&*!)ing Glib is written in C and refuses to use bool. They have:

typedef intgint;
typedef gint   gboolean;

So their boolean is a 4-byte type.

Fixed in https://codereview.qt-project.org/c/qt/qtbase/+/442720



your fix was rejected for 6.4.1
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] ASAN (Qt 6.4 + Glib) build shows stackoverflow in trivial Qt program

2022-11-14 Thread Dennis Luehring

Am 13.11.2022 um 18:03 schrieb Henry Skoglund:

On 2022-11-13 17:52, Thiago Macieira wrote:
> On Saturday, 12 November 2022 23:11:45 PST Dennis Luehring wrote:
>> forcing -xcb gives me these configure output (https://pastebin.com/ML8QCJRQ)
>>
>> XCB:
>>   Using system-provided xcb-xinput . no
>>   GL integrations:
>> GLX Plugin . yes
>>   XCB GLX .. yes
>> EGL-X11 Plugin . yes
>>
>> but also configure fails with
>>
>> ERROR: Feature "xcb": Forcing to "ON" breaks its condition:
>>   QT_FEATURE_thread AND TARGET XCB::XCB AND TEST_xcb_syslibs AND
>> QT_FEATURE_xkbcommon_x11
>>
>>
>> i've double checked every required package that is needed and can't find
>> a missing package
> Your log says:
>
>>TEST_xcb_syslibs = "FALSE"
> This is the problem. You're missing the XCB libraries in your environment (we
> don't ship them bundled in Qt any more). You may want to increase the log
> level because XCB support requires several tiny libraries and any of them
> missing means the entire support is missing.
>

I can confirm "several tiny libraries" i.e. I had the same problem when
building Qt on Ubuntu 22.04.
After fiddling for a while, I took the easy way out:
sudo apt-get install libxcb*



i've already got the with X in front - there are still many to go :) -
any slightest hint?

X libxcb-dri2-0/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic]
X libxcb-dri3-0/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic]
X libxcb-glx0-dev/jammy,now 1.14-3ubuntu3 amd64 [installed]
X libxcb-glx0/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic]
X libxcb-icccm4-dev/jammy,now 0.4.1-1.1build2 amd64 [installed]
X libxcb-icccm4/jammy,now 0.4.1-1.1build2 amd64 [installed,automatic]
X libxcb-image0-dev/jammy,now 0.4.0-2 amd64 [installed]
X libxcb-image0/jammy,now 0.4.0-2 amd64 [installed]
X libxcb-keysyms1-dev/jammy,now 0.4.0-1build3 amd64 [installed]
X libxcb-keysyms1/jammy,now 0.4.0-1build3 amd64 [installed,automatic]
X libxcb-present0/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic]
X libxcb-randr0-dev/jammy,now 1.14-3ubuntu3 amd64 [installed]
X libxcb-randr0/jammy,now 1.14-3ubuntu3 amd64 [installed]
X libxcb-render-util0-dev/jammy,now 0.3.9-1build3 amd64 [installed]
X libxcb-render-util0/jammy,now 0.3.9-1build3 amd64 [installed,automatic]
X libxcb-render0-dev/jammy,now 1.14-3ubuntu3 amd64 [installed]
X libxcb-render0/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic]
X libxcb-res0/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic]
X libxcb-shape0-dev/jammy,now 1.14-3ubuntu3 amd64 [installed]
X libxcb-shape0/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic]
X libxcb-shm0-dev/jammy,now 1.14-3ubuntu3 amd64 [installed]
X libxcb-shm0/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic]
X libxcb-sync-dev/jammy,now 1.14-3ubuntu3 amd64 [installed]
X libxcb-sync1/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic]
X libxcb-util-dev/jammy,now 0.4.0-1build2 amd64 [installed]
X libxcb-util1/jammy,now 0.4.0-1build2 amd64 [installed]
X libxcb-xfixes0-dev/jammy,now 1.14-3ubuntu3 amd64 [installed]
X libxcb-xfixes0/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic]
X libxcb-xinerama0-dev/jammy,now 1.14-3ubuntu3 amd64 [installed]
X libxcb-xinerama0/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic]
X libxcb-xinput-dev/jammy,now 1.14-3ubuntu3 amd64 [installed]
X libxcb-xinput0/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic]
X libxcb-xkb-dev/jammy,now 1.14-3ubuntu3 amd64 [installed]
X libxcb-xkb1/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic]
X libxcb-xv0/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic]
X libxcb1-dev/jammy,now 1.14-3ubuntu3 amd64 [installed]
X libxcb1/jammy,now 1.14-3ubuntu3 amd64 [installed]
libxcb-composite0-dev/jammy 1.14-3ubuntu3 amd64
libxcb-composite0/jammy 1.14-3ubuntu3 amd64
libxcb-cursor-dev/jammy 0.1.1-4ubuntu1 amd64
libxcb-cursor0/jammy 0.1.1-4ubuntu1 amd64
libxcb-damage0-dev/jammy 1.14-3ubuntu3 amd64
libxcb-damage0/jammy 1.14-3ubuntu3 amd64
libxcb-doc/jammy,jammy 1.14-3ubuntu3 all
libxcb-dpms0-dev/jammy 1.14-3ubuntu3 amd64
libxcb-dpms0/jammy 1.14-3ubuntu3 amd64
libxcb-dri2-0-dev/jammy 1.14-3ubuntu3 amd64
libxcb-dri3-dev/jammy 1.14-3ubuntu3 amd64
libxcb-ewmh-dev/jammy 0.4.1-1.1build2 amd64
libxcb-ewmh2/jammy 0.4.1-1.1build2 amd64
libxcb-imdkit-dev/jammy 1.0.3-1 amd64
libxcb-imdkit1/jammy 1.0.3-1 amd64
libxcb-present-dev/jammy 1.14-3ubuntu3 amd64
libxcb-record0-dev/jammy 1.14-3ubuntu3 amd64
libxcb-record0/jammy 1.14-3ubuntu3 amd64
libxcb-res0-dev/jammy 1.14-3ubuntu3 amd64
libxcb-screensaver0-dev/jammy 1.14-3ubuntu3 amd64
libxcb-screensaver0/jammy 1.14-3ubuntu3 amd64
libxcb-util0-dev/jammy 0.4.0-1build2 amd64
libxcb-xf86dri0-dev/jammy 1.14-3ubuntu3 amd64
libxcb-xf86dri0/jammy 1.14-3ubuntu3 amd64
libxcb-xrm-dev/jammy 1.0-3 amd64
libxcb-xrm0/jammy 1.0-3 amd64
libxcb-xtest0-dev/jammy 1.14-3ubuntu3 amd64
libxcb-xtest0/jammy 1.14-3ubuntu3 amd64
libxcb-xv0-dev/jammy 1.14-3ubuntu3 amd64

Re: [Interest] ASAN (Qt 6.4 + Glib) build shows stackoverflow in trivial Qt program

2022-11-13 Thread Thiago Macieira
On Sunday, 13 November 2022 09:51:54 PST Henry Skoglund wrote:
> not only are those libcxb files cluttering up my RAM they're also
> creating litter on my SSD :-(

You chose that when you chose to use Snap or AppImage or Flatpak applications.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Cloud Software Architect - Intel DCAI Cloud Engineering



___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] ASAN (Qt 6.4 + Glib) build shows stackoverflow in trivial Qt program

2022-11-13 Thread Henry Skoglund

On 2022-11-13 18:29, Thiago Macieira wrote:

On Sunday, 13 November 2022 09:03:40 PST Henry Skoglund wrote:

I can confirm "several tiny libraries" i.e. I had the same problem when
building Qt on Ubuntu 22.04.
After fiddling for a while, I took the easy way out:
sudo apt-get install libxcb*

That installed 68 libs (all beginning with libxcb-) probably overkill
but at least it solved the problem :-)

Those XCB libraries are generated from the X specification, that's why there
are so many of them. But this split up is counter-productive now.

As you've seen, it causes headache in forgetting just one of them. And as we
add content to Qt, what built one version may not build the next, so you have
to review after the upgrade.

The next problem is memory fragmentation. At a bare minimum, each library on
Linux must be one read-only page containing code and one read-write page
containing the GOT. Most Linux distros actually split a bit more for security,
with a read-only non-executable page before the executable one, then one more
after for read-only constant data and yet another for post-relocation read-
only, like so:

Address   Kbytes RSS PSS   DirtySwap Mode  Mapping
7fed1e9e6000   4   4   0   0   0 r--p- libxcb-shm.so.
0.0.0
7fed1e9e7000   4   4   0   0   0 r-xp-libxcb-shm.so.
0.0.0
7fed1e9e8000   4   4   0   0   0 r--p- libxcb-shm.so.
0.0.0
7fed1e9e9000   4   4   4   4   0 r--p- libxcb-shm.so.
0.0.0
7fed1e9ea000   4   4   4   4   0 rw-p-libxcb-shm.so.
0.0.0

And the last two pages are not sharable between processes, so each one of
those costs 5 VMA entries in the page tables, 8 kB of non-sharable data, and a
bit of load-time work processing relocations.

All this for this tiny XCB library:
-rwxr-xr-x 1 root root 14416 Aug 31 05:33 /lib64/libxcb-shm.so.0.0.0


For Clear Linux, we've "tricked" the build to just merge all those libraries
and libX11.so into a single .so, so they are loaded once only and occupy Much
less memory.


Yeah maybe Ubuntu is not the cream of the crop anymore:
find / -name libxcb-shm.so.0.0.0
/usr/lib/x86_64-linux-gnu/libxcb-shm.so.0.0.0
/snap/snap-store/582/usr/lib/x86_64-linux-gnu/libxcb-shm.so.0.0.0
/snap/snap-store/599/usr/lib/x86_64-linux-gnu/libxcb-shm.so.0.0.0
/snap/gnome-3-38-2004/119/usr/lib/x86_64-linux-gnu/libxcb-shm.so.0.0.0
/snap/gnome-3-38-2004/115/usr/lib/x86_64-linux-gnu/libxcb-shm.so.0.0.0

not only are those libcxb files cluttering up my RAM they're also 
creating litter on my SSD :-(


___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] ASAN (Qt 6.4 + Glib) build shows stackoverflow in trivial Qt program

2022-11-13 Thread Thiago Macieira
On Sunday, 13 November 2022 09:03:40 PST Henry Skoglund wrote:
> I can confirm "several tiny libraries" i.e. I had the same problem when
> building Qt on Ubuntu 22.04.
> After fiddling for a while, I took the easy way out:
> sudo apt-get install libxcb*
> 
> That installed 68 libs (all beginning with libxcb-) probably overkill
> but at least it solved the problem :-)

Those XCB libraries are generated from the X specification, that's why there 
are so many of them. But this split up is counter-productive now.

As you've seen, it causes headache in forgetting just one of them. And as we 
add content to Qt, what built one version may not build the next, so you have 
to review after the upgrade.

The next problem is memory fragmentation. At a bare minimum, each library on 
Linux must be one read-only page containing code and one read-write page 
containing the GOT. Most Linux distros actually split a bit more for security, 
with a read-only non-executable page before the executable one, then one more 
after for read-only constant data and yet another for post-relocation read-
only, like so:

Address   Kbytes RSS PSS   DirtySwap Mode  Mapping
7fed1e9e6000   4   4   0   0   0 r--p- libxcb-shm.so.
0.0.0
7fed1e9e7000   4   4   0   0   0 r-xp-libxcb-shm.so.
0.0.0
7fed1e9e8000   4   4   0   0   0 r--p- libxcb-shm.so.
0.0.0
7fed1e9e9000   4   4   4   4   0 r--p- libxcb-shm.so.
0.0.0
7fed1e9ea000   4   4   4   4   0 rw-p-libxcb-shm.so.
0.0.0

And the last two pages are not sharable between processes, so each one of 
those costs 5 VMA entries in the page tables, 8 kB of non-sharable data, and a 
bit of load-time work processing relocations.

All this for this tiny XCB library:
-rwxr-xr-x 1 root root 14416 Aug 31 05:33 /lib64/libxcb-shm.so.0.0.0


For Clear Linux, we've "tricked" the build to just merge all those libraries 
and libX11.so into a single .so, so they are loaded once only and occupy Much 
less memory.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Cloud Software Architect - Intel DCAI Cloud Engineering



___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] ASAN (Qt 6.4 + Glib) build shows stackoverflow in trivial Qt program

2022-11-13 Thread Henry Skoglund

On 2022-11-13 17:52, Thiago Macieira wrote:

On Saturday, 12 November 2022 23:11:45 PST Dennis Luehring wrote:

forcing -xcb gives me these configure output (https://pastebin.com/ML8QCJRQ)

XCB:
  Using system-provided xcb-xinput . no
  GL integrations:
GLX Plugin . yes
  XCB GLX .. yes
EGL-X11 Plugin . yes

but also configure fails with

ERROR: Feature "xcb": Forcing to "ON" breaks its condition:
  QT_FEATURE_thread AND TARGET XCB::XCB AND TEST_xcb_syslibs AND
QT_FEATURE_xkbcommon_x11


i've double checked every required package that is needed and can't find
a missing package

Your log says:


   TEST_xcb_syslibs = "FALSE"

This is the problem. You're missing the XCB libraries in your environment (we
don't ship them bundled in Qt any more). You may want to increase the log
level because XCB support requires several tiny libraries and any of them
missing means the entire support is missing.



I can confirm "several tiny libraries" i.e. I had the same problem when 
building Qt on Ubuntu 22.04.

After fiddling for a while, I took the easy way out:
sudo apt-get install libxcb*

That installed 68 libs (all beginning with libxcb-) probably overkill 
but at least it solved the problem :-)

/Henry

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] ASAN (Qt 6.4 + Glib) build shows stackoverflow in trivial Qt program

2022-11-13 Thread Thiago Macieira
On Saturday, 12 November 2022 23:11:45 PST Dennis Luehring wrote:
> forcing -xcb gives me these configure output (https://pastebin.com/ML8QCJRQ)
> 
>XCB:
>  Using system-provided xcb-xinput . no
>  GL integrations:
>GLX Plugin . yes
>  XCB GLX .. yes
>EGL-X11 Plugin . yes
> 
> but also configure fails with
> 
> ERROR: Feature "xcb": Forcing to "ON" breaks its condition:
>  QT_FEATURE_thread AND TARGET XCB::XCB AND TEST_xcb_syslibs AND
> QT_FEATURE_xkbcommon_x11
> 
> 
> i've double checked every required package that is needed and can't find
> a missing package

Your log says:

>   TEST_xcb_syslibs = "FALSE"

This is the problem. You're missing the XCB libraries in your environment (we 
don't ship them bundled in Qt any more). You may want to increase the log 
level because XCB support requires several tiny libraries and any of them 
missing means the entire support is missing.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Cloud Software Architect - Intel DCAI Cloud Engineering



___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] ASAN (Qt 6.4 + Glib) build shows stackoverflow in trivial Qt program

2022-11-12 Thread Dennis Luehring

Am 12.11.2022 um 20:45 schrieb Elvis Stansvik:

And just to chime in, you would do that by running with
QT_QPA_PLATFORM=offscreen.

Elvis


thanks
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] ASAN (Qt 6.4 + Glib) build shows stackoverflow in trivial Qt program

2022-11-12 Thread Dennis Luehring

Am 12.11.2022 um 18:07 schrieb Thiago Macieira:

On Friday, 11 November 2022 23:54:24 PST Dennis Luehring wrote:
>../qt6/qtbase/configure -debug -opensource [...]
># ==> https://pastebin.com/JDm0p80b  qt6_configure.txt

You've only built qtbase. That means you have no Wayland client plugin.


ok, Wayland isn't needed now - so its ok, but a window would be nice :)



The configure output is confusing. It says "yes" for a bunch of X11 things, but
the "XCB" section only has "no":
>   XCB:
> Using system-provided xcb-xinput . no
> GL integrations:
>   GLX Plugin . no
> XCB GLX .. no
>   EGL-X11 Plugin . no

Though none of them are about XCB itself, one would conclude it is enabled.
The hint here that GLX wasn't enabled.


i don't know how - is there something to force glx
so im getting an configure error for missing dependencies?

forcing -xcb gives me these configure output (https://pastebin.com/ML8QCJRQ)

  XCB:
    Using system-provided xcb-xinput . no
    GL integrations:
  GLX Plugin . yes
    XCB GLX .. yes
  EGL-X11 Plugin . yes

but also configure fails with

ERROR: Feature "xcb": Forcing to "ON" breaks its condition:
    QT_FEATURE_thread AND TARGET XCB::XCB AND TEST_xcb_syslibs AND
QT_FEATURE_xkbcommon_x11


i've double checked every required package that is needed and can't find
a missing package


installed glx packages:

linux@linux-virtual-machine:~$ apt list --installed | grep glx

WARNING: apt does not have a stable CLI interface. Use with caution in
scripts.

libgl1-mesa-glx/jammy-updates,now 22.0.5-0ubuntu0.1 amd64 [installed]
libglx-dev/jammy,now 1.4.0-1 amd64 [installed]
libglx-mesa0/jammy-updates,now 22.0.5-0ubuntu0.1 amd64 [installed]
libglx0/jammy,now 1.4.0-1 amd64 [installed]
libxcb-glx0-dev/jammy,now 1.14-3ubuntu3 amd64 [installed]
libxcb-glx0/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic]


also glxgears is working


installed mesa packages:

linux@linux-virtual-machine:~$ apt list --installed | grep mesa

WARNING: apt does not have a stable CLI interface. Use with caution in
scripts.

libegl-mesa0/jammy-updates,now 22.0.5-0ubuntu0.1 amd64 [installed,automatic]
libegl1-mesa-dev/jammy-updates,now 22.0.5-0ubuntu0.1 amd64
[installed,automatic]
libgl1-mesa-dev/jammy-updates,now 22.0.5-0ubuntu0.1 amd64 [installed]
libgl1-mesa-dri/jammy-updates,now 22.0.5-0ubuntu0.1 amd64 [installed]
libgl1-mesa-glx/jammy-updates,now 22.0.5-0ubuntu0.1 amd64 [installed]
libglapi-mesa/jammy-updates,now 22.0.5-0ubuntu0.1 amd64
[installed,automatic]
libglu1-mesa-dev/jammy,now 9.0.2-1 amd64 [installed]
libglu1-mesa/jammy,now 9.0.2-1 amd64 [installed,automatic]
libglx-mesa0/jammy-updates,now 22.0.5-0ubuntu0.1 amd64 [installed]
mesa-common-dev/jammy-updates,now 22.0.5-0ubuntu0.1 amd64 [installed]
mesa-utils-bin/jammy,now 8.4.0-1ubuntu1 amd64 [installed,automatic]
mesa-utils/jammy,now 8.4.0-1ubuntu1 amd64 [installed]
mesa-vulkan-drivers/jammy-updates,now 22.0.5-0ubuntu0.1 amd64
[installed,automatic]

installed xcb packages:

linux@linux-virtual-machine:~$ apt list --installed | grep xcb

WARNING: apt does not have a stable CLI interface. Use with caution in
scripts.

libx11-xcb-dev/jammy,now 2:1.7.5-1 amd64 [installed]
libx11-xcb1/jammy,now 2:1.7.5-1 amd64 [installed,automatic]
libxcb-dri2-0/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic]
libxcb-dri3-0/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic]
libxcb-glx0-dev/jammy,now 1.14-3ubuntu3 amd64 [installed]
libxcb-glx0/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic]
libxcb-icccm4-dev/jammy,now 0.4.1-1.1build2 amd64 [installed]
libxcb-icccm4/jammy,now 0.4.1-1.1build2 amd64 [installed,automatic]
libxcb-image0-dev/jammy,now 0.4.0-2 amd64 [installed]
libxcb-image0/jammy,now 0.4.0-2 amd64 [installed]
libxcb-keysyms1-dev/jammy,now 0.4.0-1build3 amd64 [installed]
libxcb-keysyms1/jammy,now 0.4.0-1build3 amd64 [installed,automatic]
libxcb-present0/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic]
libxcb-randr0-dev/jammy,now 1.14-3ubuntu3 amd64 [installed]
libxcb-randr0/jammy,now 1.14-3ubuntu3 amd64 [installed]
libxcb-render-util0-dev/jammy,now 0.3.9-1build3 amd64 [installed]
libxcb-render-util0/jammy,now 0.3.9-1build3 amd64 [installed,automatic]
libxcb-render0-dev/jammy,now 1.14-3ubuntu3 amd64 [installed]
libxcb-render0/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic]
libxcb-res0/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic]
libxcb-shape0-dev/jammy,now 1.14-3ubuntu3 amd64 [installed]
libxcb-shape0/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic]
libxcb-shm0-dev/jammy,now 1.14-3ubuntu3 amd64 [installed]
libxcb-shm0/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic]
libxcb-sync-dev/jammy,now 1.14-3ubuntu3 amd64 [installed]
libxcb-sync1/jammy,now 1.14-3ubuntu3 amd64 [installed,automatic]
libxcb-util-dev/jammy,now 0.4.0-1build2 amd64 [installed]

Re: [Interest] ASAN (Qt 6.4 + Glib) build shows stackoverflow in trivial Qt program

2022-11-12 Thread Elvis Stansvik
Den lör 12 nov. 2022 kl 18:08 skrev Thiago Macieira :
>
> On Friday, 11 November 2022 23:54:24 PST Dennis Luehring wrote:
> >../qt6/qtbase/configure -debug -opensource [...]
> ># ==> https://pastebin.com/JDm0p80b  qt6_configure.txt
>
> You've only built qtbase. That means you have no Wayland client plugin.
>
> The configure output is confusing. It says "yes" for a bunch of X11 things, 
> but
> the "XCB" section only has "no":
> >   XCB:
> > Using system-provided xcb-xinput . no
> > GL integrations:
> >   GLX Plugin . no
> > XCB GLX .. no
> >   EGL-X11 Plugin . no
>
> Though none of them are about XCB itself, one would conclude it is enabled.
> The hint here that GLX wasn't enabled.
>
> In any case, the XCB plugin didn't get built:
>
> > linux@linux-virtual-machine:~/qt6_dev/qt6-build/plugins/platforms$ ls
> > libqeglfs.so  libqlinuxfb.so  libqminimalegl.so  libqminimal.so
> > libqoffscreen.so  libqvkkhrdisplay.so  libqvnc.so
>
> So this build has no XCB or Wayland, that's why you can't start applications.
> If you just want to test an application that starts and ends, you can use the
> offscreen one.

And just to chime in, you would do that by running with
QT_QPA_PLATFORM=offscreen.

Elvis

>
>
> --
> Thiago Macieira - thiago.macieira (AT) intel.com
>   Cloud Software Architect - Intel DCAI Cloud Engineering
>
>
>
> ___
> Interest mailing list
> Interest@qt-project.org
> https://lists.qt-project.org/listinfo/interest
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] ASAN (Qt 6.4 + Glib) build shows stackoverflow in trivial Qt program

2022-11-12 Thread Thiago Macieira
On Friday, 11 November 2022 23:54:24 PST Dennis Luehring wrote:
>../qt6/qtbase/configure -debug -opensource [...]
># ==> https://pastebin.com/JDm0p80b  qt6_configure.txt

You've only built qtbase. That means you have no Wayland client plugin.

The configure output is confusing. It says "yes" for a bunch of X11 things, but 
the "XCB" section only has "no":
>   XCB:
> Using system-provided xcb-xinput . no
> GL integrations:
>   GLX Plugin . no
> XCB GLX .. no
>   EGL-X11 Plugin . no

Though none of them are about XCB itself, one would conclude it is enabled. 
The hint here that GLX wasn't enabled.

In any case, the XCB plugin didn't get built:

> linux@linux-virtual-machine:~/qt6_dev/qt6-build/plugins/platforms$ ls
> libqeglfs.so  libqlinuxfb.so  libqminimalegl.so  libqminimal.so
> libqoffscreen.so  libqvkkhrdisplay.so  libqvnc.so

So this build has no XCB or Wayland, that's why you can't start applications. 
If you just want to test an application that starts and ends, you can use the 
offscreen one.
 

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Cloud Software Architect - Intel DCAI Cloud Engineering



___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] ASAN (Qt 6.4 + Glib) build shows stackoverflow in trivial Qt program

2022-11-11 Thread Dennis Luehring

Am 11.11.2022 um 18:01 schrieb Thiago Macieira:

On Thursday, 10 November 2022 23:50:50 PST Dennis Luehring wrote:
> give a wayland plugin not found message and then hangs forever :/

Run with QT_DEBUG_PLUGINS=1 and see why the plugin won't load.



i switched to git/dev - because i will switch to 6.5 in the future when
in comes available and i think its easier to follow your advices

and i also did a clean Ubuntu 22.04 Setup + Qt-Installer install + Qt
git/dev build using these steps

Ubuntu default install on VM
  sudo apt install build-essential libasan6 llvm clang libclang-dev
cmake ninja-build git
  sudo apt-get build-dep qtbase5-dev
  sudo apt install libmd4c-html0-dev
  sudo apt install mesa-utils libglu1-mesa-dev freeglut3-dev
mesa-common-dev
  sudo apt install libglew-dev libglfw3-dev libglm-dev
  sudo apt install libao-dev libmpg123-dev
  sudo apt update
  sudo apt upgrade

Qt-Installer install (just as a reference to compare to)
  download qt-unified-linux-x64-4.5.0-online.run
  chmod +x qt-unified-linux-x64-4.5.0-online.run
  ./qt-unified-linux-x64-4.5.0-online.run
  default installs Qt 6.4 in /home/linux/Qt/6.4

build Qt dev
  mkdir ~/qt6_dev
  cd ~/qt6_dev
  git clone git://code.qt.io/qt/qt5.git qt6
  cd qt6
  git checkout dev
  perl init-repository
  cd ..
  mkdir qt6-build
  cd qt6-build
  ../qt6/qtbase/configure -debug -opensource -nomake examples -nomake
tests -prefix ~/qt6_dev/qt6-install > ../qt6_configure.txt 2>&1
  # ==> https://pastebin.com/JDm0p80b  qt6_configure.txt
  cmake --build . --parallel 4
  cmake --install .

then a simple (called qt_tsan_tests_dev but its just a simple main)

  QApplication app( argc, argv );
  QWidget window;
  window.resize( 320, 240 );
  window.show();
  return app.exec();

the build folder of my example does not contain any platform/plugins
etc. folder

the platform folder of my Qt dev build contains these plugins

linux@linux-virtual-machine:~/qt6_dev/qt6-build/plugins/platforms$ ls
libqeglfs.so  libqlinuxfb.so  libqminimalegl.so  libqminimal.so
libqoffscreen.so  libqvkkhrdisplay.so  libqvnc.so

the Qt-Installer 6.4 installation contains these plugins

linux@linux-virtual-machine:~/Qt/6.4.0/gcc_64/plugins/platforms$ ls
  libqeglfs.so libqwayland-egl.so  qoffscreen.debug
  libqlinuxfb.so   libqwayland-generic.so  qvkkhrdisplay.debug
  libqminimalegl.so    libqxcb.so  qvnc.debug
  libqminimal.so   qeglfs.debug    qwayland-egl.debug
  libqoffscreen.so qlinuxfb.debug qwayland-generic.debug
  libqvkkhrdisplay.so  qminimal.debug  qxcb.debug
  libqvnc.so   qminimalegl.debug

both started with QT_DEBUG_PLUGINS=1

the Qt-Installer 6.4 version works out of the box
https://pastebin.com/u0GSqUJR

and the dev build seems to not find the plugins and aborts
https://pastebin.com/RfvsATKz

this is the crash point in QtCreator using my Qt dev build
https://imgur.com/a/PjT8Yqq

setting

QT_QPA_PLATFORM_PLUGIN_PATH=~/qt6_dev/qt6-build/plugins/platforms
./qt_tsan_tests

did not help

and i don't understand why the Qt-Installer version got more platforms
available then my git/dev build?
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] ASAN (Qt 6.4 + Glib) build shows stackoverflow in trivial Qt program

2022-11-11 Thread Thiago Macieira
On Thursday, 10 November 2022 23:50:50 PST Dennis Luehring wrote:
> give a wayland plugin not found message and then hangs forever :/

Run with QT_DEBUG_PLUGINS=1 and see why the plugin won't load.

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Cloud Software Architect - Intel DCAI Cloud Engineering



___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] ASAN (Qt 6.4 + Glib) build shows stackoverflow in trivial Qt program

2022-11-11 Thread Dennis Luehring

Am 10.11.2022 um 20:40 schrieb Thiago Macieira:

Fixed in https://codereview.qt-project.org/c/qt/qtbase/+/442720



next problem: i've did patch my source with your fix but now the
application isn't starting
first that its because of ASAN but also a vanilla build of Glib and Qt
gives the same hanging


its somewhere here


https://imgur.com/a/VFAss3D


no idea how to get further


Glib and Qt cleanly build without ASAN/TSAN (they i've showed here
several times) + main with a single QApplication app(...); return
app.exec();
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] ASAN (Qt 6.4 + Glib) build shows stackoverflow in trivial Qt program

2022-11-10 Thread Dennis Luehring

Am 10.11.2022 um 20:40 schrieb Thiago Macieira:

Fixed in https://codereview.qt-project.org/c/qt/qtbase/+/442720



patched you fix into my 6.4 source - but the resulting application just
won't start
give a wayland plugin not found message and then hangs forever :/
___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] ASAN (Qt 6.4 + Glib) build shows stackoverflow in trivial Qt program

2022-11-10 Thread Dennis Luehring

Am 10.11.2022 um 20:40 schrieb Thiago Macieira:

Which uses this macro:
https://gitlab.gnome.org/GNOME/glib/-/blob/2.72.1/gobject/
gvaluecollector.h#L213-252

There's no support in it for boolean (1-byte) properties. The problem is that
f*&*!)ing Glib is written in C and refuses to use bool. They have:

typedef intgint;
typedef gint   gboolean;

So their boolean is a 4-byte type.

Fixed in https://codereview.qt-project.org/c/qt/qtbase/+/442720



thanks for the fix, i check how far i get with this


but i would think that a ASAN build of Glib wouldn't be that bad in the
ASAN CI-config, if the server isn't exploding already :)

___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


Re: [Interest] ASAN (Qt 6.4 + Glib) build shows stackoverflow in trivial Qt program

2022-11-10 Thread Thiago Macieira
On Thursday, 10 November 2022 00:23:52 PST Dennis Luehring wrote:
>  #1 0x7f08b15289a1 in g_object_get_valist ../glib/gobject/gobject.c:2659
>  #2 0x7f08b1529029 in g_object_get ../glib/gobject/gobject.c:2754
>  #3 0x7f08b3eee24b in gtkSetting

template 
static T gtkSetting(const gchar *propertyName)
{
GtkSettings *settings = gtk_settings_get_default();
T value;
g_object_get(settings, propertyName, , NULL);
return value;
}

The GLib line is:

  G_VALUE_LCOPY (, var_args, 0, );

Which uses this macro:
https://gitlab.gnome.org/GNOME/glib/-/blob/2.72.1/gobject/
gvaluecollector.h#L213-252

There's no support in it for boolean (1-byte) properties. The problem is that 
f*&*!)ing Glib is written in C and refuses to use bool. They have:

typedef intgint;
typedef gint   gboolean;

So their boolean is a 4-byte type.

Fixed in https://codereview.qt-project.org/c/qt/qtbase/+/442720

-- 
Thiago Macieira - thiago.macieira (AT) intel.com
  Cloud Software Architect - Intel DCAI Cloud Engineering



___
Interest mailing list
Interest@qt-project.org
https://lists.qt-project.org/listinfo/interest


[Interest] ASAN (Qt 6.4 + Glib) build shows stackoverflow in trivial Qt program

2022-11-10 Thread Dennis Luehring

so i tried using TSAN with my own build Glib and Qt, but it directly
crashes with a

System: Ubuntu 22.04 - Glib is the same version as the systems Glib from
the Glib git, Qt is 6.4 tag from git


*** stack smashing detected ***: terminated

without any other message

my test application is just

int main( int argc, char* argv[] )
{
  QApplication app( argc, argv );
  return app.exec();
}

so i re-build Glib and Qt with ASAN first to get a clue what the problem is

mkdir ~/qt6_dev

# 1. build Glib with --prefix
cd ~/qt6_dev
git clone https://gitlab.gnome.org/GNOME/glib.git
cd glib
git checkout 2.72.1
cd ..
mkdir glib-build
cd glib-build
meson setup ../glib -Dbuildtype=debug -Db_sanitize=address --prefix
~/qt6_dev/glib-install
meson compile
meson install

# 2. build Qt with ASAN + PKG_CONFIG_PATH set to the ASAN GLib build

cd ~/qt6_dev
git clone git://code.qt.io/qt/qt5.git qt6
cd qt6
git checkout v6.4.0
perl init-repository
cd ..
mkdir qt6-build
cd qt6-build
PKG_CONFIG_PATH=~/qt6_dev/glib-install/lib/x86_64-linux-gnu/pkgconfig
../qt6/qtbase/configure -debug -opensource -nomake examples -nomake
tests -sanitize address
cmake --build . --parallel 2

results in

https://pastebin.com/KiUqxEe9

linux@linux-virtual-machine:~/dev/test/qt_tsan_tests_dev/_build_gcc$
./qt_tsan_tests
qt.qpa.plugin: Could not find the Qt platform plugin "wayland" in ""
=
==72389==ERROR: AddressSanitizer: stack-buffer-overflow on address
0x7ffe033c3af0 at pc 0x7f08b158106e bp 0x7ffe033c3770 sp 0x7ffe033c3760
WRITE of size 4 at 0x7ffe033c3af0 thread T0
    #0 0x7f08b158106d in value_lcopy_boolean
../glib/gobject/gvaluetypes.c:76
    #1 0x7f08b15289a1 in g_object_get_valist ../glib/gobject/gobject.c:2659
    #2 0x7f08b1529029 in g_object_get ../glib/gobject/gobject.c:2754
    #3 0x7f08b3eee24b in gtkSetting
/home/linux/qt6_dev/qt6/qtbase/src/plugins/platformthemes/gtk3/qgtk3theme.cpp:30
    #4 0x7f08b3eef12b in QGtk3Theme::appearance() const
/home/linux/qt6_dev/qt6/qtbase/src/plugins/platformthemes/gtk3/qgtk3theme.cpp:179
    #5 0x7f08bc0c5d6c in qt_fusionPalette()
/home/linux/qt6_dev/qt6/qtbase/src/gui/kernel/qplatformtheme.cpp:349
    #6 0x7f08bc0c727a in
QPlatformThemePrivate::initializeSystemPalette()
/home/linux/qt6_dev/qt6/qtbase/src/gui/kernel/qplatformtheme.cpp:399
    #7 0x7f08bc0c7356 in
QPlatformTheme::palette(QPlatformTheme::Palette) const
/home/linux/qt6_dev/qt6/qtbase/src/gui/kernel/qplatformtheme.cpp:439
    #8 0x7f08bdbb9a16 in QApplicationPrivate::basePalette() const
/home/linux/qt6_dev/qt6/qtbase/src/widgets/kernel/qapplication.cpp:1065
    #9 0x7f08bbf89e2c in QGuiApplicationPrivate::setPalette(QPalette
const&)
/home/linux/qt6_dev/qt6/qtbase/src/gui/kernel/qguiapplication.cpp:3372
    #10 0x7f08bbf8a161 in QGuiApplicationPrivate::updatePalette()
/home/linux/qt6_dev/qt6/qtbase/src/gui/kernel/qguiapplication.cpp:3344
    #11 0x7f08bbfb01bf in QGuiApplicationPrivate::init()
/home/linux/qt6_dev/qt6/qtbase/src/gui/kernel/qguiapplication.cpp:1603
    #12 0x7f08bdbd9d3c in QApplicationPrivate::init()
/home/linux/qt6_dev/qt6/qtbase/src/widgets/kernel/qapplication.cpp:462
    #13 0x7f08bdbd9ebc in QApplication::QApplication(int&, char**, int)
/home/linux/qt6_dev/qt6/qtbase/src/widgets/kernel/qapplication.cpp:450
    #14 0x5648a1e8f9d8 in main
/home/linux/dev/test/qt_tsan_tests_dev/qt_tsan_tests/main.cpp:8
    #15 0x7f08ba2e6d8f in __libc_start_call_main
../sysdeps/nptl/libc_start_call_main.h:58
    #16 0x7f08ba2e6e3f in __libc_start_main_impl ../csu/libc-start.c:392
    #17 0x5648a1e8e3c4 in _start
(/home/linux/dev/test/qt_tsan_tests_dev/_build_gcc/qt_tsan_tests+0x43c4)

Address 0x7ffe033c3af0 is located in stack of thread T0 at offset 32 in
frame
    #0 0x7f08b3eee1c0 in gtkSetting
/home/linux/qt6_dev/qt6/qtbase/src/plugins/platformthemes/gtk3/qgtk3theme.cpp:26

  This frame has 1 object(s):
    [32, 33) 'value' (line 29) <== Memory access at offset 32 partially
overflows this variable
HINT: this may be a false positive if your program uses some custom
stack unwind mechanism, swapcontext or vfork
  (longjmp and C++ exceptions *are* supported)
SUMMARY: AddressSanitizer: stack-buffer-overflow
../glib/gobject/gvaluetypes.c:76 in value_lcopy_boolean
Shadow bytes around the buggy address:
  0x100040670700: 00 00 00 00 f1 f1 f1 f1 00 f2 f2 f2 00 00 00 f2
  0x100040670710: f2 f2 f2 f2 00 00 00 00 00 00 00 00 f3 f3 f3 f3
  0x100040670720: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 f1 f1
  0x100040670730: f1 f1 00 00 00 f3 f3 f3 f3 f3 00 00 00 00 00 00
  0x100040670740: 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00
=>0x100040670750: 00 00 00 00 00 00 00 00 00 00 f1 f1 f1 f1[01]f3
  0x100040670760: f3 f3 00 00 00 00 00 00 00 00 00 00 00 00 00 00
  0x100040670770: f1 f1 f1 f1 f1 f1 f8 f2 04 f2 04 f2 00 f2 f2 f2
  0x100040670780: 00 f2 f2 f2 00 f2 f2 f2 00 00 00 f2 f2 f2 f2 f2
  0x100040670790: f8 f8 f8 f2 f2 f2 f2 f2 f8 f8 f8 f2 f2 f2 f2 f2
  0x1000406707a0: 00 00 00