Bug#1042018: qt6-declarative: FTBFS on hppa - Segmentation fault in /usr/lib/qt6/bin/qsb

2023-07-28 Thread Lisandro Damián Nicanor Pérez Meyer
reassign 1042018 src:qt6-base 6.4.2+dfsg-1
thanks


signature.asc
Description: This is a digitally signed message part.


Bug#1042018: qt6-declarative: FTBFS on hppa - Segmentation fault in /usr/lib/qt6/bin/qsb

2023-07-28 Thread Lisandro Damián Nicanor Pérez Meyer
El viernes, 28 de julio de 2023 08:52:37 -03 John David Anglin escribió:
> On 2023-07-25 4:29 p.m., Patrick Franz wrote:
> > Due to the lack of resources, it's unlikely we'll even investigate this.
> > However, if you have a patch, I'm happy to apply it.
> The attached change fixes the reported segmentation fault in qsb. The change 
> is to
> src/3rdparty/forkfd/forkfd_linux.c in the qt6-base package. The problem is 
> the system_vforkfd
> routine assumes the stack direction is down, but on hppa the stack grows up. 
> This causes
> the childFn argument to be clobbered on the stack and the segmentation fault.
> 
> With this change to qt6-base, qt6-declarative builds successfully on hppa.  I 
> believe it will also fix the
> qt6-multimedia build as it appears to fail for the same reason.
> 
> Somehow, we need to get this installed in the 3rdparty forkfd source so all 
> packages that use it
> are fixed.
> 
> Regards,
> Dave Anglin

I'll be happy to apply this one.


signature.asc
Description: This is a digitally signed message part.


Bug#1042018: qt6-declarative: FTBFS on hppa - Segmentation fault in /usr/lib/qt6/bin/qsb

2023-07-28 Thread John David Anglin

On 2023-07-25 4:29 p.m., Patrick Franz wrote:

Due to the lack of resources, it's unlikely we'll even investigate this.
However, if you have a patch, I'm happy to apply it.

The attached change fixes the reported segmentation fault in qsb. The change is 
to
src/3rdparty/forkfd/forkfd_linux.c in the qt6-base package. The problem is the 
system_vforkfd
routine assumes the stack direction is down, but on hppa the stack grows up. 
This causes
the childFn argument to be clobbered on the stack and the segmentation fault.

With this change to qt6-base, qt6-declarative builds successfully on hppa.  I 
believe it will also fix the
qt6-multimedia build as it appears to fail for the same reason.

Somehow, we need to get this installed in the 3rdparty forkfd source so all 
packages that use it
are fixed.

Regards,
Dave Anglin

--
John David Anglin  dave.ang...@bell.net
--- ./src/3rdparty/forkfd/forkfd_linux.c.save   2023-07-27 12:04:02.940466337 
+
+++ ./src/3rdparty/forkfd/forkfd_linux.c2023-07-27 12:06:53.522077424 
+
@@ -168,7 +168,12 @@
 }
 *system = 1;
 
+#if defined(__hppa__)
+/* Stack grows up */
+pid = clone(childFn, childStack, cloneflags, token, , NULL, NULL);
+#else
 pid = clone(childFn, childStack + sizeof(childStack), cloneflags, token, 
, NULL, NULL);
+#endif
 if (pid < 0)
 return pid;
 if (ppid)


Bug#1042018: qt6-declarative: FTBFS on hppa - Segmentation fault in /usr/lib/qt6/bin/qsb

2023-07-25 Thread Patrick Franz
severity -1 normal
thanks

Hi,

since hppa is not an officially supported architecture, I'm downgrading 
the severity.

Due to the lack of resources, it's unlikely we'll even investigate this. 
However, if you have a patch, I'm happy to apply it.


-- 
Med vänliga hälsningar

Patrick Franz



Bug#1042018: qt6-declarative: FTBFS on hppa - Segmentation fault in /usr/lib/qt6/bin/qsb

2023-07-25 Thread John David Anglin
Source: qt6-declarative
Version: 6.4.2+dfsg-3
Severity: serious
Tags: ftbfs
Justification: fails to build from source (but built successfully in the past)

Dear Maintainer,

Build fails here:
[22/6600] cd /<>/obj-hppa-linux-gnu/src/quick && 
/usr/lib/qt6/bin/qsb --glsl 100es,120,150 --hlsl 50 --msl 12 -b -O -s -o 
/<>/obj-hppa-linux-gnu/src/quick/.qsb/scenegraph/shaders_ng/24bittextmask.frag.qsb
 /<>/src/quick/scenegraph/shaders_ng/24bittextmask.frag
FAILED: src/quick/.qsb/scenegraph/shaders_ng/24bittextmask.frag.qsb 
/<>/obj-hppa-linux-gnu/src/quick/.qsb/scenegraph/shaders_ng/24bittextmask.frag.qsb
 
cd /<>/obj-hppa-linux-gnu/src/quick && /usr/lib/qt6/bin/qsb --glsl 
100es,120,150 --hlsl 50 --msl 12 -b -O -s -o 
/<>/obj-hppa-linux-gnu/src/quick/.qsb/scenegraph/shaders_ng/24bittextmask.frag.qsb
 /<>/src/quick/scenegraph/shaders_ng/24bittextmask.frag
Segmentation fault (core dumped)

See:
https://buildd.debian.org/status/fetch.php?pkg=qt6-declarative=hppa=6.4.2%2Bdfsg-3=1690289443=0

dave@mx3210:~/debian/qt6-declarative/qt6-declarative-6.4.2+dfsg/obj-hppa-linux-g
nu/src/quick$ gdb /usr/lib/qt6/bin/qsb
GNU gdb (Debian 13.2-1) 13.2
Copyright (C) 2023 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later 
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Type "show copying" and "show warranty" for details.
This GDB was configured as "hppa-linux-gnu".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
.
Find the GDB manual and other documentation resources online at:
.

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from /usr/lib/qt6/bin/qsb...
Reading symbols from 
/usr/lib/debug/.build-id/2d/3c434ee4acf266d2dc6fd1ff1289e07e4fd07c.debug...
(gdb) set args --glsl 100es,120,150 --hlsl 50 --msl 12 -b -O -s -o 
/home/dave/debian/qt6-declarative/qt6-declarative-6.4.2+dfsg/obj-hppa-linux-gnu/src/quick/.qsb/scenegraph/shaders_ng/24bittextmask.frag.qsb
 
/home/dave/debian/qt6-declarative/qt6-declarative-6.4.2+dfsg/src/quick/scenegraph/shaders_ng/24bittextmask.frag
(gdb) r
Starting program: /usr/lib/qt6/bin/qsb --glsl 100es,120,150 --hlsl 50 --msl 12 
-b -O -s -o 
/home/dave/debian/qt6-declarative/qt6-declarative-6.4.2+dfsg/obj-hppa-linux-gnu/src/quick/.qsb/scenegraph/shaders_ng/24bittextmask.frag.qsb
 
/home/dave/debian/qt6-declarative/qt6-declarative-6.4.2+dfsg/src/quick/scenegraph/shaders_ng/24bittextmask.frag
warning: Unable to find libthread_db matching inferior's thread library, thread 
debugging will not be available.
[Detaching after vfork from child process 24823]

Program received signal SIGSEGV, Segmentation fault.
0xf8af656c in vforkfd (flags=1,
childFn=0xf8aec7d4 
, token=0xf8f02888, ppid=0xf8f028f0)
at ./src/corelib/io/../../3rdparty/forkfd/forkfd.c:815
815 ./src/corelib/io/../../3rdparty/forkfd/forkfd.c: No such file or 
directory.
(gdb) bt
#0  0xf8af656c in vforkfd (flags=1,
childFn=0xf8aec7d4 
, token=0xf8f02888, ppid=0xf8f028f0)
at ./src/corelib/io/../../3rdparty/forkfd/forkfd.c:815
#1  QProcessPrivate::startProcess (this=0x91c80)
at ./src/corelib/io/qprocess_unix.cpp:472
#2  QProcessPrivate::start (this=0x91c80, mode=...)
at ./src/corelib/io/qprocess.cpp:2163
#3  0x0001bc20 in runProcess (binary=..., arguments=..., output=0xf8f02888,
errorOutput=0x5112) at /usr/include/hppa-linux-gnu/qt6/QtCore/qflags.h:74
#4  0x00016884 in main (argc=, argv=)
at ./tools/qsb/qsb.cpp:661
(gdb) disass $pc-16,$pc+16
Dump of assembler code from 0xf8af655c to 0xf8af657c:
   0xf8af655c 
<_ZN15QProcessPrivate5startE6QFlagsIN13QIODeviceBase12OpenModeFlagEE+708>:  
  copy r21,r26
   0xf8af6560 
<_ZN15QProcessPrivate5startE6QFlagsIN13QIODeviceBase12OpenModeFlagEE+712>:  
  b,l 0xf8ad428c,rp
   0xf8af6564 
<_ZN15QProcessPrivate5startE6QFlagsIN13QIODeviceBase12OpenModeFlagEE+716>:  
  stw r21,-c4(sp)
   0xf8af6568 
<_ZN15QProcessPrivate5startE6QFlagsIN13QIODeviceBase12OpenModeFlagEE+720>:  
  copy r4,r19
=> 0xf8af656c 
<_ZN15QProcessPrivate5startE6QFlagsIN13QIODeviceBase12OpenModeFlagEE+724>:  
  ldw 0(r8),r20
   0xf8af6570 
<_ZN15QProcessPrivate5startE6QFlagsIN13QIODeviceBase12OpenModeFlagEE+728>:  
  cmpib,<> 0,r20,0xf8af6aa0 
<_ZN15QProcessPrivate5startE6QFlagsIN13QIODeviceBase12OpenModeFlagEE+2056>
   0xf8af6574 
<_ZN15QProcessPrivate5startE6QFlagsIN13QIODeviceBase12OpenModeFlagEE+732>:  
  copy ret0,r3
   0xf8af6578 
<_ZN15QProcessPrivate5startE6QFlagsIN13QIODeviceBase12OpenModeFlagEE+736>:  
  addil L%d000,r19,r1
End of assembler dump.
(gdb) p/x $r8
$1 = 0x5112

r8 is misaligned for ldw instruction but this didn't cause fault.

(gdb) x/x 0x5110
0x5110: Cannot access memory at address 0x5110

Regards,
Dave Anglin

-- System Information:
Debian