Skip to content
Back to formatted view

Raw Message

Message-ID: <1203602439.71609689.1385005526144.JavaMail.root@k-state.edu>
Date: 2013-11-21T03:45:26Z
From: Earl Brown
Subject: RStudio and R.app "segmentation fault" errors
In-Reply-To: <1823033592.71607462.1385005450162.JavaMail.root@k-state.edu>

R-helpers,

I'm using system() to run a shell script that uses a library written in C++ to analyze natural language (FreeLing: http://nlp.lsi.upc.edu/freeling). When I run the following code in RStudio (0.97.248) and R.app (1.62) on Max OSX (10.7.5):

> cmd <- "analyze -f /usr/local/share/freeling/config/es.cfg --lang es --outf tagged </Users/earlbrown/temp_input.txt"
> tagged.text <- do.call(system, args = list(command = cmd, intern = T))

I sometimes receive a "Segmentation fault" error:

/usr/local/bin/analyze: line 39:  2806 Segmentation fault: 11  $FREELING/bin/analyzer $param
Warning message:
running command 'analyze -f /usr/local/share/freeling/config/es.cfg --lang es --outf tagged </Users/earlbrown/temp_input.txt' had status 139 

and sometimes I receive a "Trace/BPT trap: 5" error:

dyld: lazy symbol binding failed: Symbol not found: __ZN6icu_496LocaleD1Ev
  Referenced from: /usr/local/lib/libfreeling-3.1-alfa1.dylib
  Expected in: flat namespace

dyld: Symbol not found: __ZN6icu_496LocaleD1Ev
  Referenced from: /usr/local/lib/libfreeling-3.1-alfa1.dylib
  Expected in: flat namespace

/usr/local/bin/analyze: line 39:  2864 Trace/BPT trap: 5       $FREELING/bin/analyzer $param
Warning message:
running command 'analyze -f /usr/local/share/freeling/config/es.cfg --lang es --outf tagged </Users/earlbrown/temp_input.txt' had status 133 

However, when I open a Terminal window and start R there and then run the code I don't get either error message and I get the output I expect. So, the obvious work-around is to simply run my R scripts that use FreeLing (the C++ library) in an R session within Terminal. But, I'm curious to know why RStudio and R.app have problems with it, and if there is anything that I can do to be able to use RStudio and/or R.app when I want to call this C++ library.

Here's my info:
> sessionInfo()
R version 3.0.2 (2013-09-25)
Platform: x86_64-apple-darwin10.8.0 (64-bit)

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

loaded via a namespace (and not attached):
[1] tools_3.0.2

Thanks in advance for your help and ideas. Earl Brown

-----
Earl K. Brown, PhD
Assistant Professor of Spanish (Linguistics)
Advisor, TEFL MA Program
Department of Modern Languages
Kansas State University
www-personal.ksu.edu/~ekbrown