Re: Need support in debugging Valgrind 3.18 glibc segv error

kiran hardas <[email protected]> Mon, 24 Mar 2025 21:03:03 +0530
Newsgroups gmane.comp.debugging.valgrind
Message-ID <CAPyEgmZifZo4yaM5+c6RpBvNR_9i+Mis4VKr-OnO2+GOtrxevA@mail.gmail.com>
--===============8619858536827907848==
Content-Type: multipart/alternative; boundary="00000000000096e5a006311852c4"

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

Hi Paul,

Thanks for taking time and providing inputs. I am still debugging for that
shmat failure, so far no rca.
The error string that i got from perror after shmat is "Invalid argument".


Regards,
Kiran H.

On Sat, Mar 22, 2025 at 2:18=E2=80=AFAM Paul Floyd <[email protected]> wro=
te:

>
> On 21/03/2025 09:06, kiran hardas wrote:
> > Hi Paul/Team,
> >
> > Thank you for your suggestion. I added the entry for shmget function
> > in coregrind/m_syswrap/syswrap-x86-linux.c
> > and the error got resolved for shmget function. Yes it is x86 linux
> > that is getting used. Similar errors came for shmat, shmdt, shmctl
> > functions.
> > I added similar entries of those functions too in the table and
> > resolved the errors.
> >
> > Currently i am getting error from shmat function as "Invalid argument"
> > from my application code.
> > The data pointer returned by shmat function is coming as 0xffffffff
> > which is -1 (error). I am calling the shmat as below
> >  in my application code
> >
> > data =3D shmat(shmid, NULL, 0);            /* where data is a struct
> > pointer and shmid is 1 obtained by a successful shmget call */
> >
> > I verified the arguments for this shmat function and they seem to be
> > fine. Also checked for permission issues.
> > I am suspecting memory issue which could be resulting in shmat attach
> > failure after running valgrind (have glibc 2.40).
> >
> > Would appreciate any advice/suggestion you can provide for this issue.
> >
>
> Hi
>
> On the Valgrind side I've pushed a change that adds these 4 syscalls to
> x86 Linux.
>
> I can't tell why your shmat call is failing. If the shmget call to
> obtain shmid works than it ought to work. The man page lists the error
> conditions. What do you get in errno?
>
> It might be worth checking with the ipcs command to see if hou have lots
> of leftover memorys/queues/semaphores.
>
>
> A+
>
> Paul
>
>

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

<div dir=3D"ltr">Hi Paul,<div><br></div><div>Thanks for taking time and pro=
viding inputs. I am still debugging for that shmat failure,=C2=A0so far no =
rca.</div><div>The error string that i got from perror after shmat is &quot=
;Invalid argument&quot;.</div><div><br></div><div><br></div><div>Regards,</=
div><div>Kiran H.</div></div><br><div class=3D"gmail_quote gmail_quote_cont=
ainer"><div dir=3D"ltr" class=3D"gmail_attr">On Sat, Mar 22, 2025 at 2:18=
=E2=80=AFAM Paul Floyd &lt;<a href=3D"mailto:[email protected]">pjfloyd@wa=
nadoo.fr</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" style=3D=
"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-le=
ft:1ex"><br>
On 21/03/2025 09:06, kiran hardas wrote:<br>
&gt; Hi Paul/Team,<br>
&gt;<br>
&gt; Thank you for your suggestion. I added the entry for shmget function <=
br>
&gt; in coregrind/m_syswrap/syswrap-x86-linux.c<br>
&gt; and the error got resolved for shmget function. Yes it is x86 linux <b=
r>
&gt; that is=C2=A0getting used. Similar errors came for shmat, shmdt, shmct=
l <br>
&gt; functions.<br>
&gt; I added similar entries of those functions too in the table and <br>
&gt; resolved the=C2=A0errors.<br>
&gt;<br>
&gt; Currently i am getting error from shmat function as &quot;Invalid argu=
ment&quot; <br>
&gt; from my application code.<br>
&gt; The data pointer returned by shmat function is coming as 0xffffffff <b=
r>
&gt; which is -1 (error). I am calling the shmat as below<br>
&gt; =C2=A0in my application code<br>
&gt;<br>
&gt; data =3D shmat(shmid, NULL, 0);=C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=
=A0 /* where data is a struct <br>
&gt; pointer and shmid is 1 obtained by a successful=C2=A0shmget call */<br=
>
&gt;<br>
&gt; I verified the arguments for this shmat function and they seem to be <=
br>
&gt; fine. Also checked for permission issues.<br>
&gt; I am suspecting memory issue which could be resulting in shmat attach =
<br>
&gt; failure after running valgrind (have glibc 2.40).<br>
&gt;<br>
&gt; Would appreciate any advice/suggestion you can provide for this issue.=
<br>
&gt;<br>
<br>
Hi<br>
<br>
On the Valgrind side I&#39;ve pushed a change that adds these 4 syscalls to=
 <br>
x86 Linux.<br>
<br>
I can&#39;t tell why your shmat call is failing. If the shmget call to <br>
obtain shmid works than it ought to work. The man page lists the error <br>
conditions. What do you get in errno?<br>
<br>
It might be worth checking with the ipcs command to see if hou have lots <b=
r>
of leftover memorys/queues/semaphores.<br>
<br>
<br>
A+<br>
<br>
Paul<br>
<br>
</blockquote></div>

--00000000000096e5a006311852c4--


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


--===============8619858536827907848==
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

--===============8619858536827907848==--