[PATCH] Use external tool for creating backtraces on crashes if available.

Matthias Hopf mhopf at suse.de
Tue Oct 19 10:15:11 PDT 2010


On Oct 19, 10 09:36:30 -0700, Keith Packard wrote:
> On Fri,  8 Oct 2010 18:25:12 +0200, Matthias Hopf <mhopf at suse.de> wrote:
> 
> > +    if (! (f = fdopen (fd, "r"))) {
> > +	ErrorF ("xorg_backtrace_gdb internal error 2\n");
> > +	close (fd);
> > +	return 1;
> > +    }
> > +    status = 0;
> > +    while (fgets (buf, 256, f)) {
> > +	status++;
> > +	ErrorF("%s", buf);
> > +    }
> > +    fclose (f);
> 
> I'd think you'd want to avoid anything that might allocate memory in
> this code; a rather common crash cause is smashing malloc data.

Hm. Right. fdopen malloc()s. Overlooked that.

Thanks

Matthias

-- 
Matthias Hopf <mhopf at suse.de>      __        __   __
Maxfeldstr. 5 / 90409 Nuernberg   (_   | |  (_   |__          mat at mshopf.de
Phone +49-911-74053-715           __)  |_|  __)  |__  R & D   www.mshopf.de


More information about the xorg-devel mailing list