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



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

From: Mitch Felton <Mitchell.Felton%wdc.com@localhost>
To: "gnats-bugs%netbsd.org@localhost" <gnats-bugs%netbsd.org@localhost>,
	"lib-bug-people%netbsd.org@localhost" <lib-bug-people%netbsd.org@localhost>,
	"gnats-admin%netbsd.org@localhost" <gnats-admin%netbsd.org@localhost>, "netbsd-bugs%netbsd.org@localhost"
	<netbsd-bugs%netbsd.org@localhost>
Cc: 
Subject: RE: lib/54272: libedit segfaults on Linux aarch64 build
Date: Fri, 7 Jun 2019 14:40:02 +0000

 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 a=
 arch64 system seems to be that the return pointer has the upper 16 bits all=
  set (0xffff000000000000). For example, it returns 0xfffffffff89b7fa7 inste=
 ad 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>=20
 Sent: Tuesday, June 4, 2019 7:55 PM
 To: lib-bug-people%netbsd.org@localhost; gnats-admin%netbsd.org@localhost; netbsd-bugs@netbsd.o=
 rg; 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:
 =20
  1. The "area" argument is not an argument to terminal_alloc(), but to =3D
  tgetstr() which takes as the third argument a char **. In fact you =3D  sh=
 ould get a warning if you remove the &.
  2. The initialization is extraneous since the area argument is only =3D  s=
 upposed to be used as scratch space in tgetstr().
 =20
  What might be happening, is that tgetstr() writes to the id argument on =
 =3D  linux?
 =20
  christos=3D
 =20
 



Home | Main Index | Thread Index | Old Index