Coder Social home page Coder Social logo

Comments (9)

awvwgk avatar awvwgk commented on July 19, 2024 1

This seems to fail in the tomlf_ser module, which provides the implementation to turn a data structure into a string.

You could try to comment out part of the visitor implementation to see which routine exactly breaks the compiler (they will probably appreciate a minimal reproducer for this).

The module is pretty separated from the rest of TOML Fortran, you could remove it for the time being to see whether Cray can pass the unit and decoder tests or there are more issues.

from toml-f.

awvwgk avatar awvwgk commented on July 19, 2024

I don't have access to Cray compilers for checking this unfortunately. The error message however looks like an internal compiler error rather than an issue with TOML Fortran. Maybe it is possible to reduce the tomlf_diagnostic module to isolate the exact problem. This way it is easier to find a workaround or/and send a support request to Cray.

from toml-f.

awvwgk avatar awvwgk commented on July 19, 2024

Looks like it is caused by this lines:

associate(first => token%first)
shift = first(line) - 1
end associate

from toml-f.

timofeymukha avatar timofeymukha commented on July 19, 2024

Trying to understand the code a bit. We have

   type :: line_token
      integer :: first, last
   end type line_token

Then we have in failing function

type(line_token), allocatable :: token(:)
! ...
associate(first => token%first)
      shift = first(line) - 1
end associate

The code is a bit unclear to me, token is an array, so is the idea here that token%first will be a corresponding array of all first attributes? Does it work that way? Can we do

associate(first => token%first(line))
      shift = first - 1
end associate

instead?

from toml-f.

awvwgk avatar awvwgk commented on July 19, 2024

See #137 for an explanation:

token is an array of toml_token type, token%first provides an array of integers from all members first in the types, with associate a reference first to this (strided) array is created, finally the element line of this array is selected. Seems super complicated for just fetching an integer value, previously I was doing more with this array but removed most of it now.

I still think Cray should handle this correctly, but it is easier to remove the usage here since it is not needed in this context anymore.

from toml-f.

timofeymukha avatar timofeymukha commented on July 19, 2024

The module compiles now, but unfortunately there is more trouble down the road with

FAILED: CMakeFiles/toml-f-lib.dir/src/tomlf/ser.f90.o include/tomlf_ser.mod
/opt/cray/pe/craype/2.7.16/bin/ftn -I/cfs/klemming/projects/snic/kthmech/tmu/Software/toml-f/src/tomlf -I/cfs/klemming/projects/snic/kthmech/tmu/Software/toml-f/_build/include -em -Jinclude -h PIC -c CMakeFiles/toml-f-lib.dir/src/tomlf/ser.f90-pp.f90 -o CMakeFiles/toml-f-lib.dir/src/tomlf/ser.f90.o
ftn-2116 ftn: INTERNAL
  "/opt/cray/pe/cce/14.0.1/cce/x86_64/bin/ftnfe" was terminated due to receipt of signal 013:  Segmentation fault.

This does not seem helpful at all :(. Perhaps one can engage Cray somehow to look at this.

from toml-f.

timofeymukha avatar timofeymukha commented on July 19, 2024

By making the ser.f90 empty and removing the "compliance" subdir from the tests, I could compile.
Unfortunately, the unit tests fail

  Starting lexer-from-sequential ... (108/108)
       ... lexer-from-sequential [FAILED]
  Message:
# Testing: parser
  Starting root-invalid ... (1/39)
       ... root-invalid [EXPECTED FAIL]
  Message: error: Invalid syntax
 --> mocked:1:1
  |
1 | }
  | ^ unexpected opening brace
  |
  Starting table-body ... (2/39)
       ... table-body [PASSED]
  Starting table-header-long ... (3/39)
Segmentation fault (core dumped)

Sad times.

from toml-f.

awvwgk avatar awvwgk commented on July 19, 2024

Can we get a better backtrace for the segmention fault? If it fails in the table header then there might be an issue with the way the internal stack for the TOML parser is handled.

Also not happy to see a failure in the lexing... if you can give me more details I might figure out a workaround, but ultimately these are bugs in the Cray compiler which should be reported and fixed.

from toml-f.

timofeymukha avatar timofeymukha commented on July 19, 2024

I will also try with version 15 of the compiler. I guess we can't report bugs on an older version anyway.

from toml-f.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.