[Users] GCC 8 -- may need to update Cactus configure script

Erik Schnetter schnetter at gmail.com
Thu May 3 08:08:30 CDT 2018


I pushed an untested patch to the eschnett/funhpc branch of the flesh.

-erik

On Wed, May 2, 2018 at 12:45 PM, Roland Haas <rhaas at illinois.edu> wrote:
> Hello all,
>
> thank you for noticing this!
>
>> In other words, strings can now be longer than 2e9 characters. This is
>> a good change. To make this possible, the length of strings is now
>> passed as ptrdiff_t instead of as int, and consequently, the C/Fortran
>> interoperability mechanism in Cactus may need to be updated. Without
>> this, there might be a segfault e.g. when calling CCTK_INFO from
>> Fortran. (It might also be that things just work most of the time,
>> although this would be an unreliable coincidence.)
> I expect that they (unfortunately) probably work most of the time since
> on a little endian machine (ie a Intel sytem) both a ptrdiff_t and an
> int will have the same first 4 bytes on the stack (and likely the next
> four bytes are zero given that zero is the most common value for any
> byte) and the string length is the last argument on the stack so its
> incorrect size is not visible due to eg other arguments having the
> wrong location.
>
> Something similar to this happened before when we forgot to
> properly declare strdup() in code which led to it being implicitly
> declared to return an int which is then cast to char* which actually
> often worked (namely whenever the returned address what less than 2GB).
>
> So we need to carefully check the Cactus code to see what it assumes
> about the string passing convention.
>
> Yours,
> Roland
>
> --
> My email is as private as my paper mail. I therefore support encrypting
> and signing email messages. Get my PGP key from http://pgp.mit.edu .



-- 
Erik Schnetter <schnetter at gmail.com>
http://www.perimeterinstitute.ca/personal/eschnetter/


More information about the Users mailing list