Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
    • Help
    • Support
    • Submit feedback
    • Contribute to GitLab
  • Sign in
O
openmc
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 70
    • Issues 70
    • List
    • Boards
    • Labels
    • Milestones
  • Merge Requests 9
    • Merge Requests 9
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
  • Analytics
    • Analytics
    • CI / CD
    • Repository
    • Value Stream
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Shikhar Kumar
  • openmc
  • Merge Requests
  • !1088

Merged
Opened Oct 05, 2018 by Shikhar Kumar@shikhark
  • Report abuse
Report abuse

More fixes to make Valgrind happy

  • Overview 5
  • Commits 4
  • Changes 3

Created by: smharper

Four fixes here:

In hdf5_interface.h we had prepared buffers for xtensor arrays by using T* buffer = new T[size]. xtensor then deallocates them with (I think) allocator<double>::deallocate which causes Valgrind to warn about mismatched free() / delete / delete []. I've fixed that by using std::vector as the buffer.

When we called read_attribute_string from Fortran, the buffer was undersized by one byte. (I assume we miscounted a null character somewhere). That's fixed now.

When computing photon production cross sections, we were interpolating on a Tabulated1D with a value equal to the first grid point in that table. In that case, our search returned an index of -1 which we then indexed an array with.

You know all those may be used uninitialized in this function warnings we used to get with strings in hdf5_interface.F90? Valgrind helped me figure out what that was about, and it's now fixed by making sure we allocate character arrays that are declared locally in hdf5_interface.F90 rather than those with inferred length returned by to_c_string.

There are still a few small Valgrind errors raised by calls inside the HDF5 library which probably means we've messed up a buffer or a type or something, but I'm not sure now how to track that down.

Assignee
Assign to
None
Milestone
None
Assign milestone
Time tracking
0
Labels
None
Assign labels
  • View project labels
Reference: shikhark/openmc!1088