Re: Need support in debugging Valgrind 3.18 glibc segv error

kiran hardas <[email protected]> Thu, 30 Jan 2025 01:00:49 +0530
Newsgroups gmane.comp.debugging.valgrind
Message-ID <CAPyEgmaffx-xH4Dd4X3_GmEC6PCWex2XmfWwVB4jRgj76m=q3Q@mail.gmail.com>
--===============1614960580342350054==
Content-Type: multipart/alternative; boundary="0000000000007d8950062cdd5951"

--0000000000007d8950062cdd5951
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Yes Philippe, I did try out Valgrind 3.24, but it too gave same error.

Regards,
Kiran H.

On Wed, Jan 29, 2025 at 11:56=E2=80=AFPM Philippe Waroquiers <
[email protected]> wrote:

> The first thing to try is to compile and use a more recent valgrind
> version.
> (3.18 is something like 4 years old while 3.24 is from Oct 24).
>
> Thanks
> Philippe
>
>
> On Wed, 2025-01-29 at 19:03 +0530, kiran hardas wrote:
> > Hi Team,
> >
> > Good Evening,
> >
> > I need some support in debugging an issue in Valgrind 3.18.
> >
> > I have an application which I am trying to check with Valgrind tool for
> memory issues. I
> > have the valgrind source code which is compiled and built along with my
> application
> > using same set of libraries. But while checking with valgrind tool i ge=
t
> an invalid
> > address error in libc library (mostly implying null pointer
> dereferencing/free) and
> > valgrind is terminating. I am unable to find the exact place in glibc
> code where this
> > error is coming from and need any help which you can provide.
> >
> > Please find further details below,
> >
> > $ ./usr/test/bin/valgrind --version -v
> > valgrind-3.18.1-42b08ed5bd-20211015
> >
> > GNU/Linux 5.4
> > Glibc 2.40
> > gcc 14.2
> > binutils 2.43
> >
> > This same valgrind was working when i was using glibc 2.23 but giving
> this error when i
> > upgraded glibc to 2.40
> > For valgrind 3.18 i have applied rseq patches and nop code error (0x2E
> 0x8D 0xB4 0x26)
> > patches also required for latest glibc 2.40.
> >
> > Error log snippet:
> > ------------------------
> > ...
> > ...
> > =3D=3D13089=3D=3D
> > --13089-- REDIR: 0x1f749f60 (libc.so.6:???) redirected to 0x1e59bd70
> (strcmp)
> > =3D=3D13089=3D=3D Jump to the invalid address stated on the next line
> > =3D=3D13089=3D=3D    at 0x0: ???
> > =3D=3D13089=3D=3D    by 0x1F607366: ??? (in /lib/libc-2.40.so)
> > =3D=3D13089=3D=3D    by 0x1F607423: (below main) (in /lib/libc-2.40.so)
> > =3D=3D13089=3D=3D  Address 0x0 is not stack'd, malloc'd or (recently) f=
ree'd
> > =3D=3D13089=3D=3D
> > =3D=3D13089=3D=3D
> > =3D=3D13089=3D=3D Process terminating with default action of signal 11
> (SIGSEGV): dumping core
> > =3D=3D13089=3D=3D  Bad permissions for mapped region at address 0x0
> > =3D=3D13089=3D=3D    at 0x0: ???
> > =3D=3D13089=3D=3D    by 0x1F607366: ??? (in /lib/libc-2.40.so)
> > =3D=3D13089=3D=3D    by 0x1F607423: (below main) (in /lib/libc-2.40.so)
> > =3D=3D13089=3D=3D
> >
> >
> > Approaches tried
> > -----------------------
> > 1. I reduced the optimisation level in glibc to -O1, but still no
> further symbol details
> > are available
> > 2. The core file generated for valgrind crash is also not showing any
> symbol details at
> > crash point. (only showing ??)
> > 3. Tried adding more option to valgrind like --track-origins=3Dyes
> , --read-var-info=3Dyes .
> > But not giving any more info for the error.
> >
> >
> > I would appreciate any pointers team can provide in debugging this issu=
e.
> >
> > Thanks in advance
> >
> > Regards,
> > Kiran H.
> >
> > _______________________________________________
> > Valgrind-users mailing list
> > [email protected]
> > https://lists.sourceforge.net/lists/listinfo/valgrind-users
>
>

--0000000000007d8950062cdd5951
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">Yes Philippe, I did try out Valgrind 3.24, but it too gave=
 same error.<div><br></div><div>Regards,</div><div>Kiran H.</div></div><br>=
<div class=3D"gmail_quote gmail_quote_container"><div dir=3D"ltr" class=3D"=
gmail_attr">On Wed, Jan 29, 2025 at 11:56=E2=80=AFPM Philippe Waroquiers &l=
t;<a href=3D"mailto:[email protected]">philippe.waroquiers@skyn=
et.be</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D"ma=
rgin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:=
1ex">The first thing to try is to compile and use a more recent valgrind ve=
rsion.<br>
(3.18 is something like 4 years old while 3.24 is from Oct 24).<br>
<br>
Thanks<br>
Philippe<br>
<br>
<br>
On Wed, 2025-01-29 at 19:03 +0530, kiran hardas wrote:<br>
&gt; Hi Team,<br>
&gt; <br>
&gt; Good Evening,<br>
&gt; <br>
&gt; I need some support in debugging an issue in Valgrind 3.18.=C2=A0<br>
&gt; <br>
&gt; I have an application which I am trying to check with Valgrind tool fo=
r memory issues. I<br>
&gt; have the valgrind source code which is compiled and built along with m=
y application<br>
&gt; using same=C2=A0set of libraries. But while checking with valgrind too=
l i get an=C2=A0invalid<br>
&gt; address error in libc library (mostly implying null pointer dereferenc=
ing/free) and<br>
&gt; valgrind is terminating. I am unable to find the exact place in glibc =
code where this<br>
&gt; error is coming from and need any help which you can provide.<br>
&gt; <br>
&gt; Please find further=C2=A0details below,<br>
&gt; <br>
&gt; $ ./usr/test/bin/valgrind --version -v<br>
&gt; valgrind-3.18.1-42b08ed5bd-20211015<br>
&gt; <br>
&gt; GNU/Linux 5.4<br>
&gt; Glibc 2.40<br>
&gt; gcc 14.2<br>
&gt; binutils 2.43<br>
&gt; <br>
&gt; This same valgrind was working when i was using glibc 2.23 but giving =
this error when i<br>
&gt; upgraded glibc to 2.40<br>
&gt; For valgrind 3.18 i have=C2=A0applied rseq patches and nop code error =
(0x2E 0x8D 0xB4 0x26)<br>
&gt; patches also required for latest glibc 2.40.<br>
&gt; <br>
&gt; Error log snippet:<br>
&gt; ------------------------<br>
&gt; ...<br>
&gt; ...<br>
&gt; =3D=3D13089=3D=3D<br>
&gt; --13089-- REDIR: 0x1f749f60 (libc.so.6:???) redirected to 0x1e59bd70 (=
strcmp)<br>
&gt; =3D=3D13089=3D=3D Jump to the invalid address stated on the next line<=
br>
&gt; =3D=3D13089=3D=3D =C2=A0 =C2=A0at 0x0: ???<br>
&gt; =3D=3D13089=3D=3D =C2=A0 =C2=A0by 0x1F607366: ??? (in /lib/<a href=3D"=
http://libc-2.40.so" rel=3D"noreferrer" target=3D"_blank">libc-2.40.so</a>)=
<br>
&gt; =3D=3D13089=3D=3D =C2=A0 =C2=A0by 0x1F607423: (below main) (in /lib/<a=
 href=3D"http://libc-2.40.so" rel=3D"noreferrer" target=3D"_blank">libc-2.4=
0.so</a>)<br>
&gt; =3D=3D13089=3D=3D =C2=A0Address 0x0 is not stack&#39;d, malloc&#39;d o=
r (recently) free&#39;d<br>
&gt; =3D=3D13089=3D=3D<br>
&gt; =3D=3D13089=3D=3D<br>
&gt; =3D=3D13089=3D=3D Process terminating with default action of signal 11=
 (SIGSEGV): dumping core<br>
&gt; =3D=3D13089=3D=3D =C2=A0Bad permissions for mapped region at address 0=
x0<br>
&gt; =3D=3D13089=3D=3D =C2=A0 =C2=A0at 0x0: ???<br>
&gt; =3D=3D13089=3D=3D =C2=A0 =C2=A0by 0x1F607366: ??? (in /lib/<a href=3D"=
http://libc-2.40.so" rel=3D"noreferrer" target=3D"_blank">libc-2.40.so</a>)=
<br>
&gt; =3D=3D13089=3D=3D =C2=A0 =C2=A0by 0x1F607423: (below main) (in /lib/<a=
 href=3D"http://libc-2.40.so" rel=3D"noreferrer" target=3D"_blank">libc-2.4=
0.so</a>)<br>
&gt; =3D=3D13089=3D=3D<br>
&gt; <br>
&gt; <br>
&gt; Approaches tried<br>
&gt; -----------------------<br>
&gt; 1. I reduced the optimisation level in glibc to -O1, but still no furt=
her=C2=A0symbol details<br>
&gt; are available<br>
&gt; 2. The core file generated for valgrind crash is also not showing any =
symbol details at<br>
&gt; crash point. (only showing ??)<br>
&gt; 3. Tried adding more option to valgrind like=C2=A0--track-origins=3Dye=
s ,=C2=A0--read-var-info=3Dyes .<br>
&gt; But not giving any more info for the error.<br>
&gt; <br>
&gt; <br>
&gt; I would appreciate any pointers team can provide in debugging this iss=
ue.<br>
&gt; <br>
&gt; Thanks in advance<br>
&gt; <br>
&gt; Regards,<br>
&gt; Kiran H.<br>
&gt; <br>
&gt; _______________________________________________<br>
&gt; Valgrind-users mailing list<br>
&gt; <a href=3D"mailto:[email protected]" target=3D"_bla=
nk">[email protected]</a><br>
&gt; <a href=3D"https://lists.sourceforge.net/lists/listinfo/valgrind-users=
" rel=3D"noreferrer" target=3D"_blank">https://lists.sourceforge.net/lists/=
listinfo/valgrind-users</a><br>
<br>
</blockquote></div>

--0000000000007d8950062cdd5951--


--===============1614960580342350054==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline


--===============1614960580342350054==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Valgrind-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/valgrind-users

--===============1614960580342350054==--