Bug#1055750: gfortran: [armhf] Yield SIGBUS when compiling with -fstack-clash-protection

2023-11-15 Thread Rafael Laboissière

* Emanuele Rocca  [2023-11-14 12:01]:


On 2023-11-13 05:13, Rafael Laboissière wrote:

The attached file bug-1055750.tgz contains a minimal code that
triggers the bug on an armhf system


Thanks! For the record I can reproduce the issue in a armhf chroot, but 
*not* on armel and arm64. The only thing to change in the reproducer is 
the -I argument to gfortran:


 armhf: /usr/lib/arm-linux-gnueabihf
 armel: /usr/lib/arm-linux-gnueabi
 arm64: /usr/lib/aarch64-linux-gnu

I'll see if I can find out more.


Thanks for the followup, Emanuele.

I have investigated the issue a little bit deeper. Please, find here 
attached a new tarball with a simplified version of the x09f.f90 file, 
that still triggers the bug. Running the resulting executable with gbd, 
yields the following:


(gdb) run -dev ps -o /dev/null
Starting program: /home/rafael/bug-1055750/x09f -dev ps -o /dev/null
[Thread debugging using libthread_db enabled]
Using host libthread_db library 
"/lib/arm-linux-gnueabihf/libthread_db.so.1".

Program received signal SIGSEGV, Segmentation fault.
x09f::mypltr2 (x=0, y=1, xt=0, yt=7.300765e-43) at x09f.f90:48
48  yt = tr(1)

In this new code, there are two private functions mypltr1 and mypltr2. 
The bug only happens when the latter is invoked, in which a value coming 
from the global variable tr is assigned to yt. In mypltr1, the assignment 
is done to xt, instead of yt, and no segfault is triggered.


Best,

Rafael Laboissière


bug-1055750.tgz
Description: application/gtar-compressed


Bug#1055750: gfortran: [armhf] Yield SIGBUS when compiling with -fstack-clash-protection

2023-11-15 Thread Rafael Laboissière

* Rafael Laboissière  [2023-11-15 18:06]:

I have investigated the issue a little bit deeper. Please, find here 
attached a new tarball with a simplified version of the x09f.f90 file, 
that still triggers the bug. Running the resulting executable with 
gbd, yields the following:


Oops, with the correct tarball this time.

Best,

Rafael Laboissière


bug-1055750.tgz
Description: application/gtar-compressed


Bug#1055750: gfortran: [armhf] Yield SIGBUS when compiling with -fstack-clash-protection

2023-11-15 Thread Rafael Laboissière

* Rafael Laboissière  [2023-11-15 18:37]:


* Rafael Laboissière  [2023-11-15 18:06]:

I have investigated the issue a little bit deeper. Please, find here 
attached a new tarball with a simplified version of the x09f.f90 
file, that still triggers the bug. Running the resulting executable 
with gbd, yields the following:


Oops, with the correct tarball this time.


Grrr, with the correct one now, hopefully!

R.


bug-1055750.tgz
Description: application/gtar-compressed


Bug#1055750: Bug#1055228: plplot: FTBFS on armhf (test segfault)

2023-11-15 Thread Rafael Laboissière

Hi Emanuele,

Our messages crossed.

* Emanuele Rocca  [2023-11-15 18:20]:


On 2023-11-09 05:11, Rafael Laboissière wrote:

The Fortran example x09f.f90, which is exercised during the building of
plplot, now fails on armhf, due to the use of the compiler option
-fstack-clash-protection.


The problem seems unrelated to stach-clash-protection I think, enabling 
the feature on armhf just made it evident.


Building the program on a x86 system without -fstack-clash-protection 
but with -fsanitize=address, it segfaults:


/usr/bin/gfortran -g -O2 x09f.f90 -o x09f -I/usr/lib/x86_64-linux-gnu/fortran/modules/plplot -lplplotfortran -fsanitize=address 
./x09f -dev ps -o /dev/null


Program received signal SIGSEGV: Segmentation fault - invalid memory reference.

The SIGSEGV happens in plplot_single::pltransformf2c, which is about 
where the SIGBUS happens on armhf with stack-clash-protector enabled:


 Program received signal SIGSEGV, Segmentation fault.
 0x75a000a8 in ?? ()
 (gdb) bt
 #0  0x75a000a8 in ?? ()
 #1  0x77f05683 in plplot_single::pltransformf2c (x=x@entry=0, 
y=y@entry=1, tx=4.9406564584124654e-324,
 ty=6.9533558054215925e-310, data=)
 at ./bindings/fortran/plplot_single.f90:114

Here's the SIGBUS on armhf with stack-clash-protection:

 Program received signal SIGBUS, Bus error.
 0x00400822 in x09f::mypltr (x=0, y=1, xt=0, yt=0) at x09f.f90:38
 38  xt = tr(1) * x + tr(2) * y + tr(3)
 (gdb) bt
 #0  0x00400822 in x09f::mypltr (x=0, y=1, xt=0, yt=0) at x09f.f90:38
 #1  0xf7f58a06 in plplot_single::pltransformf2c (x=, y=, tx=-9.8841854819221187e+269,
 ty=-nan(0xe5db40001), data=) at 
./bindings/fortran/plplot_single.f90:114


Does this mean that the origin of the bug is upstream or that it still 
may be a bug in gfortran?


Best,

Rafael Laboissière



Bug#1055750: Bug#1055228: plplot: FTBFS on armhf (test segfault)

2023-11-15 Thread Emanuele Rocca
Hello Rafael!

On 2023-11-15 06:47, Rafael Laboissière wrote:
> Does this mean that the origin of the bug is upstream or that it still may
> be a bug in gfortran?

At this point we know for sure that the issue is not armhf-specific, and
also that it is not caused by stack-clash-protection. On the contrary,
enabling stack-clash-protection on armhf allowed us to discover a
problem that would have otherwise gone unnoticed.

Whether the bug is in plplot or gfortran I really have no idea. I would
tend not to think of a compiler issue unless we have some evidence in
that direction though, and suggest raising the issue with plplot
upstream. Showing them the x86 reproducer with -fsanitize=address should
be a good starting point.

Thanks,
  Emanuele



Bug#1055750: Bug#1055228: plplot: FTBFS on armhf (test segfault)

2023-11-15 Thread Rafael Laboissière

* Emanuele Rocca  [2023-11-15 20:11]:


On 2023-11-15 06:47, Rafael Laboissière wrote:

Does this mean that the origin of the bug is upstream or that it still may
be a bug in gfortran?


At this point we know for sure that the issue is not armhf-specific, and 
also that it is not caused by stack-clash-protection. On the contrary, 
enabling stack-clash-protection on armhf allowed us to discover a 
problem that would have otherwise gone unnoticed.


Whether the bug is in plplot or gfortran I really have no idea. I would 
tend not to think of a compiler issue unless we have some evidence in 
that direction though, and suggest raising the issue with plplot 
upstream. Showing them the x86 reproducer with -fsanitize=address should 
be a good starting point.


Ok, thanks.

FYI, I can reproduce the segfault on armhf and amd64 with 
-fsanitize=address.


My guess is that the bug is in PLplot and not in gfortran, but this is 
jsut a guess. I will eventually inform the PLplot upstream authors about 
the issue.


Best,

Rafael Laboissière



Re: gcc-multilib & g++-multilib issues

2023-11-15 Thread Matthias Klose
Please stop filing duplicating bogus reports.  You make unproven claims 
without giving any rationale.


On 14.11.23 00:04, jahway-bug-reports wrote:

Hi Matthias,

There is software which will not build natively on Debian 10/11/12 without  the 
gcc-multilib & g++-multilib packages
https://packages.debian.org/bookworm/gcc-multilib
https://packages.debian.org/bookworm/g++-multilib

I can build it perfectly fine on amd64, but these packages are missing for me 
to build natively on a ARM 64 platform (such as a Raspberry Pi).

I have already filed the following bugs [1][2][3][4] to include these packages, but you 
give no explanation other than "arm64 doesn't have multilibs" but it would if 
these bugs were explored and resolved so that these packages would be available on the 
arm64 platform.

Can you please tell me why the Debian project is not able to consider adding 
these packages to ARM64 so that software can be natively compiled on this 
platform running Debian?

Thanks



[1] March 17, 2023 - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1033145
[2] March 17, 2023 - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1033146
[3] Nov 1, 2023 - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1055199
[4] Nov 1, 2023 - https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1055200




Processed: Re: Bug#1055228: plplot: FTBFS on armhf (test segfault)

2023-11-15 Thread Debian Bug Tracking System
Processing control commands:

> forwarded -1 https://sourceforge.net/p/plplot/bugs/206/
Bug #1055750 [gfortran] gfortran: [armhf] Yield SIGBUS when compiling with 
-fstack-clash-protection
Set Bug forwarded-to-address to 'https://sourceforge.net/p/plplot/bugs/206/'.

-- 
1055750: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1055750
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems



Bug#1055750: Bug#1055228: plplot: FTBFS on armhf (test segfault)

2023-11-15 Thread Rafael Laboissière

Control: forwarded -1 https://sourceforge.net/p/plplot/bugs/206/

* Rafael Laboissière  [2023-11-16 07:51]:

My guess is that the bug is in PLplot and not in gfortran, but this is 
just a guess. I will eventually inform the PLplot upstream authors 
about the issue.


Done !

R.