Skip to content

Caught segfault #15

@MohammadDara

Description

@MohammadDara

Running the following sample code in the Apple silicon processors will cause a caught segfault.

library(dismo)
library(rJava)
library(raster)
library(sf)
occurence <- paste(system.file(package="dismo"), '/ex/bradypus.csv', sep='')
occ <- read.table(occurence, header=TRUE, sep=',')[,-1]

# witholding a 20% sample for testing 
fold <- kfold(occ, k=5)
occtest <- occ[fold == 1, ]
occtrain <- occ[fold != 1, ]

files <- list.files(path=paste(system.file(package="dismo"), '/ex',
                               sep=''),  pattern='grd',  full.names=TRUE )
#predictors of the model, the rasters. 
predictors<-stack(files[1:8])

#run the algorithm.
me<-maxent(predictors, occtrain)

The error is:

 *** caught segfault ***
address 0xfffffffffffffff0, cause 'invalid permissions'

Traceback:
 1: rJava::.jcall(mxe, "S", "fit", c("autorun", "-e", afn, "-o",     dirout, "-s", pfn, args))
 2: .local(x, p, ...)
 3: maxent(x, p, ...)
 4: maxent(x, p, ...)
 5: .local(x, p, ...)
 6: maxent(predictors, occtrain)
 7: maxent(predictors, occtrain)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions