[GRASS5] d.legend crash (R_*() related?)

Markus Neteler neteler at itc.it
Tue Aug 23 05:09:52 EDT 2005


On Mon, Aug 22, 2005 at 08:21:58PM -0700, Brad Douglas wrote:
> On Mon, 2005-08-22 at 21:43 +0200, Markus Neteler wrote:
> > On Mon, Aug 22, 2005 at 11:59:54AM -0700, Brad Douglas wrote:
> > > On Mon, 2005-08-22 at 16:38 +0200, Markus Neteler wrote:
> > > > 
> > > > The d.legend/d.rast.leg worked last week - may it be related to recent R_() changes?
> > > > 
> > > > d.legend works fine if I don't use d.font.freetype.
> > > > 
> > > > Actually I don't know how to debug this as d.legend apparently crashes in the
> > > > very first line.
> > > 
> > > Markus,
> > > 
> > > Could this be a 64bit issue?  I just updated my i686 machine and I'm
> > > unable to replicate the problem.
> >
> > maybe yes. But I used it successfully on the same machine last week.
> > I'll try again tomorrow (at home now). Maybe Huidae has an idea as well.
> 
> I had made some very minor changes over the weekend, but I temporarily
> backed most of them out and recompiled with no success.
> 

I have sort of located the problem:

I did:

d.mon x0
d.font.freetype font=/usr/X11R6/lib/X11/fonts/TTF/luxirr.ttf
d.legend evi_regress_4_6_2001.slope
*** glibc detected *** double free or corruption (out): 0x00000000005460f0 ***
ERROR eof from graphics driver.


In d.legend it crashes in D_add_to_list():

        if(!use_mouse)
            D_add_to_list(G_recreate_command()) ;

which goes to

int D_add_to_list( char *string)
{
        return(R_pad_append_item("list", string, 0)) ;
}

which goes to

Breakpoint 11, R_pad_append_item (item=0x2a9555e90e "list", value=0x52afa0 "d.legend map=\"evi_regress_4_6_2001.slope\" color=\"black\" lines=0 thin=1 labelnum=5", replace=0) at item_appnd.c:13

int R_pad_append_item ( char *item, char *value, int replace)
{
    char result;
    
    _hold_signals(1);
    
    _send_ident (PAD_APPEND_ITEM);
    _send_text (item);
    _send_text (value);
    _send_int (&replace);
    _get_char (&result);        <-- WOM!
    
    _hold_signals(0);
    
    return result;
}

in details the _get_char() function:
... where achar="list" when crashing in lib/raster/io.c:

int
_get_char(char *achar)
{
    flushout() ;                <- Monitor <x0>: Premature EOF
    _get (achar, 1);
    
    return 0;
}


Basically the flushout() is killing the monitor after using d.font.freetype.

Maybe something needs to be added to d.font.freetype due to the recent
R_*() or XDRIVER changes?

Any ideas?

 Markus




More information about the grass-dev mailing list