[Debian-med-packaging] Bug#977021: bus errors on armhf running on a 64bit kernel

Bernd Rinn brinn at ethz.ch
Sun Dec 13 23:41:55 GMT 2020


Dear Pierre,

Thanks for digging into it. Indeed the tests check whether unaligned 
memory access works. Unfortunately, that is used in the 
NativeTaggedArray for 64bit primitive types and even ranks, see e.g. 
line 267 in NativeTaggedArray.

As I cannot reproduce the error myself, not even on a machine with 
aarch64 architecture, can you please tell me if the tests pass when you 
apply the attached patch?

Best regards,
Bernd

On 12/13/20 9:51 PM, Pierre Gruet wrote:
> Dear Bernd,
> 
> I have looked again at the issue we discussed last Friday; as pointed 
> out in the companion bug report
> 
>      https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=929530#5
> 
> I see an unaligned address is passed to GetXxxArrayRegion() in the 
> native part of the code, when running the tests testXxxToByteToXxx, for 
> Xxx in {Char, Short, Ing, Long, Float, Double}: this happens when the 
> argument targetOfs of the test is not a multiple of the size of Xxx.
> 
> I suggest to remove all pairs (i,j) from getOfs() in NativeDataTests 
> where j is not zero. I think the pairs (i,0) could remain even when i is 
> not zero, but I would remove them as well because the only place, in the 
> main source, where copyXxxToByte or copyByteToXxx are used is in 
> NativeTaggedArray, and there it never happens that inStart and outStart 
> are not multiples of the size of Xxx.
> 
> Do you agree or am I missing something? If you think my suggestions are 
> correct, I will upload the package with a patch leaving only the pair 
> (0,0) in getOfs() in NativeDataTests.
> 
> Warm thanks for your help,
> Pierre
> 
> 
> On Thu, 10 Dec 2020 18:45:37 +0100 Bernd Rinn <brinn at ethz.ch> wrote:
>  > Dear Pierre,
>  >
>  > No, I've not yet seen this bus error. I can see two changes to my test
>  > setup:
>  >
>  > - JDK 11 instead of JDK 8
>  > - 64bit OS instead of 32 bit OS
>  >
>  > The 64bit platoform is more likely to be the change that uncovers this
>  > bug. Which hardware did you get the error on?
>  >
>  > All the best,
>  > Bernd
>  >
>  > On 12/10/20 5:45 PM, Pierre Gruet wrote:
>  > > Control: forwarded -1 brinn at ethz.ch
>  > >
>  > >
>  > > Dear Bernd,
>  > >
>  > > In Debian we have received a bug report you may find below: there 
> seems
>  > > to be an unaligned memory access in (seemingly) the JNI part of 
> sis-base
>  > > version 18.09, leading to a failure on the architecture armhf 
> running on
>  > > a 64bit kernel.
>  > >
>  > > Have you already met this issue and do you see how it might be fixed?
>  > >
>  > > Thanks a lot,
>  > > Pierre Gruet
>  > >
>  > >
>  > > On Thu, 10 Dec 2020 07:15:24 +0100 Matthias Klose <doko at debian.org> 
> wrote:
>  > >  > Package: src:libsis-base-java
>  > >  > Version: 18.09~pre1+git20180928.45fbd31+dfsg-2
>  > >  > Severity: important
>  > >  > Tags: sid bullseye
>  > >  >
>  > >  > building libsis-base-java (or running the jni) leads to a bus 
> error,
>  > > usually
>  > >  > caused by unaligned memory accesses.
>  > >  >
>  > >  > [...]
>  > >  > LC_ALL=C java -Djava.library.path=source/c/.libs -classpath
>  > > sis-base-test.jar
>  > >  > ch.systemsx.cisd.base.AllTests
>  > >  > Application: base
>  > >  > Version: UNKNOWN*
>  > >  > Java VM: OpenJDK Server VM (v11.0.9.1+1-Debian-1)
>  > >  > CPU Architecture: arm
>  > >  > OS: Linux (v4.15.0-126-generic)
>  > >  > Test class: NativeDataTests
>  > >  >
>  > >  > Running testFloatToByteNonNativeByteOrderPartialOutputArray
>  > >  > Running testIntToByteToInt
>  > >  >  Arguments: [0, 0]
>  > >  >  Arguments: [0, 1]
>  > >  > #
>  > >  > # A fatal error has been detected by the Java Runtime Environment:
>  > >  > #
>  > >  > #  SIGBUS (0x7) at pc=0xf74b1d1c, pid=10186, tid=10187
-------------- next part --------------
A non-text attachment was scrubbed...
Name: force_use_nio.patch
Type: text/x-diff
Size: 7168 bytes
Desc: not available
URL: <http://alioth-lists.debian.net/pipermail/debian-med-packaging/attachments/20201214/b5923669/attachment.patch>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4299 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://alioth-lists.debian.net/pipermail/debian-med-packaging/attachments/20201214/b5923669/attachment.bin>


More information about the Debian-med-packaging mailing list