R-alpha: browser()

Thomas Lumley thomas@biostat.washington.edu
Wed, 6 Aug 1997 09:41:37 -0700 (PDT)


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
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-