lanl / lanl/mcnptools

Segfault With Single Energy Bin

Open
#2 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
95
Forks
30
PR merge metrics
No merged PRs in 30d

Description

MCNPTools experiences a Segmentation Fault when processing a meshtal file with only a single energy bin. A MWE will be posted.

MCNPTools attempts to compare to the "Total" bin, regardless of whether it exists. This occurs both in meshtal2vtk...

std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >::compare (this=0x0, __s=0x47379d "Total")

...and the Python API:

import mcnptools
>>> mt = mcnptools.Meshtal("example.mesht")
>>> mt.GetTally(4)
Segmentation fault (core dumped)

Temporary workaround: Use emesh=0,1 instead of emesh=1.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the meshtal2vtk path and the Python Meshtal/GetTally entry point described in the report, then reproduce the crash using a meshtal file with one energy bin. Confirm that both interfaces process a missing "Total" bin without a segmentation fault, while retaining the stated emesh=0,1 workaround behavior as a comparison.

Written by the indexing model from the issue text.

Assessment

Tech stack
cpp, python
Domain
tooling
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.