|
From: Ashley P. <as...@qu...> - 2005-11-01 15:03:23
|
Hi,
I've recently hit an error running valgrind against our head-of-tree
code, our use of clone has changed because of errors when running
statically linked binaries on 2.6 kernels, we now provide two extra
flags which we didn't before.
==13530== Unsupported clone() flags: 0x410F00
==13530==
==13530== The only supported clone() uses are:
==13530== - via a threads library (LinuxThreads or NPTL)
==13530== - via the implementation of fork or vfork
==13530== - for the Quadrics Elan3 user-space driver
Would it be possible to extend the check in Valgrind to allow these
flags through?
I've included the diff to our code which provoked this, as you can see
we don't do anything different with the new thread, just the way it's
created.
Ashley,
fabi:libelan3> cvs diff -r 1.134.2.1 -r 1.134.2.2 elanlib.c
Index: elanlib.c
===================================================================
RCS file: /cvs/master/quadrics/libelan3/elanlib.c,v
retrieving revision 1.134.2.1
retrieving revision 1.134.2.2
diff -u -3 -p -r1.134.2.1 -r1.134.2.2
--- elanlib.c 19 Nov 2004 16:35:03 -0000 1.134.2.1
+++ elanlib.c 12 Jul 2005 09:33:54 -0000 1.134.2.2
@@ -5,7 +5,7 @@
*
*/
-#ident "@(#)$Id: elanlib.c,v 1.134.2.1 2004/11/19 16:35:03 mike Exp $"
+#ident "@(#)$Id: elanlib.c,v 1.134.2.2 2005/07/12 09:33:54 addy Exp $"
/* $Source: /cvs/master/quadrics/libelan3/elanlib.c,v $*/
#include <stdio.h>
@@ -49,6 +49,12 @@
#define ALIGNUP(x,a) (((unsigned long)(x) + ((a)-1)) & (-(a))) /* 'a'
power of 2 */
+#if !defined(CLONE_THREAD)
+/* These are from AS3.0/NPTL and 2.6 kernels */
+#define CLONE_THREAD 0x00010000
+#define CLONE_DETACHED 0x00400000
+#endif
+
#define ELANLWP_STACK_SIZE 8192
E3_uint64 elan3_cpudelay = 0; /* usecspin
delay counter */
@@ -1360,7 +1366,9 @@ elan3_attach (ELAN3_CTX *ctx, ELAN_CAPAB
* takes the stack bottom and size (instead of the stack top as
in __clone())
*/
if ((res = __clone2 (elan3_lwp, stack, ELANLWP_STACK_SIZE,
- CLONE_VM | CLONE_FS | CLONE_FILES |
CLONE_SIGHAND,
+ CLONE_VM | CLONE_FS | CLONE_FILES |
CLONE_SIGHAND
+ /* GNAT 7606: New NPTL thread options to
avoid coredumps on exit */
+ | CLONE_THREAD | CLONE_DETACHED,
(void *) ctx)) == -1)
{
elan3_syscall_detach(ctx);
@@ -1368,7 +1376,9 @@ elan3_attach (ELAN3_CTX *ctx, ELAN_CAPAB
}
#else
if ((res = __clone (elan3_lwp, stack + ELANLWP_STACK_SIZE,
- CLONE_VM | CLONE_FS | CLONE_FILES |
CLONE_SIGHAND,
+ CLONE_VM | CLONE_FS | CLONE_FILES |
CLONE_SIGHAND
+ /* GNAT 7606: New NPTL thread options to
avoid coredumps on exit */
+ | CLONE_THREAD | CLONE_DETACHED,
(void *) ctx)) == -1)
{
elan3_syscall_detach(ctx);
|
|
From: Julian S. <js...@ac...> - 2005-11-01 15:29:14
|
Hi Ashley
So if you hack syswrap-x86-linux.c to allow the relevant flags
through, does everything still work? If yes, pls send a diff.
J
On Tuesday 01 November 2005 14:58, Ashley Pittman wrote:
> Hi,
>
> I've recently hit an error running valgrind against our head-of-tree
> code, our use of clone has changed because of errors when running
> statically linked binaries on 2.6 kernels, we now provide two extra
> flags which we didn't before.
>
> ==13530== Unsupported clone() flags: 0x410F00
> ==13530==
> ==13530== The only supported clone() uses are:
> ==13530== - via a threads library (LinuxThreads or NPTL)
> ==13530== - via the implementation of fork or vfork
> ==13530== - for the Quadrics Elan3 user-space driver
>
> Would it be possible to extend the check in Valgrind to allow these
> flags through?
>
> I've included the diff to our code which provoked this, as you can see
> we don't do anything different with the new thread, just the way it's
> created.
>
> Ashley,
>
> fabi:libelan3> cvs diff -r 1.134.2.1 -r 1.134.2.2 elanlib.c
> Index: elanlib.c
> ===================================================================
> RCS file: /cvs/master/quadrics/libelan3/elanlib.c,v
> retrieving revision 1.134.2.1
> retrieving revision 1.134.2.2
> diff -u -3 -p -r1.134.2.1 -r1.134.2.2
> --- elanlib.c 19 Nov 2004 16:35:03 -0000 1.134.2.1
> +++ elanlib.c 12 Jul 2005 09:33:54 -0000 1.134.2.2
> @@ -5,7 +5,7 @@
> *
> */
>
> -#ident "@(#)$Id: elanlib.c,v 1.134.2.1 2004/11/19 16:35:03 mike Exp $"
> +#ident "@(#)$Id: elanlib.c,v 1.134.2.2 2005/07/12 09:33:54 addy Exp $"
> /* $Source: /cvs/master/quadrics/libelan3/elanlib.c,v $*/
>
> #include <stdio.h>
> @@ -49,6 +49,12 @@
>
> #define ALIGNUP(x,a) (((unsigned long)(x) + ((a)-1)) & (-(a))) /* 'a'
> power of 2 */
>
> +#if !defined(CLONE_THREAD)
> +/* These are from AS3.0/NPTL and 2.6 kernels */
> +#define CLONE_THREAD 0x00010000
> +#define CLONE_DETACHED 0x00400000
> +#endif
> +
> #define ELANLWP_STACK_SIZE 8192
>
> E3_uint64 elan3_cpudelay = 0; /* usecspin
> delay counter */
> @@ -1360,7 +1366,9 @@ elan3_attach (ELAN3_CTX *ctx, ELAN_CAPAB
> * takes the stack bottom and size (instead of the stack top as
> in __clone())
> */
> if ((res = __clone2 (elan3_lwp, stack, ELANLWP_STACK_SIZE,
> - CLONE_VM | CLONE_FS | CLONE_FILES |
> CLONE_SIGHAND,
> + CLONE_VM | CLONE_FS | CLONE_FILES |
> CLONE_SIGHAND
> + /* GNAT 7606: New NPTL thread options to
> avoid coredumps on exit */
> + | CLONE_THREAD | CLONE_DETACHED,
> (void *) ctx)) == -1)
> {
> elan3_syscall_detach(ctx);
> @@ -1368,7 +1376,9 @@ elan3_attach (ELAN3_CTX *ctx, ELAN_CAPAB
> }
> #else
> if ((res = __clone (elan3_lwp, stack + ELANLWP_STACK_SIZE,
> - CLONE_VM | CLONE_FS | CLONE_FILES |
> CLONE_SIGHAND,
> + CLONE_VM | CLONE_FS | CLONE_FILES |
> CLONE_SIGHAND
> + /* GNAT 7606: New NPTL thread options to
> avoid coredumps on exit */
> + | CLONE_THREAD | CLONE_DETACHED,
> (void *) ctx)) == -1)
> {
> elan3_syscall_detach(ctx);
>
>
> -------------------------------------------------------
> This SF.Net email is sponsored by the JBoss Inc.
> Get Certified Today * Register for a JBoss Training Course
> Free Certification Exam for All Training Attendees Through End of 2005
> Visit http://www.jboss.com/services/certification for more information
> _______________________________________________
> Valgrind-users mailing list
> Val...@li...
> https://lists.sourceforge.net/lists/listinfo/valgrind-users
|
|
From: Ashley P. <as...@qu...> - 2005-11-01 16:13:32
|
On Tue, 2005-11-01 at 15:29 +0000, Julian Seward wrote:
> Hi Ashley
>
> So if you hack syswrap-x86-linux.c to allow the relevant flags
> through, does everything still work? If yes, pls send a diff.
This works fine.
Ashley,
stratum15:valgrind> svn diff
Index: coregrind/m_syswrap/syswrap-x86-linux.c
===================================================================
--- coregrind/m_syswrap/syswrap-x86-linux.c (revision 4976)
+++ coregrind/m_syswrap/syswrap-x86-linux.c (working copy)
@@ -1067,6 +1067,7 @@
- ??? specifies clone flags of 0x1200011.
- NPTL specifies clone flags of 0x7D0F00.
- The Quadrics Elan3 driver specifies clone flags of 0xF00.
+ - Newer Quadrics Elan3 drivers with NTPL support specify
0x410F00.
Everything else is rejected.
*/
if (
@@ -1074,6 +1075,7 @@
|| cloneflags == 0x7D0F00
|| cloneflags == 0x790F00
|| cloneflags == 0x3D0F00
+ || cloneflags == 0x410F00
|| cloneflags == 0xF00
|| cloneflags == 0xF21)) {
/* OK */
|
|
From: Tom H. <to...@co...> - 2005-11-01 16:54:14
|
In message <200...@ac...>
Julian Seward <js...@ac...> wrote:
> So if you hack syswrap-x86-linux.c to allow the relevant flags
> through, does everything still work? If yes, pls send a diff.
I've asked this before but I'll say it again, since this is the second
time we've had this come up recently - why have we got that check in
there now?
It used to be there to make sure we only processed clones generated
by fork and pthread_create and then when the threading model changed
we got rid of it I thought because the switch statement looks at the
bits that we actually need to worry about.
At some point it seems to have come back on x86 - the amd64 code
doesn't have that check at all and we have no problems there that I
know of.
Tom
--
Tom Hughes (to...@co...)
http://www.compton.nu/
|
|
From: Julian S. <js...@ac...> - 2005-11-01 17:45:06
|
On Tuesday 01 November 2005 16:54, Tom Hughes wrote: > In message <200...@ac...> > > Julian Seward <js...@ac...> wrote: > > So if you hack syswrap-x86-linux.c to allow the relevant flags > > through, does everything still work? If yes, pls send a diff. > > I've asked this before but I'll say it again, since this is the second > time we've had this come up recently - why have we got that check in > there now? I put it in when I made V work with the Elan3 userspace driver. That took a lot of head-scratching and I was being (overly) cautious. I guess you're right, those tests should be removed and just rely on the tests done by the switch statement. J |
|
From: Julian S. <js...@ac...> - 2005-11-05 15:14:51
|
Ashley, thanks. Committed (modified) in r5023. If you have a
spare minute sometime, can you confirm that a vanilla checkout
works for you now?
J
On Tuesday 01 November 2005 16:11, you wrote:
> On Tue, 2005-11-01 at 15:29 +0000, Julian Seward wrote:
> > Hi Ashley
> >
> > So if you hack syswrap-x86-linux.c to allow the relevant flags
> > through, does everything still work? If yes, pls send a diff.
>
> This works fine.
>
> Ashley,
>
> stratum15:valgrind> svn diff
> Index: coregrind/m_syswrap/syswrap-x86-linux.c
> ===================================================================
> --- coregrind/m_syswrap/syswrap-x86-linux.c (revision 4976)
> +++ coregrind/m_syswrap/syswrap-x86-linux.c (working copy)
> @@ -1067,6 +1067,7 @@
> - ??? specifies clone flags of 0x1200011.
> - NPTL specifies clone flags of 0x7D0F00.
> - The Quadrics Elan3 driver specifies clone flags of 0xF00.
> + - Newer Quadrics Elan3 drivers with NTPL support specify
> 0x410F00.
> Everything else is rejected.
> */
> if (
> @@ -1074,6 +1075,7 @@
>
> || cloneflags == 0x7D0F00
> || cloneflags == 0x790F00
> || cloneflags == 0x3D0F00
>
> + || cloneflags == 0x410F00
>
> || cloneflags == 0xF00
> || cloneflags == 0xF21)) {
>
> /* OK */
|
|
From: Ashley P. <as...@qu...> - 2005-11-07 16:12:13
|
A fresh checkout and build works, thanks.
Ashley,
On Sat, 2005-11-05 at 15:15 +0000, Julian Seward wrote:
> Ashley, thanks. Committed (modified) in r5023. If you have a
> spare minute sometime, can you confirm that a vanilla checkout
> works for you now?
>
> J
>
> On Tuesday 01 November 2005 16:11, you wrote:
> > On Tue, 2005-11-01 at 15:29 +0000, Julian Seward wrote:
> > > Hi Ashley
> > >
> > > So if you hack syswrap-x86-linux.c to allow the relevant flags
> > > through, does everything still work? If yes, pls send a diff.
> >
> > This works fine.
> >
> > Ashley,
> >
> > stratum15:valgrind> svn diff
> > Index: coregrind/m_syswrap/syswrap-x86-linux.c
> > ===================================================================
> > --- coregrind/m_syswrap/syswrap-x86-linux.c (revision 4976)
> > +++ coregrind/m_syswrap/syswrap-x86-linux.c (working copy)
> > @@ -1067,6 +1067,7 @@
> > - ??? specifies clone flags of 0x1200011.
> > - NPTL specifies clone flags of 0x7D0F00.
> > - The Quadrics Elan3 driver specifies clone flags of 0xF00.
> > + - Newer Quadrics Elan3 drivers with NTPL support specify
> > 0x410F00.
> > Everything else is rejected.
> > */
> > if (
> > @@ -1074,6 +1075,7 @@
> >
> > || cloneflags == 0x7D0F00
> > || cloneflags == 0x790F00
> > || cloneflags == 0x3D0F00
> >
> > + || cloneflags == 0x410F00
> >
> > || cloneflags == 0xF00
> > || cloneflags == 0xF21)) {
> >
> > /* OK */
|