Jacek Caban jack@itma.pwr.wroc.pl writes:
--- libs/wpp/ppy.y 1 May 2003 03:16:21 -0000 1.1 +++ libs/wpp/ppy.y 30 Dec 2004 10:11:39 -0000 @@ -537,7 +537,10 @@ static int boolean(cval_t *v) static marg_t *new_marg(char *str, def_arg_t type) { marg_t *ma = pp_xmalloc(sizeof(marg_t));
- ma->arg = str;
- if(str)
ma->arg = pp_xstrdup(str);
- else
ma->type = type; ma->nnl = 0; return ma;ma->arg = NULL;
@@ -569,7 +572,7 @@ static mtext_t *new_mtext(char *str, int if(str == NULL) mt->subst.argidx = idx; else
mt->subst.text = str;
mt->subst.text = pp_xstrdup(str);
AFAICS the string is already duplicated everywhere these functions are called, so you are adding a memory leak here. Does this patch really make a difference in the behavior?
Alexandre Julliard wrote:
Jacek Caban jack@itma.pwr.wroc.pl writes:
--- libs/wpp/ppy.y 1 May 2003 03:16:21 -0000 1.1 +++ libs/wpp/ppy.y 30 Dec 2004 10:11:39 -0000 @@ -537,7 +537,10 @@ static int boolean(cval_t *v) static marg_t *new_marg(char *str, def_arg_t type) { marg_t *ma = pp_xmalloc(sizeof(marg_t));
- ma->arg = str;
- if(str)
ma->arg = pp_xstrdup(str);
- else
ma->type = type; ma->nnl = 0; return ma;ma->arg = NULL;
@@ -569,7 +572,7 @@ static mtext_t *new_mtext(char *str, int if(str == NULL) mt->subst.argidx = idx; else
mt->subst.text = str;
mt->subst.text = pp_xstrdup(str);
AFAICS the string is already duplicated everywhere these functions are called, so you are adding a memory leak here. Does this patch really make a difference in the behavior?
Now I see, it is duplicated. As I wrote, I couldn't reproduce this situation. I know only that it makes widl work for Dan Kegel and Stefan Leichter, as they reported, but, as often with memory overflow, it can be just a consident. Now I see that the bug is not here. The best way to find the bug would be to debug widl with the malloc debug library, but as it doesn't crash on my box, I'm not able to do it.
Thanks, Jacek
Am Mittwoch, 5. Januar 2005 20:09 schrieb Jacek Caban:
I know only that it makes widl work for Dan Kegel and Stefan Leichter, as they reported, but, as often with memory overflow, it can be just a consident. Now I see that the bug is not here. The best way to find the bug would be to debug widl with the malloc debug library, but as it doesn't crash on my box, I'm not able to do it.
Thanks, Jacek
Hello,
here is a another backtrace of widl with libefence. The crash is from wine-20041227-1114. The patch applied to wine before this snapshot raises the problem. The patch was:
Modified files: tools/widl : widl.c
Log message: Vincent Béron vberon@mecano.gme.usherb.ca Generate only wanted files.
Patch: http://cvs.winehq.org/patch.py?id=15042
Bye Stefan
Stefan Leichter wrote:
Hello,
here is a another backtrace of widl with libefence. The crash is from wine-20041227-1114. The patch applied to wine before this snapshot raises the problem. The patch was:
Modified files: tools/widl : widl.c
Log message: Vincent Béron vberon@mecano.gme.usherb.ca Generate only wanted files.
Patch: http://cvs.winehq.org/patch.py?id=15042
Bye Stefan
I think I found the bug. Could you try the attached patch?
Thanks, Jacek
Am Donnerstag, 6. Januar 2005 18:49 schrieb Jacek Caban:
Stefan Leichter wrote:
Hello,
here is a another backtrace of widl with libefence. The crash is from wine-20041227-1114. The patch applied to wine before this snapshot raises the problem. The patch was:
Modified files: tools/widl : widl.c
Log message: Vincent Béron vberon@mecano.gme.usherb.ca Generate only wanted files.
Patch: http://cvs.winehq.org/patch.py?id=15042
Bye Stefan
I think I found the bug. Could you try the attached patch?
Thanks, Jacek
Again a good shot. The patch fixes the problem for me.
Thanks Stefan