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

gsw_SA_from_SP() segfaults on NA for longitude or latitude #22

Closed
dankelley opened this issue Jan 24, 2017 · 2 comments
Closed

gsw_SA_from_SP() segfaults on NA for longitude or latitude #22

dankelley opened this issue Jan 24, 2017 · 2 comments
Assignees
Labels

Comments

@dankelley
Copy link
Contributor

Sample code

library(gsw)
print(gsw_SA_from_SP(SP=c(35, 35), p=c(100,100), longitude=c(-30,NA), latitude=c(45,30)))
print(gsw_CT_from_pt(c(35, NA), pt=c(10,11)))

yields

 *** caught segfault ***
address 0x7fefdc33c4e8, cause 'memory not mapped'

Traceback:
 1: .C("wrap_gsw_SA_from_SP", SP = as.double(l$SP), p = as.double(l$p),     longitude = as.double(l$longitude), latitude = as.double(l$latitude),     n = n, rval = double(n), NAOK = TRUE, package = "gsw")
 2: gsw_SA_from_SP(SP = c(35, 35), p = c(100, 100), longitude = c(-30,     NA), latitude = c(45, 30))
 3: print(gsw_SA_from_SP(SP = c(35, 35), p = c(100, 100), longitude = c(-30,     NA), latitude = c(45, 30)))
An irrecoverable exception occurred. R is aborting now ...
Segmentation fault: 11

@dankelley dankelley added the bug label Jan 24, 2017
@dankelley dankelley self-assigned this Jan 24, 2017
@dankelley
Copy link
Contributor Author

I know where to fix this (src/wrappers.c near line 130, plus fixes for the other W macros nearby) and will likely fix it on the upcoming weekend.

@dankelley
Copy link
Contributor Author

Fixed in the develop branch, commit bd900b3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant