fulldiag_evaluate: a result file not named *.out.xml fails with "basic_string::erase"

オープン 初心者向け
#433 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

メンテナーはふだん 2 日以内に返信

まだ誰も着手していません。

評価

難易度
2/5
見積もり時間
1〜3時間
初心者へのやさしさ
80/100
issue の種類
バグ
明瞭さ
明確に書かれている
活発さ
活発
技術スタック
cpp
領域
cli

調査の方向性

fulldiag_evaluate.C:83 から始めます。ここでは name.erase(name.rfind(".out.xml"), 8) がクラッシュします。rfind が npos を返すためです。それは名前が .out.xml で終わらない場合です。.out.h5 ファイルを受け入れるか、rfind の結果を確認して期待される .out.xml 入力を示すメッセージとともに終了するかを決め、その後、現在は単に "filenames" とだけ表示されている usage テキストを更新してください。fulldiag_evaluate fd.task1.out.h5 で再現し、.out.xml の実行がこれまでどおり評価されることを確認してください。

索引モデルが issue の本文から書いたものです。

説明

area:ed bug P3

fulldiag_evaluate expects the task's .out.xml file. Given anything else, for example the .out.h5 written next to it, it stops with an error that doesn't say what's wrong:

$ fulldiag_evaluate --T_MIN 0.5 --T_MAX 1.0 --DELTA_T 0.5 fd.task1.out.h5
Caught exception: basic_string::erase: __pos (which is 18446744073709551615) > this->size() (which is 15)

fulldiag_evaluate.C:83 strips the suffix with name.erase(name.rfind(".out.xml"), 8), and rfind returns npos for any other name. The usage text only says "filenames". Seen on master fa944d8 (Linux). The same run evaluates fine from its .out.xml.

Fix: accept the .out.h5 file, or reject other names with a message that an .out.xml file is expected, and say so in the usage text.

主要言語
C++
スター
32
フォーク
10
平均マージ
3日 19時間
マージ済み PR(30日)
100

環境構築

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

ALPSim/ALPS のほかの issue

ALPSim/ALPS の issue をすべて見る

似ている issue

C++ の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。