Skip to content
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

Fatal error that aborts R #7

Closed
morrowcj opened this issue Nov 29, 2022 · 7 comments
Closed

Fatal error that aborts R #7

morrowcj opened this issue Nov 29, 2022 · 7 comments
Labels
bug Something isn't working

Comments

@morrowcj
Copy link
Owner

morrowcj commented Nov 29, 2022

Occasionally, using some functions in this package can cause a fatal errorthat aborts R.

As far as I've been able to tell, these errors occur when input to the functions are improper (e.g., incorrect dimensions) or when there is insufficient memory.

They appear to only occur with functions that use C++ (via Rcpp).

@morrowcj morrowcj added the bug Something isn't working label Nov 29, 2022
@morrowcj
Copy link
Owner Author

If anyone knows of a consistent way to reproduce this bug, I would very much like to know.

@kelewinska
Copy link
Collaborator

Try to run fitGLS_partition with formula = AR_coef ~ 0 and formula0 = AR_coef ~ 1

@morrowcj
Copy link
Owner Author

I thought I fixed this... :( I'll look into it.

@morrowcj
Copy link
Owner Author

Following the examples for fitGLS_partition, using 0-intercept only does cause a crash.

library(remotePARTS)
data(ndvi_AK10000)
df = ndvi_AK10000[seq_len(1000), ] # first 1000 rows
pm = sample_partitions(nrow(df), npart = 3)

partGLS = fitGLS_partition(formula = AR_coef ~ 0, partmat = pm, data = df) # causes crash

And this is because it doesn't make sense to use a zero-only intercept. The typical intercept results in a model matrix with a single column, where a 0-intercept version has a 0-column model matrix (which is nonsense):

modmat1 = model.matrix(AR_coef ~ 1, data = df)
modmat0 = model.matrix(AR_coef ~ 0, data = df)

dim(modmat1)  # 1000  1
dim(modmat2)  # 1000  0

I'll add some functionality to prevent 0-intercept models from being run and I will also create a warning about the intercept-only model.

@arives
Copy link
Collaborator

arives commented Aug 29, 2023 via email

@morrowcj
Copy link
Owner Author

I've implemented a fix in the development branch. I'll test it after compiling and then push to master ASAP.

@morrowcj
Copy link
Owner Author

I've patched the specific issued mentioned by @Erfea in PR #21. I'm going to close this issue. If a new crash-condition arises, we'll create a new one.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants