[gdal-dev] gdal git - Test 28 test-virtual-memory (SEGFAULT)

Even Rouault even.rouault at spatialys.com
Thu Jan 12 15:43:14 PST 2023


fixed per https://github.com/OSGeo/gdal/pull/7058

Even

Le 12/01/2023 à 23:23, Andrew C Aitchison a écrit :
> On Thu, 12 Jan 2023, Even Rouault wrote:
>
>> Andrew,
>>
>> how did you get clang 15.0.2 on Ubuntu 21:10 ? Not through the apt 
>> package manager with the default apt repositories, right ? Because 
>> I've just tried with ubuntu 22.04 and this is only clang 14.0.0 that 
>> gets distributed, and the test runs fine.
>
> 'sudo apt reinstall clang-15' gives:
>
> Get:1 http://gb.archive.ubuntu.com/ubuntu kinetic/universe amd64 
> clang-15 amd64 1:15.0.2-1 [80.5 kB]
> Fetched 80.5 kB in 0s (205 kB/s)
> (Reading database ... 1008451 files and directories currently installed.)
> Preparing to unpack .../clang-15_1%3a15.0.2-1_amd64.deb ...
> Unpacking clang-15 (1:15.0.2-1) over (1:15.0.2-1) ...
> Setting up clang-15 (1:15.0.2-1) ...
>
> I think the "universe" and "clang-15" might be the significant 
> differences.
>
>> That said, I'm moderately surprised that you hit an issue. The 
>> virtualmem code stuff does some on-the-fly at-hand un-assembling (cf 
>> https://gdal.org/development/rfc/rfc45_virtualmem.html#low-level-machinery-cpl-virtualmem-h), 
>> so if a compiler emits new machine instructions the code isn't ready 
>> for, such errors could happen. So, assuming the compiler you use 
>> isn't broken, I suspect some code updates are required. But we need 
>> to be able to reproduce first. Did you also use particular CPPFLAGS 
>> that activate AVX instruction set or something like that ?
>
> Not explicitly, but
>    autotest/cpp/CMakeFiles/testvirtualmem.dir/flags.make
> does mention such things, though the flags in the clang-14 version
> are no different. Here it is in full:
> -------------------------
> # CMAKE generated file: DO NOT EDIT!
> # Generated by "Unix Makefiles" Generator, CMake Version 3.24
>
> # compile CXX with /usr/lib/llvm-15/bin/clang++
> CXX_DEFINES = -DDONT_DEPRECATE_SPRINTF -DGDAL_COMPILATION 
> -DGDAL_TEST_ROOT_DIR=\"/home/werdna/git/gdal/autotest\" 
> -DHAVE_AVX_AT_COMPILE_TIME -DHAVE_SSE_AT_COMPILE_TIME 
> -DHAVE_SSSE3_AT_COMPILE_TIME
>
> CXX_INCLUDES = -I/home/werdna/git/gdal/apps 
> -I/home/werdna/git/gdal/alg -I/home/werdna/git/gdal/gcore 
> -I/home/werdna/git/gdal.build.llvm/gcore -I/home/werdna/git/gdal/port 
> -I/home/werdna/git/gdal.build.llvm/port -I/home/werdna/git/gdal/ogr 
> -I/home/werdna/git/gdal/ogr/ogrsf_frmts -I/home/werdna/git/gdal/frmts 
> -I/home/werdna/git/gdal.build.llvm/gcore/gdal_version_full
>
> CXX_FLAGS =  -fno-finite-math-only -fvisibility=hidden  -g -Wall 
> -Wextra -Winit-self -Wunused-parameter -Wmissing-declarations 
> -Wshorten-64-to-32 -Wshadow -Wshadow-field -Wmissing-include-dirs 
> -Wformat -Werror=format-security -Wno-format-nonliteral -Werror=vla 
> -Wdate-time -Wnull-dereference -Wextra-semi -Wcomma -Wfloat-conversion 
> -Wdocumentation -Wno-documentation-deprecated-sync 
> -Wunused-private-field -Wnon-virtual-dtor -Woverloaded-virtual 
> -Wsuggest-override -fno-operator-names -Wzero-as-null-pointer-constant 
> -DGTEST_HAS_PTHREAD=1 -std=gnu++11
> -------------------------
>
> The overall CMakeCache.txt is at
> https://www.aitchison.me.uk/gdal/CMakeCache.txt.clang15.20230112.txt
>
>
>> Apart from the inconvenience of the test suite not passing, that 
>> doesn't invalidate your GDAL build in general. This is a very 
>> specific functionality that no one triggers without explicitly asking 
>> for it.
>>
>> Even
>
> Thanks.
>
-- 
http://www.spatialys.com
My software is free, but my time generally not.



More information about the gdal-dev mailing list