Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Register
  • Sign in
  • VTK-m VTK-m
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
  • Issues 212
    • Issues 212
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 40
    • Merge requests 40
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Package Registry
    • Container Registry
    • Infrastructure Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • VTKVTK
  • VTK-mVTK-m
  • Merge requests
  • !2800

Fix SEGFAULT in BenchmarkInSitu on exit

  • Review changes

  • Download
  • Email patches
  • Plain diff
Closed Kenneth Moreland requested to merge kmorel/vtk-m:benchmarkinsitu-segfault into master Jul 01, 2022
  • Overview 7
  • Commits 1
  • Pipelines 4
  • Changes 1

On some devices, we are observing a SEGFAULT crash in BenchmarkInSitu when the program exits. This is likely because the benchmark creates some global DataSet variables that are constructed before VTK-m is initialized and are therefore destroyed after VTK-m (and its devices) are finalized. The crash happens when the DataSet attempts to free the memory on the device that it allocated, but the device is no longer there to be deleted.

Fix the problem by wrapping these global variables as static variables in functions. This will defer the construction of the global variables to when the function is called. C++ specifies that global objects are destroyed in the reverse order in which they are constructed. Thus, if we defer the construction of the benchmark's objects until after the construction of internal device objects, the data will be destroyed before the device is finalized.

Fixes #712 (closed)

Assignee
Assign to
Reviewers
Request review from
Time tracking
Source branch: benchmarkinsitu-segfault