[ESS] R-devel crashes when can't find function

Sebastian Meyer @eb@meyer @end|ng |rom |@u@de
Thu Feb 6 00:39:13 CET 2025


It no longer happens with today's r87690, thanks to Tomas Kalibera.

	Sebastian


Am 05.02.25 um 22:46 schrieb Toby Hocking:
> Thanks Seb
> 
> I confirm that option is responsible for the crash:
> 
> (base) tdhock using tdhock-MacBook:~$ R/R-devel/bin/R -e 'foo()'
> 
> R Under development (unstable) (2025-02-02 r87676) -- "Unsuffered 
> Consequences"
> Copyright (C) 2025 The R Foundation for Statistical Computing
> Platform: x86_64-pc-linux-gnu
> 
> R est un logiciel libre livré sans AUCUNE GARANTIE.
> Vous pouvez le redistribuer sous certaines conditions.
> Tapez 'license()' ou 'licence()' pour plus de détails.
> 
> R est un projet collaboratif avec de nombreux contributeurs.
> Tapez 'contributors()' pour plus d'information et
> 'citation()' pour la façon de le citer dans les publications.
> 
> Tapez 'demo()' pour des démonstrations, 'help()' pour l'aide
> en ligne ou 'help.start()' pour obtenir l'aide au format HTML.
> Tapez 'q()' pour quitter R.
> 
> Le chargement a nécessité le package : grDevices
>  > foo()
> Erreur dans foo() : impossible de trouver la fonction "foo"
> Exécution arrêtée
> (base) tdhock using tdhock-MacBook:~$ R/R-devel/bin/R -e 
> 'options(show.error.locations = TRUE);foo()'
> 
> R Under development (unstable) (2025-02-02 r87676) -- "Unsuffered 
> Consequences"
> Copyright (C) 2025 The R Foundation for Statistical Computing
> Platform: x86_64-pc-linux-gnu
> 
> R est un logiciel libre livré sans AUCUNE GARANTIE.
> Vous pouvez le redistribuer sous certaines conditions.
> Tapez 'license()' ou 'licence()' pour plus de détails.
> 
> R est un projet collaboratif avec de nombreux contributeurs.
> Tapez 'contributors()' pour plus d'information et
> 'citation()' pour la façon de le citer dans les publications.
> 
> Tapez 'demo()' pour des démonstrations, 'help()' pour l'aide
> en ligne ou 'help.start()' pour obtenir l'aide au format HTML.
> Tapez 'q()' pour quitter R.
> 
> Le chargement a nécessité le package : grDevices
>  > options(show.error.locations = TRUE);foo()
> 
>   *** caught segfault ***
> address 0x180, cause 'memory not mapped'
> An irrecoverable exception occurred. R is aborting now ...
> Erreur de segmentation (core dumped)
> 
> On Wed, Feb 5, 2025 at 2:06 PM Sebastian Meyer <seb.meyer using fau.de 
> <mailto:seb.meyer using fau.de>> wrote:
> 
>     I could reproduce the problem in R-devel.
> 
>     It is not an ESS-specific bug: it happens under
>     `options(show.error.locations = TRUE)`, which is unset by default but
>     set by ESS. The following is sufficient to trigger the segfault:
> 
>           options(show.error.locations = TRUE)
>           foo()
> 
>     I guess the issue is related to PR#18841
>     <https://bugs.r-project.org/show_bug.cgi?id=18841
>     <https://bugs.r-project.org/show_bug.cgi?id=18841>>, merged last
>     week. I
>     left a comment there.
> 
>     Best,
> 
>              Sebastian
> 
> 
>     Am 05.02.25 um 11:25 schrieb Toby Hocking via ESS-help:
>      > Here is the crash report that I forgot in my original post
>      >
>      > ==34394== Memcheck, a memory error detector
>      > ==34394== Copyright (C) 2002-2017, and GNU GPL'd, by Julian
>     Seward et al.
>      > ==34394== Using Valgrind-3.18.1 and LibVEX; rerun with -h for
>     copyright info
>      > ==34394== Command: /home/tdhock/lib/R/bin/exec/R --no-readline
>      > ==34394==
>      >
>      > R Under development (unstable) (2025-02-02 r87676) -- "Unsuffered
>      > Consequences"
>      > Copyright (C) 2025 The R Foundation for Statistical Computing
>      > Platform: x86_64-pc-linux-gnu
>      >
>      > R est un logiciel libre livré sans AUCUNE GARANTIE.
>      > Vous pouvez le redistribuer sous certaines conditions.
>      > Tapez 'license()' ou 'licence()' pour plus de détails.
>      >
>      > R est un projet collaboratif avec de nombreux contributeurs.
>      > Tapez 'contributors()' pour plus d'information et
>      > 'citation()' pour la façon de le citer dans les publications.
>      >
>      > Tapez 'demo()' pour des démonstrations, 'help()' pour l'aide
>      > en ligne ou 'help.start()' pour obtenir l'aide au format HTML.
>      > Tapez 'q()' pour quitter R.
>      >
>      > Le chargement a nécessité le package : grDevices
>      >
>      >> foo()
>      > ==34394== Invalid read of size 8
>      > ==34394==    at 0x499B77C: R_GetCurrentSrcref (in
>      > /home/tdhock/lib/R/lib/libR.so)
>      > ==34394==    by 0x4996DD3: verrorcall_dflt (in
>      > /home/tdhock/lib/R/lib/libR.so)
>      > ==34394==    by 0x49976BD: Rf_errorcall (in
>     /home/tdhock/lib/R/lib/libR.so)
>      > ==34394==    by 0x4997793: Rf_errorcall_cpy (in
>      > /home/tdhock/lib/R/lib/libR.so)
>      > ==34394==    by 0x498B205: Rf_findFun3 (in
>     /home/tdhock/lib/R/lib/libR.so)
>      > ==34394==    by 0x499F8B8: Rf_eval (in
>     /home/tdhock/lib/R/lib/libR.so)
>      > ==34394==    by 0x49A62A2: do_set (in /home/tdhock/lib/R/lib/libR.so)
>      > ==34394==    by 0x499FA38: Rf_eval (in
>     /home/tdhock/lib/R/lib/libR.so)
>      > ==34394==    by 0x49F2F75: Rf_ReplIteration (in
>      > /home/tdhock/lib/R/lib/libR.so)
>      > ==34394==    by 0x49F316B: R_ReplConsole (in
>     /home/tdhock/lib/R/lib/libR.so)
>      > ==34394==    by 0x49F4BA3: run_Rmainloop (in
>     /home/tdhock/lib/R/lib/libR.so)
>      > ==34394==    by 0x49F4BB9: Rf_mainloop (in
>     /home/tdhock/lib/R/lib/libR.so)
>      > ==34394==  Address 0x180 is not stack'd, malloc'd or (recently)
>     free'd
>      > ==34394==
>      >
>      >   *** caught segfault ***
>      > address 0x180, cause 'memory not mapped'
>      >
>      > Possible actions:
>      > 1: abort (with core dump, if enabled)
>      > 2: normal R exit
>      > 3: exit R without saving workspace
>      > 4: exit R saving workspace
>      > Selection:
>      >
>      > On Wed, Feb 5, 2025 at 11:22 AM Toby Hocking <tdhock5 using gmail.com
>     <mailto:tdhock5 using gmail.com>> wrote:
>      >
>      >> Hi, I'm not sure if this is a bug in R-devel or ESS, but I'm
>     reporting
>      >> here first.
>      >>
>      >> When I type foo() at the commend line, I expect R to give me an
>     error
>      >> message such as "function foo() not found" and that is what I
>     get using the
>      >> command line:
>      >> (base) tdhock using tdhock-MacBook:~/R/R-devel$ ~/R/R-devel/bin/R
>     --no-save -e
>      >> "foo()"
>      >>
>      >> R Under development (unstable) (2025-02-02 r87676) -- "Unsuffered
>      >> Consequences"
>      >> Copyright (C) 2025 The R Foundation for Statistical Computing
>      >> Platform: x86_64-pc-linux-gnu
>      >>
>      >> R est un logiciel libre livré sans AUCUNE GARANTIE.
>      >> Vous pouvez le redistribuer sous certaines conditions.
>      >> Tapez 'license()' ou 'licence()' pour plus de détails.
>      >>
>      >> R est un projet collaboratif avec de nombreux contributeurs.
>      >> Tapez 'contributors()' pour plus d'information et
>      >> 'citation()' pour la façon de le citer dans les publications.
>      >>
>      >> Tapez 'demo()' pour des démonstrations, 'help()' pour l'aide
>      >> en ligne ou 'help.start()' pour obtenir l'aide au format HTML.
>      >> Tapez 'q()' pour quitter R.
>      >>
>      >> Le chargement a nécessité le package : grDevices
>      >>> foo()
>      >> Erreur dans foo() : impossible de trouver la fonction "foo"
>      >> Exécution arrêtée
>      >>
>      >> But when I do the same thing inside ESS, R crashes.
>      >> Below I did C-u M-x R -d valgrind RET to start R with valgrind
>     inside ESS,
>      >> then I typed foo() RET in the *R* buffer, which crashed. Can anybody
>      >> reproduce?
>      >>
>      >> Can somebody help me reproduce this on the command line?
>     (outside of ESS)
>      >> so I can report this to R-devel?
>      >>
>      >> Thanks
>      >> Toby
>      >>
>      >
>      >       [[alternative HTML version deleted]]
>      >
>      > ______________________________________________
>      > ESS-help using r-project.org <mailto:ESS-help using r-project.org> mailing list
>      > https://stat.ethz.ch/mailman/listinfo/ess-help
>     <https://stat.ethz.ch/mailman/listinfo/ess-help>
>



More information about the ESS-help mailing list