Roger.Bivand@nhh.no
2000-Feb-07 21:04 UTC
[Rd] Segmentation fault, devPS.c, 0.99.0 (PR#413)
Full_Name: Roger Bivand Version: 0.99.0 OS: RH Linux 6.1 Submission from: (NULL) (158.37.60.152) I am working on an interface between R and the GRASS geographical information system, written in R, with no dynamically loaded code. I have written full examples, and tested then under R 0.90.1, both by entering example() for each function and R CMD check, both of which worked without problem. Under 0.99.0 however, R CMD check gives a segmentation fault, but running the examples by hand (X11 not PostScript output) doesn't: Core was generated by `/usr/local/lib/R/bin/R.X11 --vanilla'. Program terminated with signal 11, Segmentation fault. Reading symbols from /usr/X11R6/lib/libSM.so.6...done. Reading symbols from /usr/X11R6/lib/libICE.so.6...done. Reading symbols from /usr/X11R6/lib/libX11.so.6...done. Reading symbols from /usr/lib/libblas.so.2...done. Reading symbols from /lib/libm.so.6...done. Reading symbols from /usr/lib/libreadline.so.3...done. Reading symbols from /usr/lib/libz.so.1...done. Reading symbols from /lib/libdl.so.2...done. Reading symbols from /usr/lib/libncurses.so.4...done. Reading symbols from /lib/libc.so.6...done. Reading symbols from /lib/libtermcap.so.2...done. Reading symbols from /lib/ld-linux.so.2...done. Reading symbols from /usr/lib/gconv/ISO8859-1.so...done. Reading symbols from /usr/local/lib/R/library/akima/libs/akima.so...done. Reading symbols from /usr/local/lib/R/library/MASS/libs/MASS.so...done. Reading symbols from /usr/local/lib/R/library/spatial/libs/spatial.so...done. Reading symbols from /usr/local/lib/R/library/modreg/libs/modreg.so...done. #0 0x4021df2a in _IO_vfprintf (s=0x726b2e78, format=0x811ad81 "ep\n", ap=0xbfffde18) at vfprintf.c:1024 1024 vfprintf.c: No such file or directory. #1 0x40225f47 in fprintf (stream=0x726b2e78, format=0x811ad81 "ep\n") at fprintf.c:32 32 fprintf.c: No such file or directory. (gdb) up #2 0x806ca78 in PostScriptEndPage (fp=0x726b2e78) at devPS.c:513 513 fprintf(fp, "ep\n"); (gdb) up #3 0x806d953 in PS_NewPage (dd=0x81df2d0) at devPS.c:1015 1015 if(pd->pageno > 1) PostScriptEndPage(pd->psfp); (gdb) up #4 0x8087c75 in Rf_GNewPlot (recording=1, ask=-2147483648) at graphics.c:1781 1781 dd->dp.newPage(dd); (gdb) up #5 0x80a33ab in do_plot_new (call=0x405ba44c, op=0x402e01b8, args=0x409418e0, env=0x40941944) at plot.c:370 370 dd = GNewPlot(call != R_NilValue, ask); (gdb) up #6 0x8095765 in do_internal (call=0x405ba4b0, op=0x402d8d00, args=0x405ba49c, env=0x40941944) at names.c:862 862 args = PRIMFUN(INTERNAL(fun)) (s, INTERNAL(fun), args, env); #7 0x807c6a1 in Rf_eval (e=0x405ba4b0, rho=0x40941944) at eval.c:172 172 tmp = PRIMFUN(op) (e, op, CDR(e), rho); (gdb) up #8 0x807cb40 in Rf_applyClosure (call=0x405b6a7c, op=0x405ba550, arglist=0x402d8008, rho=0x409437bc, suppliedenv=0x402d8008) at eval.c:342 342 PROTECT(tmp = eval(body, newrho)); (gdb) up #9 0x807c7cb in Rf_eval (e=0x405b6a7c, rho=0x409437bc) at eval.c:192 192 tmp = applyClosure(e, op, tmp, rho, R_NilValue); (gdb) up #10 0x807d4c7 in do_begin (call=0x405b5e88, op=0x402d8954, args=0x405b5e9c, rho=0x409437bc) at eval.c:639 639 s = eval(CAR(args), rho); (gdb) up #11 0x807c6a1 in Rf_eval (e=0x405b5e88, rho=0x409437bc) at eval.c:172 172 tmp = PRIMFUN(op) (e, op, CDR(e), rho); (gdb) up #12 0x807cb40 in Rf_applyClosure (call=0x4094425c, op=0x405b73dc, arglist=0x40944e00, rho=0x40944540, suppliedenv=0x409442fc) at eval.c:342 342 PROTECT(tmp = eval(body, newrho)); #13 0x8095977 in applyMethod (call=0x4094425c, op=0x405b73dc, args=0x40944e00, rho=0x40944540, newrho=0x409442fc) at objects.c:68 68 ans = applyClosure(call, op, args, rho, newrho); (gdb) up #14 0x8095e48 in Rf_usemethod (generic=0xbfffe438 "plot", obj=0x4094f5a8, call=0x405b521c, args=0x402d8008, rho=0x40944540, ans=0xbfffe434) at objects.c:197 197 *ans = applyMethod(t, sxp, matchedarg, rho, newrho); (gdb) up #15 0x8095fd3 in do_usemethod (call=0x405b521c, op=0x402e0a78, args=0x405b5208, env=0x40944540) at objects.c:251 251 if (usemethod(buf, obj, call, CDR(args), env, &ans) == 1) { (gdb) up #16 0x807c6a1 in Rf_eval (e=0x405b521c, rho=0x40944540) at eval.c:172 172 tmp = PRIMFUN(op) (e, op, CDR(e), rho); (gdb) up #17 0x807cd8d in do_if (call=0x405b526c, op=0x402d84f4, args=0x405b5258, rho=0x40944540) at eval.c:428 428 return (eval(CAR(CDR(CDR(args))), rho)); (gdb) up #18 0x807c6a1 in Rf_eval (e=0x405b526c, rho=0x40944540) at eval.c:172 172 tmp = PRIMFUN(op) (e, op, CDR(e), rho); The examples do use MASS, spatial, akima, and modreg, and the first three of these have been REMOVEd and freshly INSTALLed, just in case, but the problem appears to be in the postscript output. If you might find it useful to see the code, I could make it available, but I don't think that you really need (!) to install GRASS, unless you know definitely that you do! -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Peter Dalgaard BSA
2000-Feb-07 22:44 UTC
[Rd] Segmentation fault, devPS.c, 0.99.0 (PR#413)
Roger.Bivand@nhh.no writes:> Full_Name: Roger Bivand > Version: 0.99.0 > OS: RH Linux 6.1 > Submission from: (NULL) (158.37.60.152)...> #0 0x4021df2a in _IO_vfprintf (s=0x726b2e78, format=0x811ad81 "ep\n", > ap=0xbfffde18) at vfprintf.c:1024 > 1024 vfprintf.c: No such file or directory. > #1 0x40225f47 in fprintf (stream=0x726b2e78, format=0x811ad81 "ep\n") > at fprintf.c:32 > 32 fprintf.c: No such file or directory. > (gdb) up > #2 0x806ca78 in PostScriptEndPage (fp=0x726b2e78) at devPS.c:513 > 513 fprintf(fp, "ep\n"); > (gdb) up...> The examples do use MASS, spatial, akima, and modreg, and the first three of > these > have been REMOVEd and freshly INSTALLed, just in case, but the problem appears > to > be in the postscript output. If you might find it useful to see the code, I > could > make it available, but I don't think that you really need (!) to install GRASS, > unless > you know definitely that you do!Hmm. This looks a bit nasty. You're hitting a segmentation fault inside of an fprintf call, which likely means either that you're badly out of memory (not really likely) or that the FILE structure "stream" (alias "s" alis "fp" at 0x726b2e78) has gotten corrupted. If you run the same example under the debugger, you might go in and see what got corrupted (run till crash then "up", "up", "p *fp" to get started) and see at what point in the execution it happened (this is what gdb's hardware watchpoints are for...). -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Duncan Temple Lang
2000-Feb-08 00:25 UTC
[Rd] Segmentation fault, devPS.c, 0.99.0 (PR#413)
Just as remote possibility, but a potentially impossible bug source, Signal 11 errors are often associated with hardware (commonly memory) errors. Is that in any way a reasonable explanation? (There are some interesting web pages if you search for signal 11 segmentation.) Duncan.> From: Roger.Bivand@nhh.no > Date: Mon, 7 Feb 2000 22:04:18 +0100 (MET) > CC: R-bugs@biostat.ku.dk > Sender: owner-r-devel@stat.math.ethz.ch > Precedence: bulk > > Full_Name: Roger Bivand > Version: 0.99.0 > OS: RH Linux 6.1 > Submission from: (NULL) (158.37.60.152) > > > I am working on an interface between R and the GRASS geographical information > system, > written in R, with no dynamically loaded code. I have written full examples, and > tested > then under R 0.90.1, both by entering example() for each function and R CMD > check, both > of which worked without problem. > > Under 0.99.0 however, R CMD check gives a segmentation fault, but running the > examples by hand (X11 not PostScript output) doesn't: > > Core was generated by `/usr/local/lib/R/bin/R.X11 --vanilla'. > Program terminated with signal 11, Segmentation fault. > Reading symbols from /usr/X11R6/lib/libSM.so.6...done. > Reading symbols from /usr/X11R6/lib/libICE.so.6...done. > Reading symbols from /usr/X11R6/lib/libX11.so.6...done. > Reading symbols from /usr/lib/libblas.so.2...done. > Reading symbols from /lib/libm.so.6...done. > Reading symbols from /usr/lib/libreadline.so.3...done. > Reading symbols from /usr/lib/libz.so.1...done. > Reading symbols from /lib/libdl.so.2...done. > Reading symbols from /usr/lib/libncurses.so.4...done. > Reading symbols from /lib/libc.so.6...done. > Reading symbols from /lib/libtermcap.so.2...done. > Reading symbols from /lib/ld-linux.so.2...done. > Reading symbols from /usr/lib/gconv/ISO8859-1.so...done. > Reading symbols from /usr/local/lib/R/library/akima/libs/akima.so...done. > Reading symbols from /usr/local/lib/R/library/MASS/libs/MASS.so...done. > Reading symbols from /usr/local/lib/R/library/spatial/libs/spatial.so...done. > Reading symbols from /usr/local/lib/R/library/modreg/libs/modreg.so...done. > #0 0x4021df2a in _IO_vfprintf (s=0x726b2e78, format=0x811ad81 "ep\n", > ap=0xbfffde18) at vfprintf.c:1024 > 1024 vfprintf.c: No such file or directory. > #1 0x40225f47 in fprintf (stream=0x726b2e78, format=0x811ad81 "ep\n") > at fprintf.c:32 > 32 fprintf.c: No such file or directory. > (gdb) up > #2 0x806ca78 in PostScriptEndPage (fp=0x726b2e78) at devPS.c:513 > 513 fprintf(fp, "ep\n"); > (gdb) up > #3 0x806d953 in PS_NewPage (dd=0x81df2d0) at devPS.c:1015 > 1015 if(pd->pageno > 1) PostScriptEndPage(pd->psfp); > (gdb) up > #4 0x8087c75 in Rf_GNewPlot (recording=1, ask=-2147483648) at graphics.c:1781 > 1781 dd->dp.newPage(dd); > (gdb) up > #5 0x80a33ab in do_plot_new (call=0x405ba44c, op=0x402e01b8, args=0x409418e0, > env=0x40941944) at plot.c:370 > 370 dd = GNewPlot(call != R_NilValue, ask); > (gdb) up > #6 0x8095765 in do_internal (call=0x405ba4b0, op=0x402d8d00, args=0x405ba49c, > env=0x40941944) at names.c:862 > 862 args = PRIMFUN(INTERNAL(fun)) (s, INTERNAL(fun), args, env); > #7 0x807c6a1 in Rf_eval (e=0x405ba4b0, rho=0x40941944) at eval.c:172 > 172 tmp = PRIMFUN(op) (e, op, CDR(e), rho); > (gdb) up > #8 0x807cb40 in Rf_applyClosure (call=0x405b6a7c, op=0x405ba550, > arglist=0x402d8008, rho=0x409437bc, suppliedenv=0x402d8008) at eval.c:342 > 342 PROTECT(tmp = eval(body, newrho)); > (gdb) up > #9 0x807c7cb in Rf_eval (e=0x405b6a7c, rho=0x409437bc) at eval.c:192 > 192 tmp = applyClosure(e, op, tmp, rho, R_NilValue); > (gdb) up > #10 0x807d4c7 in do_begin (call=0x405b5e88, op=0x402d8954, args=0x405b5e9c, > rho=0x409437bc) at eval.c:639 > 639 s = eval(CAR(args), rho); > (gdb) up > #11 0x807c6a1 in Rf_eval (e=0x405b5e88, rho=0x409437bc) at eval.c:172 > 172 tmp = PRIMFUN(op) (e, op, CDR(e), rho); > (gdb) up > #12 0x807cb40 in Rf_applyClosure (call=0x4094425c, op=0x405b73dc, > arglist=0x40944e00, rho=0x40944540, suppliedenv=0x409442fc) at eval.c:342 > 342 PROTECT(tmp = eval(body, newrho)); > #13 0x8095977 in applyMethod (call=0x4094425c, op=0x405b73dc, args=0x40944e00, > rho=0x40944540, newrho=0x409442fc) at objects.c:68 > 68 ans = applyClosure(call, op, args, rho, newrho); > (gdb) up > #14 0x8095e48 in Rf_usemethod (generic=0xbfffe438 "plot", obj=0x4094f5a8, > call=0x405b521c, args=0x402d8008, rho=0x40944540, ans=0xbfffe434) > at objects.c:197 > 197 *ans = applyMethod(t, sxp, matchedarg, rho, newrho); > (gdb) up > #15 0x8095fd3 in do_usemethod (call=0x405b521c, op=0x402e0a78, > args=0x405b5208, env=0x40944540) at objects.c:251 > 251 if (usemethod(buf, obj, call, CDR(args), env, &ans) == 1) { > (gdb) up > #16 0x807c6a1 in Rf_eval (e=0x405b521c, rho=0x40944540) at eval.c:172 > 172 tmp = PRIMFUN(op) (e, op, CDR(e), rho); > (gdb) up > #17 0x807cd8d in do_if (call=0x405b526c, op=0x402d84f4, args=0x405b5258, > rho=0x40944540) at eval.c:428 > 428 return (eval(CAR(CDR(CDR(args))), rho)); > (gdb) up > #18 0x807c6a1 in Rf_eval (e=0x405b526c, rho=0x40944540) at eval.c:172 > 172 tmp = PRIMFUN(op) (e, op, CDR(e), rho); > > The examples do use MASS, spatial, akima, and modreg, and the first three of > these > have been REMOVEd and freshly INSTALLed, just in case, but the problem appears > to > be in the postscript output. If you might find it useful to see the code, I > could > make it available, but I don't think that you really need (!) to install GRASS, > unless > you know definitely that you do! > > > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > 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 > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ >-- _______________________________________________________________ Duncan Temple Lang duncan@research.bell-labs.com Bell Labs, Lucent Technologies office: (908)582-3217 700 Mountain Avenue, Room 2C-259 fax: (908)582-3340 Murray Hill, NJ 07974-2070 http://cm.bell-labs.com/stat/duncan "Languages shape the way we think, and determine what we can think about." Benjamin Whorf -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Duncan: I'll check the site you referred to. On the machine with problems, powering down and restarting, then running R -d gdb, run --vanilla < GRASS-Ex.R - as Peter suggested, led to the same sig11, which makes me feel that maybe it's not just memory, because R is certainly loaded somewhere else in physical space with no GUI running, and nothing coming from cache. If it's any help, a rerun with the GUI up to copy & paste output gives: rst.pt> rast.put(G, lname = nameR[2], layer = tr3, title = "Cubic trend surface") CREATING SUPPORT FILES FOR ex.tr3.in rst.pt> rast.put(G, lname = nameR[3], layer = kr3, title = "Kriged surface") CREATING SUPPORT FILES FOR ex.kr3.in rst.pt> rast.put(G, lname = nameR[4], layer = predlo.pcbs, title = "Loess surface") CREATING SUPPORT FILES FOR ex.loess.in rst.pt> rast.put(G, lname = nameR[5], layer = codes(kr3.o), cat = T, title = "Kriged surface categories") CREATING SUPPORT FILES FOR ex.kr3o.in rst.pt> for (i in 1:5) system(paste("r.info map=", nameR[i], sep = "")) ...> system("s.surf.rst input=ex.pcbslog.in elev=ex.rst tension=160smooth=0.0 segmax=700") Version: GRASS5.0 beta, last update: Nov 9 1999 input is x|y|%z1 %z2..., output is FP raster files Authors: original version L.Mitas, H.Mitasova GRASS implementation I.Kosinovsky, D.P. Gerdes ... Percent complete: 100% history initiated> exget <- rast.get(G, rlist=c("ex.akspl.in", "ex.kr3.in", "ex.loess.in","ex.rst"))> oldpar <- par(mfrow=c(2,2)) > plot(G, exget$ex.akspl.in)---------------------------------------------------- # Copyright 1999-2000 by Roger S. Bivand # # # plot.grassmeta provides a simple interface between grass data # objects and the image() function; category layers may be plotted # by taking codes() of the layer, and setting zlim to non-default values. # If layer is not set, a blank base map is plotted, for instance for use # with points(). # plot.grassmeta <- function(G, layer=NULL, xlab="", ylab="", ...) { if (class(G) != "grassmeta") stop("Data not a grass object") require(MASS) eqscplot(G$xlim, G$ylim, xlab=xlab, ylab=ylab, type="n", ...) if (!is.null(layer)) { if (length(layer) != G$Ncells) stop("GRASS object metadata do not match layer length") image(x=G$xseq, y=G$yseq, z=t(matrix(layer[G$reverse], nrow=G$Nrow, ncol=G$Ncol, byrow=T)), add=T, ...) } } ---------------------------------------------------- Program received signal SIGSEGV, Segmentation fault. 0x4021df2a in _IO_vfprintf (s=0x20203665, format=0x811ad81 "ep\n", ap=0xbfffde58) at vfprintf.c:1024 1024 vfprintf.c: No such file or directory. (gdb) up #1 0x40225f47 in fprintf (stream=0x20203665, format=0x811ad81 "ep\n") at fprintf.c:32 32 fprintf.c: No such file or directory. (gdb) up #2 0x806ca78 in PostScriptEndPage (fp=0x20203665) at devPS.c:513 513 fprintf(fp, "ep\n"); (gdb) p *fp Cannot access memory at address 0x20203665. (gdb) p fp $1 = (FILE *) 0x20203665 (gdb) up #3 0x806d953 in PS_NewPage (dd=0x81df2d0) at devPS.c:1015 1015 if(pd->pageno > 1) PostScriptEndPage(pd->psfp); (gdb) p pd->psfp $2 = (FILE *) 0x20203665 (gdb) p pd->pageno $3 = 1920216697 (gdb) up #4 0x8087c75 in Rf_GNewPlot (recording=1, ask=-2147483648) at graphics.c:1781 1781 dd->dp.newPage(dd); (including the function where the problem occurs). The (FILE *) looks healthy enough to me, so I'll accept that the problem is a machine idiosyncracy. I'll work out a way for the examples to "know" if they are being run from GRASS-Ex.R, and if so, drop most of the graphic output, leaving it in for regular example() execution. Thanks for useful advice, Roger -- Roger Bivand Department of Geography, Norwegian School of Economics and Business Administration, Breiviksveien 40, N-5045 Bergen, Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93 e-mail: Roger.Bivand@nhh.no -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
p.dalgaard@biostat.ku.dk
2000-Feb-08 19:47 UTC
[Rd] Segmentation fault, devPS.c, 0.99.0 (PR#413)
Peter Dalgaard BSA <p.dalgaard@biostat.ku.dk> writes:> I wouldn't think so! 0x20203665 looks suspiciously like a bit of a text > string. "e6 " to be precise (give or take byte ordering issues). And > the pointer is not pointing anywhere useful. I think something is > walking over pd->psfp > > Next step would be to find out where that happens. If you set aOK, it's dead and strsplit() was to blame. Here's the patch Index: src/main/character.c ==================================================================RCS file: /home/rdevel/CVS-ARCHIVE/R/src/main/character.c,v retrieving revision 1.34 diff -u -r1.34 character.c --- src/main/character.c 2000/01/21 16:49:19 1.34 +++ src/main/character.c 2000/02/08 19:38:16 @@ -150,7 +150,7 @@ { SEXP s, t, tok, x; int i, j, len, tlen, ntok; - char *pt = NULL, *split = ""; + char *pt = NULL, *split = "", *bufp; regex_t reg; regmatch_t regmatch[1]; @@ -177,39 +177,40 @@ */ if(regcomp(®, split, 0)) errorcall(call, "invalid split pattern"); - while(regexec(®, buff, 1, regmatch, 0) == 0) { + bufp = buff; + while(regexec(®, bufp, 1, regmatch, 0) == 0) { /* Empty matches get the next char, so move by one. */ - buff += MAX(regmatch[0].rm_eo, 1); + bufp += MAX(regmatch[0].rm_eo, 1); ntok++; - if (*buff == '\0') + if (*bufp == '\0') break; } - if(*buff == '\0') + if(*bufp == '\0') PROTECT(t = allocVector(STRSXP, ntok)); else PROTECT(t = allocVector(STRSXP, ntok + 1)); /* and fill with the splits */ - strcpy(buff, CHAR(STRING(x)[i])); + bufp = buff; pt = (char *) realloc(pt, (strlen(buff)+1)*sizeof(char)); for(j = 0; j < ntok; j++) { - regexec(®, buff, 1, regmatch, 0); + regexec(®, bufp, 1, regmatch, 0); if(regmatch[0].rm_eo > 0) { /* Match was non-empty. */ if(regmatch[0].rm_so > 0) - strncpy(pt, buff, regmatch[0].rm_so); + strncpy(pt, bufp, regmatch[0].rm_so); pt[regmatch[0].rm_so] = '\0'; - buff += regmatch[0].rm_eo; + bufp += regmatch[0].rm_eo; } else { /* Match was empty. */ - pt[0] = *buff; + pt[0] = *bufp; pt[1] = '\0'; buff++; } STRING(t)[j] = mkChar(pt); } - if(*buff != '\0') - STRING(t)[ntok] = mkChar(buff); + if(*bufp != '\0') + STRING(t)[ntok] = mkChar(bufp); } else { char bf[2]; -- O__ ---- Peter Dalgaard Blegdamsvej 3 c/ /'_ --- Dept. of Biostatistics 2200 Cph. N (*) \(*) -- University of Copenhagen Denmark Ph: (+45) 35327918 ~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk) FAX: (+45) 35327907 -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- 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 _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Reasonably Related Threads
- [Bug 20298] New: Nouveau doesn' t allow my modeline because of hardcoded value
- "bug" and patch: quadratic running time for strsplit(..., fixed=TRUE) (PR#9902)
- problem gsub in the locale of CP932 and SJIS (PR#9751)
- S_alloc or Calloc for return value
- [Bug 14567] New: Randr 1.2 fails on nv17 lvds in a Dell Inspiron 8100 ( continued from 14491)