Menu

#183 SDR boundaries or integrity violation. (read)

4.1.2
closed
Jay Gao
None
1
2023-02-04
2022-12-09
No

The problem is present on 64bit ARM(v8) based platforms. I have encountered the problem that someone has already ran into before (https://sourceforge.net/p/ion-dtn/mailman/ion-dtn-support/thread/41d1cd2258ee4579b8cb2678e17d288d@jpl.nasa.gov/) with SDR access issues. In summary, it is impossible to start ionadmin due to "SDR boundaries or integrity violation. (read)" error.

The error is not exactly happening in the spot that was reported by Florian (I had integrity violation during read) but it is very similar. I imagine the difference might be due me using newer version of ION (4.1.1). Also, in contrary to what was reported prior, I noticed that the "-DSPACE_ORDER=3" flag is not passed to the compiler during compilation.

I investigated a bit and found out that the automake's configure/configure.ac sets -DSPACE_ORDER=3 in the following lines:

            PLATFORM="linux"
            if test $host_cpu = "x86_64" ; then
                    AC_DEFINE([linux],[1],[Build 64-bit Linux specific platform code.])
                    AM_CFLAGS="$AM_CFLAGS -Dlinux -DSPACE_ORDER=3 -fno-strict-aliasing"
                    echo "Build 64-bit Linux specific platform code."
            else
                    AC_DEFINE([linux],[1],[Build 32-bit Linux specific platform code.])
                    AM_CFLAGS="$AM_CFLAGS -Dlinux -fno-strict-aliasing"
                    echo "Build 32-bit Linux specific platform code."
            fi

In case or ARM64, the architecture is aarch64 and it falls into "Build 32-bit Linux specific platform code", which is not correct. Adding "aarch64" into this conditional resulted in the -DSPACE_ORDER=3 flag being present during compilation and no errors when using ION-DTN.

Discussion

  • Jay Gao

    Jay Gao - 2023-01-06
    • status: open --> closed
    • assigned_to: Jay Gao
     
  • Jay Gao

    Jay Gao - 2023-01-06

    Hi Szymon,

    Really appreciate your detailed report and feedback on this issue. We have ran into this issue idependently and also recognize the same fix as you recommended. Thank you!

    This fix has been implemented for ION 4.1.2, which should be released this month.

    Jay

     
  • Jorge Amodio

    Jorge Amodio - 2023-02-04

    I had a similar problem building 4.1.1 on an ARM (aarch64) running on 64bits, some versions of linux are compiled to run on 32b bits. With the original code compiling does not produce any warning/error, but it generates a real time error due the sdr violation. The workaround I put together on configure.ac, it checks the kernel variable LONG_BIT to check if it is running on 32 or 64bits and sets SPACE_ORDER properly

    long_bit=`(getconf LONG_BIT)`
    
    case $host_os in
        darwin*)
            AC_DEFINE([darwin],[1],[Build Darwin specific platform code.])
            AC_DEFINE([unix],[1],[Build Unix specific platform code.])
            PLATFORM="darwin"
            if test $host_cpu = "x86_64" ; then
                AM_CFLAGS="$AM_CFLAGS -Dunix -Ddarwin -DSPACE_ORDER=3 -m64 "
                echo "Build 64-bit Darwin specific platform code."
            elif test $host_cpu = "arm" ; then
                AM_CFLAGS="$AM_CFLAGS -Dunix -Ddarwin -DSPACE_ORDER=3 -m64 "
                echo "Build 64-bit ARM Darwin specific platform code."
            else
                AM_CFLAGS="$AM_CFLAGS -Dunix -Ddarwin -DSPACE_ORDER=2 -m32 "
                echo "Build 32-bit Darwin specific platform code."
            fi
            ;;
        linux*)
                    PLATFORM="linux"
                    if test $host_cpu = "x86_64" ; then
                            AC_DEFINE([linux],[1],[Build 64-bit Linux x86_64 platform code.])
                            AM_CFLAGS="$AM_CFLAGS -Dlinux -DSPACE_ORDER=3 -fno-strict-aliasing"
                            echo "Build 64-bit Linux x86_64 platform code."
                    elif test $host_cpu = "aarch64" ; then
                            if test $long_bit = "32" ; then
                                    AC_DEFINE([linux],[1],[Build 32-bit Linux aarch64 platform code.])
                                    AM_CFLAGS="$AM_CFLAGS -Dlinux -DSPACE_ORDER=2 -fno-strict-aliasing"
                                    echo "Build 32-bit Linux specific aarch64 code."
                            elif test $long_bit = "64" ; then
                                    AC_DEFINE([linux],[1],[Build 64-bit Linux specific platform code.])
                                    AM_CFLAGS="$AM_CFLAGS -Dlinux -DSPACE_ORDER=3 -fno-strict-aliasing"
                                    echo "Build 64-bit Linux specific aarch64 code."
                            else
                                    echo "Unknown LONG_BIT value for linux aarch64 build."
                                    exit 1
                            fi
                    else
                            AC_DEFINE([linux],[1],[Build 32-bit Linux generic platform code.])
                            AM_CFLAGS="$AM_CFLAGS -Dlinux -fno-strict-aliasing"
                            echo "Build 32-bit Linux generic platform code."
                    fi
    
     

    Last edit: Jorge Amodio 2023-02-04

Anonymous
Anonymous

Add attachments
Cancel





MongoDB Logo MongoDB