Re: CVS commit: src

2011-05-29 Thread Matthias Scheler
On Sat, May 28, 2011 at 11:42:37PM +0100, Julio M. Merino Vidal wrote:
 On 5/28/11 10:46 PM, Christos Zoulas wrote:
 In article20110528161256.ab89817...@cvs.netbsd.org,
 Matthias Schelersource-changes-d@NetBSD.org  wrote:
 +   assert(pipe(fds) == 0);
 [...]
 +   assert(write(fds[1], , 1) == 1);
 [...]
 +   assert(close(fds[0]) == 0);
 +   assert(close(fds[1]) == 0);
 [...]
 +   assert(sigfillset(mask) == 0);
 [...]
 +   assert(sigprocmask(SIG_SETMASK, NULL,mask) == 0);
 [...]
 +   assert(close(fd) == 0);
 
 Please don't create assertions that contain code, because compiled with
 -DNDEBUG they vanish.
 
 Are these test code?  If so, just replace assert by one of:
 
 - ATF_REQUIRE(boolean_expression)
 - ATF_REQUIRE_EQ(expected_value, actual_value)
 
 like:
 
 ATF_REQUIRE(pipe(fds) != 0);
 ATF_REQUIRE_EQ(1, write(fds[1], , 1));

I've fixed it as suggested by you.

Kind regards

-- 
Matthias Scheler  http://zhadum.org.uk/


Re: CVS commit: src

2011-05-29 Thread Christos Zoulas
In article 20110529125822.ga17...@colwyn.zhadum.org.uk,
Matthias Scheler  t...@netbsd.org wrote:

I've fixed it as suggested by you.

Thank you! Now if I could only figure out why the pselect tests work on
virtual pc and not a real machine.

christos



Re: CVS commit: src

2011-05-29 Thread Paul Goyette

chris...@astron.com wrote:

Thank you! Now if I could only figure out why the pselect tests work 
on virtual pc and not a real machine.


Perhaps it is because the real machine is SMP/multi-core?  By default, 
qemu virtual machines are single-core.



-
| Paul Goyette | PGP Key fingerprint: | E-mail addresses:   |
| Customer Service | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com|
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
| Kernel Developer |  | pgoyette at netbsd.org  |
-


Re: CVS commit: src

2011-05-29 Thread Christos Zoulas
In article pine.neb.4.64.1105290616001.9...@quicky.whooppee.com,
Paul Goyette  p...@whooppee.com wrote:
chris...@astron.com wrote:

 Thank you! Now if I could only figure out why the pselect tests work 
 on virtual pc and not a real machine.

Perhaps it is because the real machine is SMP/multi-core?  By default, 
qemu virtual machines are single-core.

Could be. All my machines are MP.

christos



Re: CVS commit: src/tests/syscall

2011-05-29 Thread Julio Merino

On 5/29/11 1:57 PM, Matthias Scheler wrote:

Modified Files:
src/tests/syscall: t_pollts.c

Log Message:
[...]
Also use ATF_REQUIRE_EQ_MSG() instead of ATF_REQUIRE_MSG() to avoid
crashes if one of the required conditions isn't met.


It could be a bug in the macro.  I tried changing the last 
ATF_REQUIRE_EQ_MSG call in the program to ATF_REQUIRE_MSG but it did not 
fail.  And I tried adding an explicitly-failing ATF_REQUIRE_MSG and did 
not see a crash either...


Could you provide some more details and/or a stack trace please?

--
Julio Merino / @jmmv


Re: CVS commit: src

2011-05-29 Thread David Laight
On Sat, May 28, 2011 at 11:42:37PM +0100, Julio Merino wrote:
 On 5/28/11 10:46 PM, Christos Zoulas wrote:
 In article20110528161256.ab89817...@cvs.netbsd.org,
 Matthias Schelersource-changes-d@NetBSD.org  wrote:
 [...]
 +   assert(close(fd) == 0);
 
 Please don't create assertions that contain code, because compiled with
 -DNDEBUG they vanish.
 
 Are these test code?  If so, just replace assert by one of:
 
 - ATF_REQUIRE(boolean_expression)
 - ATF_REQUIRE_EQ(expected_value, actual_value)
 
 like:
 
 ATF_REQUIRE(pipe(fds) != 0);
 ATF_REQUIRE_EQ(1, write(fds[1], , 1));

Actually, the assert() define (and similar) are often less than useful
since they don't give any indication of why things are wrong.
The ATF_REQUIRE_EQ() might be more useful (I've not looked at its definition),
but it ought to be possible to use something like:

#define CHECK(type, fmt, v1, op, v2) \
do { \
type _v1 = (v1), _v2 = (v2); \
if (!((_v1) op (_v2))) \
check_error(#v1, #op, #v2, __LINE__, fmt, _v1, _v2); \
} while (0);

#define CHECK_I(v1, op, v1) CHECK(int, %d, v1, op, v2)

So check_error() can print the both values of the erronous test.

David

-- 
David Laight: da...@l8s.co.uk


Re: CVS commit: src/usr.sbin/makefs

2011-05-29 Thread Izumi Tsutsui
  I think the problem is that the final ISO9660 output including
  embeded MD boot fs and partition maps still has to be iso9660 compliant.
  There is no public space to store MD parameters for postprocessing
  in output image, ...
 
 Could the extra parameters be put into a file within the image?
 Then the postprocessing phase would have the required data.
 
 Or even in a separate file !

It might be possible, but I doubt fdisk(8) or pdisk(8)
can handle iso images as is.
(Especailly Apple partition map has variable sizes)

If we have to add some tweaks to fdisk/pdisk to handle ISO9660 quirks,
I'm not sure if it's realy worth to remove MBR/APM stuff from makefs(8),
which really knows about ISO9660 internal structures.

IMO current makefs(8) implementation is acceptable compromise.
---
Izumi Tsutsui


Re: CVS commit: src/tests/syscall

2011-05-29 Thread Matthias Scheler
On Sun, May 29, 2011 at 02:57:14PM +0100, Julio M. Merino Vidal wrote:
 On 5/29/11 1:57 PM, Matthias Scheler wrote:
 Modified Files:
  src/tests/syscall: t_pollts.c
 
 Log Message:
 [...]
 Also use ATF_REQUIRE_EQ_MSG() instead of ATF_REQUIRE_MSG() to avoid
 crashes if one of the required conditions isn't met.
 
 It could be a bug in the macro.  I tried changing the last
 ATF_REQUIRE_EQ_MSG call in the program to ATF_REQUIRE_MSG but it did
 not fail.  And I tried adding an explicitly-failing ATF_REQUIRE_MSG
 and did not see a crash either...

I don't think it's a bug in the macro. The problem was that it use the
0 value as the format string which caused a crash. I'm not sure
why I haven't seen this before.

Kind regards

-- 
Matthias Scheler  http://zhadum.org.uk/


Re: CVS commit: src

2011-05-29 Thread Matthias Scheler
On Sun, May 29, 2011 at 01:07:34PM +, Christos Zoulas wrote:
 I've fixed it as suggested by you.
 
 Thank you! Now if I could only figure out why the pselect tests work on
 virtual pc and not a real machine.

They also fail on virtual machines:

http://www.gson.org/netbsd/bugs/build/build/2011.05.29.12.57.14/test.html#syscall_t_pselect_pselect_signal_mask_with_signal

Kind regards

-- 
Matthias Scheler  http://zhadum.org.uk/


Re: CVS commit: src

2011-05-29 Thread Matthias Scheler
On Sun, May 29, 2011 at 06:18:11AM -0700, Paul Goyette wrote:
 Thank you! Now if I could only figure out why the pselect tests
 work on virtual pc and not a real machine.
 
 Perhaps it is because the real machine is SMP/multi-core?  By
 default, qemu virtual machines are single-core.

It fails for me on a virtual machine with four (virtual) cores as well.
And yes, that VM can really use four cores.

Kind regards

-- 
Matthias Scheler  http://zhadum.org.uk/


Re: CVS commit: src

2011-05-29 Thread Paul Goyette

Yup, I just checked on my amd64 test-bed, and the tests fail there, too!

http://www.whooppee.com/amd64-results/1842_atf.html#failed-tcs-summary

On Sun, 29 May 2011, Matthias Scheler wrote:


On Sun, May 29, 2011 at 01:07:34PM +, Christos Zoulas wrote:

I've fixed it as suggested by you.


Thank you! Now if I could only figure out why the pselect tests work on
virtual pc and not a real machine.


They also fail on virtual machines:

http://www.gson.org/netbsd/bugs/build/build/2011.05.29.12.57.14/test.html#syscall_t_pselect_pselect_signal_mask_with_signal

Kind regards

--
Matthias Scheler  http://zhadum.org.uk/

!DSPAM:4de279f42526020422529!





-
| Paul Goyette | PGP Key fingerprint: | E-mail addresses:   |
| Customer Service | FA29 0E3B 35AF E8AE 6651 | paul at whooppee.com|
| Network Engineer | 0786 F758 55DE 53BA 7731 | pgoyette at juniper.net |
| Kernel Developer |  | pgoyette at netbsd.org  |
-


Re: CVS commit: src

2011-05-29 Thread Christos Zoulas
In article 20110529165252.ga17...@colwyn.zhadum.org.uk,
Matthias Scheler  t...@netbsd.org wrote:
On Sun, May 29, 2011 at 01:07:34PM +, Christos Zoulas wrote:
 I've fixed it as suggested by you.
 
 Thank you! Now if I could only figure out why the pselect tests work on
 virtual pc and not a real machine.

They also fail on virtual machines:

http://www.gson.org/netbsd/bugs/build/build/2011.05.29.12.57.14/test.html#syscall_t_pselect_pselect_signal_mask_with_signal

Yes, now it fails on mine too; I just rebuilt the test binary. Going back
to the old source (1.2) does not fix it either.

christos



Re: CVS commit: src/lib/libdm

2011-05-29 Thread Adam Hamsik

I forgot to say that this commit fixes PR 44947.

On May,Monday 30 2011, at 3:10 AM, Adam Hamsik wrote:

 Module Name:  src
 Committed By: haad
 Date: Mon May 30 01:10:58 UTC 2011
 
 Modified Files:
   src/lib/libdm: libdm_ioctl.c
 
 Log Message:
 Fix problem where DM_IOCTL_NAME was used in libdm_task_set_uuid except of
 DM_IOCTL_UUID. This makes lvremove to work properly.
 
 Thanks To hugo Silva and Toby Karyadi for reporting this issue.
 
 
 To generate a diff of this commit:
 cvs rdiff -u -r1.1 -r1.2 src/lib/libdm/libdm_ioctl.c
 
 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.
 
 Modified files:
 
 Index: src/lib/libdm/libdm_ioctl.c
 diff -u src/lib/libdm/libdm_ioctl.c:1.1 src/lib/libdm/libdm_ioctl.c:1.2
 --- src/lib/libdm/libdm_ioctl.c:1.1   Tue Feb  8 03:20:15 2011
 +++ src/lib/libdm/libdm_ioctl.c   Mon May 30 01:10:57 2011
 @@ -262,7 +262,7 @@
   if ((prop_dictionary_set_cstring(libdm_task-ldm_task,
   DM_IOCTL_NAME, name)) == false)
   return ENOENT;
 -
 + 
   return 0;
 }
 
 @@ -285,7 +285,7 @@
 {
 
   if ((prop_dictionary_set_cstring(libdm_task-ldm_task,
 - DM_IOCTL_NAME, uuid)) == false)
 + DM_IOCTL_UUID, uuid)) == false)
   return ENOENT;
 
   return 0;
 

Regards

Adam.