NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

RE: lib/54272: libedit segfaults on Linux aarch64 build



I spent some more time debugging this today and you are correct that my fix is wrong. It looks like the tgetstr() call that you mentioned is returning a pointer to invalid memory. Here's the signature of tgetstr():
    char *tgetstr(char *id, char **area);
The difference between a good run on my x86_64 system and a bad run on my aarch64 system seems to be that the return pointer has the upper 16 bits all set (0xffff000000000000). For example, it returns 0xfffffffff89b7fa7 instead of 0xfffff89b7fa7 (which is a pointer to the area buffer that it updated). So it appears that this is in fact a problem somewhere in tgetstr() and not with libedit.

Mitch

-----Original Message-----
From: Christos Zoulas <christos%zoulas.com@localhost> 
Sent: Tuesday, June 4, 2019 7:55 PM
To: lib-bug-people%netbsd.org@localhost; gnats-admin%netbsd.org@localhost; netbsd-bugs%netbsd.org@localhost; Mitch Felton <Mitchell.Felton%wdc.com@localhost>
Subject: Re: lib/54272: libedit segfaults on Linux aarch64 build

The following reply was made to PR lib/54272; it has been noted by GNATS.

From: Christos Zoulas <christos%zoulas.com@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: lib-bug-people%netbsd.org@localhost,
 gnats-admin%netbsd.org@localhost,
 netbsd-bugs%netbsd.org@localhost
Subject: Re: lib/54272: libedit segfaults on Linux aarch64 build
Date: Tue, 4 Jun 2019 20:51:50 -0400

 This does not seem right:
 
 1. The "area" argument is not an argument to terminal_alloc(), but to =
 tgetstr() which takes as the third argument a char **. In fact you =  should get a warning if you remove the &.
 2. The initialization is extraneous since the area argument is only =  supposed to be used as scratch space in tgetstr().
 
 What might be happening, is that tgetstr() writes to the id argument on =  linux?
 
 christos=
 



Home | Main Index | Thread Index | Old Index