From thomas@biostat.washington.edu  Wed Aug  6 17:41:37 1997
From: thomas@biostat.washington.edu (Thomas Lumley)
Date: Wed, 6 Aug 1997 09:41:37 -0700 (PDT)
Subject: R-alpha: browser()
In-Reply-To: <199708060311.PAA14297@stat1.stat.auckland.ac.nz>
Message-ID: <Pine.SUN.3.95.970806093214.2623A-100000@zen>


Kurt pointed out that
R> browser() 
is now the shortest segfault.  The problem is in do_browser in main.c at
about line 420:
       if( !DEBUG(rho) ) {
                cptr=R_GlobalContext;
                while (cptr->callflag != CTXT_RETURN) 
                        cptr = cptr->nextcontext;
                Rprintf("Called from: ");
                PrintValueRec(cptr->call);
        }
When browser() is called from the top level rather than from a function we
have cptr->callflag==CTXT_TOPLEVEL, so the test succeeds, but as there are
no other contexts we have cptr->nextcontext==NULL and a segfault.


Thomas Lumley
------------------------------------------------------+------
Biostatistics		: "Never attribute to malice what  :
Uni of Washington	:  can be adequately explained by  :
Box 357232		:  incompetence" - Hanlon's Razor  :
Seattle WA 98195-7232	:				   :
------------------------------------------------------------

=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
r-devel mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-devel-request@stat.math.ethz.ch
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


R-alpha: browser()
Thomas Lumley