Project

General

Profile

Bug #1991

CkScanf broken with charmrun

Added by Venkatasubrahmanian Narayanan 5 days ago. Updated 5 days ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Start date:
10/10/2018
Due date:
% Done:

0%


Description

CkScanf fails with an error message "fscanf() failed!" when used in a program run with charmrun. Some debugging suggests that it originates from util/charmrun-src/charmrun.C, from the method input_scanf_chars.

When the code using CkScanf is changed to use scanf or cin, the program appears to not wait for the user to give input(some tests suggest that this might actually be due to the scanf/cin call failing), but just goes ahead with execution.

Reproducible example:
particle.ci:

mainmodule particle {
mainchare main {
entry main(CkArgMsg*);
};
};

particle.C:
#include "particle.decl.h"
class main : public CBase_main {
public:
main(CkArgMsg*) {
int temp;
CkScanf("%d",&temp);
CkPrintf("%d",temp);
CkExit();
}
};
#include "particle.def.h"

History

#1 Updated by Sam White 5 days ago

Note that you don't want to use scanf directly because you'll get charmrun and its arguments in the input string. CkScanf is supposed to filter those out.

Also available in: Atom PDF