Hi all,
Now it starts, but when i try to load a page it crashes: I think this link may have some clue as to why this occurs: http://sourceware.org/ml/glibc-bugs/2007-08/msg00148.html Confirmed, copying the va_list in dStr_vsprintfa (dlib.c) fixes the crash for me and i'm now able to display pages.
Can you make a patch so i can try? that page is too much technical for my sparse knowledge, i didnt understand anything :)
On Oct 05 21:17:47, Vincent Thomasset wrote:
--- dillo-f15.orig/dlib/dlib.c 2007-09-30 23:14:00.000000000 +0200 +++ dillo-f15/dlib/dlib.c 2007-10-05 21:10:14.000000000 +0200 @@ -345,8 +345,11 @@ int n, n_sz;
if (ds && format) { + va_list copy; while (1) { - n = vsnprintf(ds->str + ds->len, ds->sz - ds->len, format, argp); + va_copy(copy, argp); + n = vsnprintf(ds->str + ds->len, ds->sz - ds->len, format, copy); + va_end(copy); if (n > -1 && n < ds->sz - ds->len) { ds->len += n; /* Success! */ break; @@ -358,6 +361,7 @@ dStr_resize(ds, n_sz, (ds->len > 0) ? 1 : 0); } } + }
I am not sure Vincent's diff has been applied correctly to the CVS source. Now dillo2/dlib/dlib.c says void dStr_vsprintfa (Dstr *ds, const char *format, va_list argp) { int n, n_sz; if (ds && format) { va_list argp2; /* Needed in case of looping on non-32bit arch */ while (1) { va_copy(argp2, argp); n = vsnprintf(ds->str + ds->len, ds->sz - ds->len, format, argp); va_end(argp2); [...] } I think the point was to feed vsnprintf with the _copy_ (that is, argp2 in this naming); this code does not use the copy in any way (gives the original argp to vsnprintf). When compiled like this, dillo crashes during first few pages. With - n = vsnprintf(ds->str + ds->len, ds->sz - ds->len, format, argp); + n = vsnprintf(ds->str + ds->len, ds->sz - ds->len, format, argp2); the problem seems to disappear. Jan