Skip to contentSkip to conversation

pidns31: fix EACCESS error in mq_open()

LTP Sukadev Bhattiprolu 3 participants 9 messages Aug 4, 2010 – Nov 11, 2010

lore
Share & tools
lore
#0 lore raw

pidns31: mq_open() fails with EACCESS.

pidns31 test case fails with EACCESS - due to the leading '/' in mqname. See comments in the patch below for details.

---
Index: testcases/kernel/containers/pidns/pidns31.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/containers/pidns/pidns31.c,v retrieving revision 1.6

kernel/containers/pidns/pidns31.c +9 -1
diff -u -p -r1.6 pidns31.c
@@ -61,7 +61,14 @@
 char *TCID = "pidns31";
 int TST_TOTAL = 1;
 
-char *mqname = "/mq1";
+
+/*
+ * NOTE: The mq_open() interface in glibc requires mqname to start with a '/' 
+ * 	 and the glibc call skips the leading '/' when invoking the system
+ * 	 call. Since we bypass the glibc mq_open() (and use syscall()) we
+ * 	 define mqname without the leading '/'.
+ */
+char *mqname = "mq1";
 int result = TFAIL;
 
 int errno;
@@ -264,6 +271,7 @@ int main(int argc, char *argv[])
 	}
 
 	syscall(__NR_mq_unlink, mqname);
+
 	mqd = syscall(__NR_mq_open, mqname, O_RDWR|O_CREAT|O_EXCL, 0777, NULL);
 	if (mqd == (mqd_t)-1) {
 		tst_resm(TBROK, "parent: mq_open() failed (%s)",

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#1 lore raw
Quoted 32 lines · Sukadev Bhattiprolu

pidns31: mq_open() fails with EACCESS.

pidns31 test case fails with EACCESS - due to the leading '/' in mqname. See comments in the patch below for details.

---
Index: testcases/kernel/containers/pidns/pidns31.c
===================================================================
RCS file: /cvsroot/ltp/ltp/testcases/kernel/containers/pidns/pidns31.c,v retrieving revision 1.6
diff -u -p -r1.6 pidns31.c

kernel/containers/pidns/pidns31.c 4 Aug 2010 23:24:54 -0000 renamed from kernel/containers/pidns/pidns31.c 14 Nov 2009 23:58:26 -0000      1.6 +8 -1
@@ -61,7 +61,14 @@
  char *TCID = "pidns31";
  int TST_TOTAL = 1;
 
-char *mqname = "/mq1";
+
+/*
+ * NOTE: The mq_open() interface in glibc requires mqname to start with a '/'
+ *      and the glibc call skips the leading '/' when invoking the system
+ *      call. Since we bypass the glibc mq_open() (and use syscall()) we
+ *      define mqname without the leading '/'.
+ */
+char *mqname = "mq1";
  int result = TFAIL;
 
  int errno;

kernel/containers/pidns/pidns31.c 4 Aug 2010 23:24:54 -0000 int main(int argc, char *argv[]) · line 277

Quoted 7 lines
kernel/containers/pidns/pidns31.c 4 Aug 2010 23:24:54 -0000 renamed from kernel/containers/pidns/pidns31.c 14 Nov 2009 23:58:26 -0000      1.6 +1 -0
@@ -264,6 +271,7 @@ int main(int argc, char *argv[])
        }
 
        syscall(__NR_mq_unlink, mqname);
+
        mqd = syscall(__NR_mq_open, mqname, O_RDWR|O_CREAT|O_EXCL, 0777, NULL);
        if (mqd == (mqd_t)-1) {
                tst_resm(TBROK, "parent: mq_open() failed (%s)",

Did Linux become non-POSIX compliant :) (from
<http://www.opengroup.org/onlinepubs/000095399/functions/mq_open.html>)?

If name begins with the slash character, then processes calling mq_open() with the same value of name shall refer to the same message queue object, as long as that name has not been removed. If name does not begin with the slash character, the effect is implementation-defined. The interpretation of slash characters other than the leading slash character in name is implementation-defined. If the name argument is not the name of an existing message queue and creation is not requested, mq_open() shall fail and return an error.

...

[EACCES]
The message queue exists and the permissions specified by oflag
are denied, or the message queue does not exist and permission to create the message queue is denied.

I think that one needs to do more digging to determine whether or not the error is valid, because your description and the requirements above don't make sense...

Thanks,
-Garrett

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#2 lore raw

Garrett Cooper [[email protected]] wrote:

| On Wed, Aug 4, 2010 at 4:52 PM, Sukadev Bhattiprolu
| <[email protected]> wrote:
| >
| > pidns31: mq_open() fails with EACCESS.
| >
| > pidns31 test case fails with EACCESS - due to the leading '/' in
| > mqname. See comments in the patch below for details.
| >
| > Signed-off-by: Sukadev Bhattiprolu <[email protected]>
| > ---
| > Index: testcases/kernel/containers/pidns/pidns31.c
| > ===================================================================
| > RCS file: /cvsroot/ltp/ltp/testcases/kernel/containers/pidns/pidns31.c,v
| > retrieving revision 1.6
| > diff -u -p -r1.6 pidns31.c
| > --- testcases/kernel/containers/pidns/pidns31.c 14 Nov 2009 23:58:26 -0000      1.6
| > +++ testcases/kernel/containers/pidns/pidns31.c 4 Aug 2010 23:24:54 -0000
| > @@ -61,7 +61,14 @@
| >  char *TCID = "pidns31";
| >  int TST_TOTAL = 1;
| >
| > -char *mqname = "/mq1";
| > +
| > +/*
| > + * NOTE: The mq_open() interface in glibc requires mqname to start with a '/'
| > + *      and the glibc call skips the leading '/' when invoking the system
| > + *      call. Since we bypass the glibc mq_open() (and use syscall()) we
| > + *      define mqname without the leading '/'.
| > + */
| > +char *mqname = "mq1";
| >  int result = TFAIL;
| >
| >  int errno;
| > @@ -264,6 +271,7 @@ int main(int argc, char *argv[])
| >        }
| >
| >        syscall(__NR_mq_unlink, mqname);
| > +
| >        mqd = syscall(__NR_mq_open, mqname, O_RDWR|O_CREAT|O_EXCL, 0777, NULL);
| >        if (mqd == (mqd_t)-1) {
| >                tst_resm(TBROK, "parent: mq_open() failed (%s)",
| 
| Did Linux become non-POSIX compliant :) (from
| <http://www.opengroup.org/onlinepubs/000095399/functions/mq_open.html>)?

Heh. Good question but I think the mq_open() from glibc is compliant with this. I am just not sure if the call via syscall() needs to be compliant.

But if that is a concern, we need a separate a test case for that - pidns31 is using mq_* to test an unrelated feature. I think would make sense to apply this fix, allowing LTP to test the feature even on older distros.

Or pidns31 can go back to using the library interface and we could skip the test on old distros.

Sukadev.

------------------------------------------------------------------------------
The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details:
http://p.sf.net/sfu/dev2dev-palm
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#3 lore raw
Quoted 50 lines · Sukadev Bhattiprolu

Garrett Cooper [[email protected]] wrote:

| On Wed, Aug 4, 2010 at 4:52 PM, Sukadev Bhattiprolu
| <[email protected]> wrote:
| >
| > pidns31: mq_open() fails with EACCESS.
| >
| > pidns31 test case fails with EACCESS - due to the leading '/' in
| > mqname. See comments in the patch below for details.
| >
| > Signed-off-by: Sukadev Bhattiprolu <[email protected]>
| > ---
| > Index: testcases/kernel/containers/pidns/pidns31.c
| > ===================================================================
| > RCS file: /cvsroot/ltp/ltp/testcases/kernel/containers/pidns/pidns31.c,v
| > retrieving revision 1.6
| > diff -u -p -r1.6 pidns31.c
| > --- testcases/kernel/containers/pidns/pidns31.c 14 Nov 2009 23:58:26 -0000      1.6
| > +++ testcases/kernel/containers/pidns/pidns31.c 4 Aug 2010 23:24:54 -0000
| > @@ -61,7 +61,14 @@
| >  char *TCID = "pidns31";
| >  int TST_TOTAL = 1;
| >
| > -char *mqname = "/mq1";
| > +
| > +/*
| > + * NOTE: The mq_open() interface in glibc requires mqname to start with a '/'
| > + *      and the glibc call skips the leading '/' when invoking the system
| > + *      call. Since we bypass the glibc mq_open() (and use syscall()) we
| > + *      define mqname without the leading '/'.
| > + */
| > +char *mqname = "mq1";
| >  int result = TFAIL;
| >
| >  int errno;
| > @@ -264,6 +271,7 @@ int main(int argc, char *argv[])
| >        }
| >
| >        syscall(__NR_mq_unlink, mqname);
| > +
| >        mqd = syscall(__NR_mq_open, mqname, O_RDWR|O_CREAT|O_EXCL, 0777, NULL);
| >        if (mqd == (mqd_t)-1) {
| >                tst_resm(TBROK, "parent: mq_open() failed (%s)",
| 
| Did Linux become non-POSIX compliant :) (from
| <http://www.opengroup.org/onlinepubs/000095399/functions/mq_open.html>)?

Heh. Good question but I think the mq_open() from glibc is compliant with this. I am just not sure if the call via syscall() needs to be compliant.

Quoted 7 lines

But if that is a concern, we need a separate a test case for that - pidns31 is using mq_* to test an unrelated feature. I think would make sense to apply this fix, allowing LTP to test the feature even on older distros.

Or pidns31 can go back to using the library interface and we could skip the test on old distros.

I would prefer this.

Regards--
Subrata

Quoted 2 lines

Sukadev.

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#4 lore raw
Quoted 57 lines · Subrata Modak
Quoted 55 lines · Sukadev Bhattiprolu

Garrett Cooper [[email protected]] wrote:

| On Wed, Aug 4, 2010 at 4:52 PM, Sukadev Bhattiprolu
| <[email protected]> wrote:
| >
| > pidns31: mq_open() fails with EACCESS.
| >
| > pidns31 test case fails with EACCESS - due to the leading '/' in
| > mqname. See comments in the patch below for details.
| >
| > Signed-off-by: Sukadev Bhattiprolu <[email protected]>
| > ---
| > Index: testcases/kernel/containers/pidns/pidns31.c
| > ===================================================================
| > RCS file: /cvsroot/ltp/ltp/testcases/kernel/containers/pidns/pidns31.c,v
| > retrieving revision 1.6
| > diff -u -p -r1.6 pidns31.c
| > --- testcases/kernel/containers/pidns/pidns31.c 14 Nov 2009 23:58:26 -0000      1.6
| > +++ testcases/kernel/containers/pidns/pidns31.c 4 Aug 2010 23:24:54 -0000
| > @@ -61,7 +61,14 @@
| >  char *TCID = "pidns31";
| >  int TST_TOTAL = 1;
| >
| > -char *mqname = "/mq1";
| > +
| > +/*
| > + * NOTE: The mq_open() interface in glibc requires mqname to start with a '/'
| > + *      and the glibc call skips the leading '/' when invoking the system
| > + *      call. Since we bypass the glibc mq_open() (and use syscall()) we
| > + *      define mqname without the leading '/'.
| > + */
| > +char *mqname = "mq1";
| >  int result = TFAIL;
| >
| >  int errno;
| > @@ -264,6 +271,7 @@ int main(int argc, char *argv[])
| >        }
| >
| >        syscall(__NR_mq_unlink, mqname);
| > +
| >        mqd = syscall(__NR_mq_open, mqname, O_RDWR|O_CREAT|O_EXCL, 0777, NULL);
| >        if (mqd == (mqd_t)-1) {
| >                tst_resm(TBROK, "parent: mq_open() failed (%s)",
|
| Did Linux become non-POSIX compliant :) (from
| <http://www.opengroup.org/onlinepubs/000095399/functions/mq_open.html>)?

Heh. Good question but I think the mq_open() from glibc is compliant with this. I am just not sure if the call via syscall() needs to be compliant.

But if that is a concern, we need a separate a test case for that - pidns31 is using mq_* to test an unrelated feature. I think would make sense to apply this fix, allowing LTP to test the feature even on older distros.

Quoted 4 lines
Quoted 2 lines

Or pidns31 can go back to using the library interface and we could skip the test on old distros.

I would prefer this.

Do I hear someone volunteering to add the required autoconf tests and tests for this :)?

------------------------------------------------------------------------------
This SF.net email is sponsored by

Make an app they can't live without
Enter the BlackBerry Developer Challenge
http://p.sf.net/sfu/RIM-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#5 lore raw
Quoted 59 lines · Garrett Cooper
Quoted 57 lines · Subrata Modak
Quoted 55 lines · Sukadev Bhattiprolu

Garrett Cooper [[email protected]] wrote:

| On Wed, Aug 4, 2010 at 4:52 PM, Sukadev Bhattiprolu
| <[email protected]> wrote:
| >
| > pidns31: mq_open() fails with EACCESS.
| >
| > pidns31 test case fails with EACCESS - due to the leading '/' in
| > mqname. See comments in the patch below for details.
| >
| > Signed-off-by: Sukadev Bhattiprolu <[email protected]>
| > ---
| > Index: testcases/kernel/containers/pidns/pidns31.c
| > ===================================================================
| > RCS file: /cvsroot/ltp/ltp/testcases/kernel/containers/pidns/pidns31.c,v
| > retrieving revision 1.6
| > diff -u -p -r1.6 pidns31.c
| > --- testcases/kernel/containers/pidns/pidns31.c 14 Nov 2009 23:58:26 -0000      1.6
| > +++ testcases/kernel/containers/pidns/pidns31.c 4 Aug 2010 23:24:54 -0000
| > @@ -61,7 +61,14 @@
| >  char *TCID = "pidns31";
| >  int TST_TOTAL = 1;
| >
| > -char *mqname = "/mq1";
| > +
| > +/*
| > + * NOTE: The mq_open() interface in glibc requires mqname to start with a '/'
| > + *      and the glibc call skips the leading '/' when invoking the system
| > + *      call. Since we bypass the glibc mq_open() (and use syscall()) we
| > + *      define mqname without the leading '/'.
| > + */
| > +char *mqname = "mq1";
| >  int result = TFAIL;
| >
| >  int errno;
| > @@ -264,6 +271,7 @@ int main(int argc, char *argv[])
| >        }
| >
| >        syscall(__NR_mq_unlink, mqname);
| > +
| >        mqd = syscall(__NR_mq_open, mqname, O_RDWR|O_CREAT|O_EXCL, 0777, NULL);
| >        if (mqd == (mqd_t)-1) {
| >                tst_resm(TBROK, "parent: mq_open() failed (%s)",
|
| Did Linux become non-POSIX compliant :) (from
| <http://www.opengroup.org/onlinepubs/000095399/functions/mq_open.html>)?

Heh. Good question but I think the mq_open() from glibc is compliant with this. I am just not sure if the call via syscall() needs to be compliant.

But if that is a concern, we need a separate a test case for that - pidns31 is using mq_* to test an unrelated feature. I think would make sense to apply this fix, allowing LTP to test the feature even on older distros.

Quoted 7 lines
Quoted 4 lines
Quoted 2 lines

Or pidns31 can go back to using the library interface and we could skip the test on old distros.

I would prefer this.

Do I hear someone volunteering to add the required autoconf tests and tests for this :)?

Suka ?

Regards--
Subrata

------------------------------------------------------------------------------
Sell apps to millions through the Intel(R) Atom(Tm) Developer Program Be part of this innovative community and reach millions of netbook users worldwide. Take advantage of special opportunities to increase revenue and speed time-to-market. Join now, and jumpstart your future.
http://p.sf.net/sfu/intel-atom-d2d
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#6 lore raw
In reply to Garrett Cooper

Garrett Cooper [[email protected]] wrote:

| On Mon, Aug 16, 2010 at 7:52 AM, Subrata Modak
| <[email protected]> wrote:
| >
| > On Wed, 2010-08-04 at 18:43 -0700, Sukadev Bhattiprolu wrote:
| >> Garrett Cooper [[email protected]] wrote:
| >> | On Wed, Aug 4, 2010 at 4:52 PM, Sukadev Bhattiprolu
| >> | <[email protected]> wrote:
| >> | >
| >> | > pidns31: mq_open() fails with EACCESS.
| >> | >
| >> | > pidns31 test case fails with EACCESS - due to the leading '/' in
| >> | > mqname. See comments in the patch below for details.
| >> | >
| >> | > Signed-off-by: Sukadev Bhattiprolu <[email protected]>
| >> | > ---
| >> | > Index: testcases/kernel/containers/pidns/pidns31.c
| >> | > ===================================================================
| >> | > RCS file: /cvsroot/ltp/ltp/testcases/kernel/containers/pidns/pidns31.c,v
| >> | > retrieving revision 1.6
| >> | > diff -u -p -r1.6 pidns31.c
| >> | > --- testcases/kernel/containers/pidns/pidns31.c 14 Nov 2009 23:58:26 -0000      1.6
| >> | > +++ testcases/kernel/containers/pidns/pidns31.c 4 Aug 2010 23:24:54 -0000
| >> | > @@ -61,7 +61,14 @@
| >> | >  char *TCID = "pidns31";
| >> | >  int TST_TOTAL = 1;
| >> | >
| >> | > -char *mqname = "/mq1";
| >> | > +
| >> | > +/*
| >> | > + * NOTE: The mq_open() interface in glibc requires mqname to start with a '/'
| >> | > + *      and the glibc call skips the leading '/' when invoking the system
| >> | > + *      call. Since we bypass the glibc mq_open() (and use syscall()) we
| >> | > + *      define mqname without the leading '/'.
| >> | > + */
| >> | > +char *mqname = "mq1";
| >> | >  int result = TFAIL;
| >> | >
| >> | >  int errno;
| >> | > @@ -264,6 +271,7 @@ int main(int argc, char *argv[])
| >> | >        }
| >> | >
| >> | >        syscall(__NR_mq_unlink, mqname);
| >> | > +
| >> | >        mqd = syscall(__NR_mq_open, mqname, O_RDWR|O_CREAT|O_EXCL, 0777, NULL);
| >> | >        if (mqd == (mqd_t)-1) {
| >> | >                tst_resm(TBROK, "parent: mq_open() failed (%s)",
| >> |
| >> | Did Linux become non-POSIX compliant :) (from
| >> | <http://www.opengroup.org/onlinepubs/000095399/functions/mq_open.html>)?
| >>
| >> Heh. Good question but I think the mq_open() from glibc is compliant
| >> with this. I am just not sure if the call via syscall() needs to be
| >> compliant.
| >>
| >> But if that is a concern, we need a separate a test case for that -
| >> pidns31 is using mq_* to test an unrelated feature. I think would
| >> make sense to apply this fix, allowing LTP to test the feature even
| >> on older distros.
| >>
| >> Or pidns31 can go back to using the library interface and we could
| >> skip the test on old distros.
| >
| > I would prefer this.
| 
| Do I hear someone volunteering to add the required autoconf tests and
| tests for this :)?

Well, I thought we could add a simple autoconf test for the pidns - but then realized that mq_open() calls were changed for many other test cases too. The test cases include mqueue.h, which would not be present in old distros anyway.

So, I don't see the point in fixing this just for pidns tests. If we want to use the syscall() interface, why don't we just design the test to work with the syscall behavior - i.e just remove the '/' from the name ?

Sukadev

------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest Create new apps & games for the Nokia N8 for consumers in U.S. and Canada $10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#7 lore raw
Quoted 68 lines · Sukadev Bhattiprolu

Garrett Cooper [[email protected]] wrote:

| On Mon, Aug 16, 2010 at 7:52 AM, Subrata Modak
| <[email protected]> wrote:
| >
| > On Wed, 2010-08-04 at 18:43 -0700, Sukadev Bhattiprolu wrote:
| >> Garrett Cooper [[email protected]] wrote:
| >> | On Wed, Aug 4, 2010 at 4:52 PM, Sukadev Bhattiprolu
| >> | <[email protected]> wrote:
| >> | >
| >> | > pidns31: mq_open() fails with EACCESS.
| >> | >
| >> | > pidns31 test case fails with EACCESS - due to the leading '/' in
| >> | > mqname. See comments in the patch below for details.
| >> | >
| >> | > Signed-off-by: Sukadev Bhattiprolu <[email protected]>
| >> | > ---
| >> | > Index: testcases/kernel/containers/pidns/pidns31.c
| >> | > ===================================================================
| >> | > RCS file: /cvsroot/ltp/ltp/testcases/kernel/containers/pidns/pidns31.c,v
| >> | > retrieving revision 1.6
| >> | > diff -u -p -r1.6 pidns31.c
| >> | > --- testcases/kernel/containers/pidns/pidns31.c 14 Nov 2009 23:58:26 -0000      1.6
| >> | > +++ testcases/kernel/containers/pidns/pidns31.c 4 Aug 2010 23:24:54 -0000
| >> | > @@ -61,7 +61,14 @@
| >> | >  char *TCID = "pidns31";
| >> | >  int TST_TOTAL = 1;
| >> | >
| >> | > -char *mqname = "/mq1";
| >> | > +
| >> | > +/*
| >> | > + * NOTE: The mq_open() interface in glibc requires mqname to start with a '/'
| >> | > + *      and the glibc call skips the leading '/' when invoking the system
| >> | > + *      call. Since we bypass the glibc mq_open() (and use syscall()) we
| >> | > + *      define mqname without the leading '/'.
| >> | > + */
| >> | > +char *mqname = "mq1";
| >> | >  int result = TFAIL;
| >> | >
| >> | >  int errno;
| >> | > @@ -264,6 +271,7 @@ int main(int argc, char *argv[])
| >> | >        }
| >> | >
| >> | >        syscall(__NR_mq_unlink, mqname);
| >> | > +
| >> | >        mqd = syscall(__NR_mq_open, mqname, O_RDWR|O_CREAT|O_EXCL, 0777, NULL);
| >> | >        if (mqd == (mqd_t)-1) {
| >> | >                tst_resm(TBROK, "parent: mq_open() failed (%s)",
| >> |
| >> | Did Linux become non-POSIX compliant :) (from
| >> | <http://www.opengroup.org/onlinepubs/000095399/functions/mq_open.html>)?
| >>
| >> Heh. Good question but I think the mq_open() from glibc is compliant
| >> with this. I am just not sure if the call via syscall() needs to be
| >> compliant.
| >>
| >> But if that is a concern, we need a separate a test case for that -
| >> pidns31 is using mq_* to test an unrelated feature. I think would
| >> make sense to apply this fix, allowing LTP to test the feature even
| >> on older distros.
| >>
| >> Or pidns31 can go back to using the library interface and we could
| >> skip the test on old distros.
| >
| > I would prefer this.
| 
| Do I hear someone volunteering to add the required autoconf tests and
| tests for this :)?
Quoted 8 lines

Well, I thought we could add a simple autoconf test for the pidns - but then realized that mq_open() calls were changed for many other test cases too. The test cases include mqueue.h, which would not be present in old distros anyway.

So, I don't see the point in fixing this just for pidns tests. If we want to use the syscall() interface, why don't we just design the test to work with the syscall behavior - i.e just remove the '/' from the name ?

Garret,

Your thoughts ?

Regards--
Subrata

Quoted 2 lines

Sukadev

------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture Simplifying enterprise desktop deployment and management using Dell EqualLogic storage and VMware View: A highly scalable, end-to-end client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list

#8 lore raw
Quoted 74 lines · Subrata Modak
Quoted 73 lines · Sukadev Bhattiprolu

Garrett Cooper [[email protected]] wrote:

| On Mon, Aug 16, 2010 at 7:52 AM, Subrata Modak
| <[email protected]> wrote:
| >
| > On Wed, 2010-08-04 at 18:43 -0700, Sukadev Bhattiprolu wrote:
| >> Garrett Cooper [[email protected]] wrote:
| >> | On Wed, Aug 4, 2010 at 4:52 PM, Sukadev Bhattiprolu
| >> | <[email protected]> wrote:
| >> | >
| >> | > pidns31: mq_open() fails with EACCESS.
| >> | >
| >> | > pidns31 test case fails with EACCESS - due to the leading '/' in
| >> | > mqname. See comments in the patch below for details.
| >> | >
| >> | > Signed-off-by: Sukadev Bhattiprolu <[email protected]>
| >> | > ---
| >> | > Index: testcases/kernel/containers/pidns/pidns31.c
| >> | > ===================================================================
| >> | > RCS file: /cvsroot/ltp/ltp/testcases/kernel/containers/pidns/pidns31.c,v
| >> | > retrieving revision 1.6
| >> | > diff -u -p -r1.6 pidns31.c
| >> | > --- testcases/kernel/containers/pidns/pidns31.c 14 Nov 2009 23:58:26 -0000      1.6
| >> | > +++ testcases/kernel/containers/pidns/pidns31.c 4 Aug 2010 23:24:54 -0000
| >> | > @@ -61,7 +61,14 @@
| >> | >  char *TCID = "pidns31";
| >> | >  int TST_TOTAL = 1;
| >> | >
| >> | > -char *mqname = "/mq1";
| >> | > +
| >> | > +/*
| >> | > + * NOTE: The mq_open() interface in glibc requires mqname to start with a '/'
| >> | > + *      and the glibc call skips the leading '/' when invoking the system
| >> | > + *      call. Since we bypass the glibc mq_open() (and use syscall()) we
| >> | > + *      define mqname without the leading '/'.
| >> | > + */
| >> | > +char *mqname = "mq1";
| >> | >  int result = TFAIL;
| >> | >
| >> | >  int errno;
| >> | > @@ -264,6 +271,7 @@ int main(int argc, char *argv[])
| >> | >        }
| >> | >
| >> | >        syscall(__NR_mq_unlink, mqname);
| >> | > +
| >> | >        mqd = syscall(__NR_mq_open, mqname, O_RDWR|O_CREAT|O_EXCL, 0777, NULL);
| >> | >        if (mqd == (mqd_t)-1) {
| >> | >                tst_resm(TBROK, "parent: mq_open() failed (%s)",
| >> |
| >> | Did Linux become non-POSIX compliant :) (from
| >> | <http://www.opengroup.org/onlinepubs/000095399/functions/mq_open.html>)?
| >>
| >> Heh. Good question but I think the mq_open() from glibc is compliant
| >> with this. I am just not sure if the call via syscall() needs to be
| >> compliant.
| >>
| >> But if that is a concern, we need a separate a test case for that -
| >> pidns31 is using mq_* to test an unrelated feature. I think would
| >> make sense to apply this fix, allowing LTP to test the feature even
| >> on older distros.
| >>
| >> Or pidns31 can go back to using the library interface and we could
| >> skip the test on old distros.
| >
| > I would prefer this.
|
| Do I hear someone volunteering to add the required autoconf tests and
| tests for this :)?

Well, I thought we could add a simple autoconf test for the pidns - but then realized that mq_open() calls were changed for many other test cases too. The test cases include mqueue.h, which would not be present in old distros anyway.

Quoted 7 lines
Quoted 3 lines

So, I don't see the point in fixing this just for pidns tests. If we want to use the syscall() interface, why don't we just design the test to work with the syscall behavior - i.e  just remove the '/' from the name ?

Garret,

Your thoughts ?

Committed. Will push soon.
-Garrett

------------------------------------------------------------------------------
Centralized Desktop Delivery: Dell and VMware Reference Architecture Simplifying enterprise desktop deployment and management using Dell EqualLogic storage and VMware View: A highly scalable, end-to-end client virtualization framework. Read more!
http://p.sf.net/sfu/dell-eql-dev2dev
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list