-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
startSocsimWithFile()
crashes when supfile
contains more than a basename
#20
Comments
The error is in I question why |
To check, check whether opening the rate file or the destination file succeeded (below). It doesn't. The error message propagates through to R (which isn't true for FILE *source = fopen(rate_file_name, "rb")
if (source == NULL) {
perror("Error opening source (rate) file.");
//if you uncomment the below, main1() will continue (!)
// to run and crash when trying to create the log file.
//return 1;
} |
I think it should, because it makes the code more readable. main1() is already too long. create_output_fn_dir() does one thing that you can compartementalize and put it into another place. It uses global state and assumes the existence of some variables, which is not how we would write this in 2024... but that was written in the 80ies or 90ies and if you want to improve the codebase, this is unfortunately not the worst thing :) I don't hate Rprintf() - why do you think I do? Because there are these I don't fully understand what causes the error yet. Is it the block where it copies the .sup-file into the subfolder (load.cpp line 366 and further)? |
Cause: yes. It cannot find the rate file or destination file and the copy step fails. This seems to be because the Rcpp process happens in a different directory than the R process. Still investigating this. |
If
supfile
contains more than the basename, i.e.some_directory/my_sup_file.sup
instead ofmy_sup_file.sup
, the process will crash insidestartSocsimWithFile()
.I'd guess the problem is in line 277 or 275 of events.cpp, based on what gets written to stdout before the crash.
The documentation is wrong to state that every
sup
and rate file should be referred to relative tofolder
. Currently,sup
and rate files must be directly underfolder
for everything to work.The behavior happens whether the base directory is inside the working directory or not.
The text was updated successfully, but these errors were encountered: