Displaying 14 results from an estimated 14 matches for "maxeltsize".
Did you mean:
max_tsize
1999 Oct 13
3
main/character.c (et.al): dangerous AllocBuffer()
...(triggered by substr()):
I assume that the helper function AllocBuffer() shall facilitate an economic memory management. But
the use of realloc() in the else-branch does not conform to ANSI and may hit you with certain
compilers.
When called with len<0 the code is assumed to re-size buff to MAXELTSIZE:
realloc(buff, 0);
buff = (char *) realloc(buff, MAXELTSIZE);
bufsize = MAXELTSIZE;
But in the first call of realloc() it is perfectly legal to return a new pointer (which is thrown away
here), and then using (a possibly invalid) buff from earlier times may (and did for me) crash your
progr...
1999 Oct 13
3
main/character.c (et.al): dangerous AllocBuffer()
...(triggered by substr()):
I assume that the helper function AllocBuffer() shall facilitate an economic memory management. But
the use of realloc() in the else-branch does not conform to ANSI and may hit you with certain
compilers.
When called with len<0 the code is assumed to re-size buff to MAXELTSIZE:
realloc(buff, 0);
buff = (char *) realloc(buff, MAXELTSIZE);
bufsize = MAXELTSIZE;
But in the first call of realloc() it is perfectly legal to return a new pointer (which is thrown away
here), and then using (a possibly invalid) buff from earlier times may (and did for me) crash your
progr...
1999 Aug 03
3
RW 0.64.2 substring() string truncation?
Hi,
(First, apology for my earlier incorrectly addressed "subscribe"
post.)
Can somebody tell me what exactly is going on below. Basically, I am
running into some kind of "string truncation" problem when I try
to get a substring starting past the 8192nd character (see sample
session below). There doesn't appear to be any problem creating the
string, and nchar()
2015 Sep 21
5
segfault with readDCF on R 3.1.2 on AIX 6.1 when using install.packages
...ex: src/main/dcf.c
===================================================================
--- src/main/dcf.c (revision 69404)
+++ src/main/dcf.c (working copy)
@@ -42,12 +42,12 @@
/* Use R_alloc as this might get interrupted */
static char *Rconn_getline2(Rconnection con)
{
- int c, bufsize = MAXELTSIZE, nbuf = -1;
+ int c, bufsize = MAXELTSIZE, nbuf = 0;
char *buf;
buf = R_alloc(bufsize, sizeof(char));
while((c = Rconn_fgetc(con)) != R_EOF) {
- if(nbuf+2 >= bufsize) { // allow for terminator below
+ if(nbuf+1 >= bufsize) { // allow for terminator below
bufsize *...
1999 Feb 09
0
load() -> segfault
...s which have
become horribly long during the simulation -- on the order of 20K
characters!
save() is perfectly happy to write these variable names out, but load()
segfaults because the "InString" family of functions use fixed size
buffer but don't check for overflow! The buffer is MAXELTSIZE bytes,
defined in $RHOME/src/inclide/Defn.h as 512. As you would expect,
reading a 20K object into a 512 byte buffer can really mess things up.
As noted in the comments of saveload.c,
/* FIXME : the fixed size buffer here is an abomination */
but that's not as bad as failing to check for o...
1999 Feb 09
0
load() -> segfault (PR#117)
...s which have
become horribly long during the simulation -- on the order of 20K
characters!
save() is perfectly happy to write these variable names out, but load()
segfaults because the "InString" family of functions use fixed size
buffer but don't check for overflow! The buffer is MAXELTSIZE bytes,
defined in $RHOME/src/inclide/Defn.h as 512. As you would expect,
reading a 20K object into a 512 byte buffer can really mess things up.
As noted in the comments of saveload.c,
/* FIXME : the fixed size buffer here is an abomination */
but that's not as bad as failing to check for o...
1999 Oct 30
1
read.table problem on Linux/Alpha (seg faults caused by isspace(R_EOF)) (PR#303)
...file didn't
have the newline char. For example, file like this:
23 3
31 2
24 1<EOF>
Here is a fix.
--- R-0.65.1/src/main/scan.c.orig Wed Sep 29 11:11:45 1999
+++ R-0.65.1/src/main/scan.c Fri Oct 29 17:34:22 1999
@@ -124,7 +124,7 @@
if (bufp >= &buffer[MAXELTSIZE - 2])
continue;
*bufp++ = c;
- } while (!isspace(c = scanchar()) && c != R_EOF);
+ } while ((c = scanchar()) != R_EOF && !isspace(c));
while (c==' ' || c=='\t')
c=scanchar();...
2009 Mar 18
1
sprintf("%d", integer(0)) aborts
...ap tibco.com
-------------------------------------------------------------------
Index: sprintf.c
===================================================================
--- sprintf.c (revision 48148)
+++ sprintf.c (working copy)
@@ -79,13 +79,13 @@
static R_StringBuffer outbuff = {NULL, 0, MAXELTSIZE};
Rboolean use_UTF8;
- outputString = R_AllocStringBuffer(0, &outbuff);
-
/* grab the format string */
nargs = length(args);
format = CAR(args);
- if (!isString(format) || length(format) == 0)
+ if (!isString(format))
error(_("'fmt' is not a no...
2015 Sep 21
0
segfault with readDCF on R 3.1.2 on AIX 6.1 when using install.packages
...===================================================
> --- src/main/dcf.c (revision 69404)
> +++ src/main/dcf.c (working copy)
> @@ -42,12 +42,12 @@
> /* Use R_alloc as this might get interrupted */
> static char *Rconn_getline2(Rconnection con)
> {
> - int c, bufsize = MAXELTSIZE, nbuf = -1;
> + int c, bufsize = MAXELTSIZE, nbuf = 0;
> char *buf;
>
> buf = R_alloc(bufsize, sizeof(char));
> while((c = Rconn_fgetc(con)) != R_EOF) {
> - if(nbuf+2 >= bufsize) { // allow for terminator below
> + if(nbuf+1 >= bufsize) { // allow fo...
2015 Sep 21
2
segfault with readDCF on R 3.1.2 on AIX 6.1 when using install.packages
Here's an update:
I checked the ChangeLog for R, and it seems like readDCF was changed
in 3.0.2. I went on a whim and copied src/main/dcf.c from R 2.15.3
over to 3.2.2, and R compiled fine and install.packages now work for
me.
This is probably not ideal, but it at least makes R usable on AIX for
me. Would definitely like to help figure out what's wrong with the
new dcf.c on AIX.
2008 Jun 13
1
parsing - input buffer overflow
Hi,
I am trying to parse a large amount of text using gregexpr(). Unfortunately,
I get an "input buffer overflow" message when I attempt that with too large
an amount of text. The error messages occurs before the parsing. The problem
is that I cannot assign the text to a variable (an object) if the text is
too large.
This problem has been mentioned before, which I found using the
2006 Jul 12
2
string-length limitations
Hi,
I'm attempting to "glm" a formula - something that's not caused problems in
the past. I've used formulas of the form
formula( "dependant-variable~independant-variables" )
where the independant variable string is of the form:
"indvar1+indvar2+...+indvarN"
Now, however, our independant variable strings are quite long (hundreds of
2012 Jan 13
0
WISHLIST: Be able to timeout readline()/stdin via setTimeLimit in all consoles
...ution or not. I located the
following native do_readln() function in src/main/scan.c that is
called by readline():
SEXP attribute_hidden do_readln(SEXP call, SEXP op, SEXP args, SEXP rho)
{
...
while ((c = ConsoleGetchar())!= '\n' && c != R_EOF) {
if (bufp >= &buffer[MAXELTSIZE - 2]) continue;
*bufp++ = c;
}
...
}
with ConsoleGetchar():
/* used by readline() and menu() */
static int ConsoleGetchar(void)
{
if (--ConsoleBufCnt < 0) {
ConsoleBuf[CONSOLE_BUFFER_SIZE] = '\0';
if (R_ReadConsole(ConsolePrompt, ConsoleBuf,
CONSOLE_BUFFER_SIZE, 0) ==...
1999 Mar 25
4
readline() (PR#147)
Dear R developers,
I have found the following bug with readline() in R 0.63.3:
if you execute the menu-function and then the readline() function, then
readline() prompts "Selection:"
> a <- readline()
hello
> a
[1] "hallo"
> a <- menu(c("a", "b"), title="bitte:")
bitte:
1:a
2:b
Selection: 2
> a <- readline()
Selection: