Re: CVS commit: src/external/bsd/atf/dist/atf-run

2011-12-23 Thread Julio Merino
On 12/19/11 10:25 PM, Christos Zoulas wrote:
 Module Name:  src
 Committed By: christos
 Date: Mon Dec 19 22:25:46 UTC 2011
 
 Modified Files:
   src/external/bsd/atf/dist/atf-run: timer.cpp
 
 Log Message:
 - make all the ifdefs match
 - make it compile, and test

This was still broken.

timer_t and itimerspec do not exist, so the timer.hpp file is unusable.
 The definition of HAVE_POSIX_TIMER does not work because SIGEV_NONE is
defined in OS X.  The change of sys/time.h and signal.h to ctime and
csignal seems to cause issues too.

I have had to fix this by adding a configure test for timer_t, using the
pimpl idiom for the timer class definition to prevent further ifdef mess
in timer.hpp, and had to sprinkle some more ifdef stuff in the code.

The result is incredibly ugly, and I doubt there is any real benefit
other than using modern interfaces.  Was it really worth it?  (I have
not committed these fixes to the NetBSD tree because I cannot test
them at the moment.)

-- 
Julio Merino / @jmmv


Re: CVS commit: src/external/bsd/atf/dist/atf-run

2011-12-23 Thread Christos Zoulas
On Dec 23, 10:47am, j...@netbsd.org (Julio Merino) wrote:
-- Subject: Re: CVS commit: src/external/bsd/atf/dist/atf-run

| On 12/19/11 10:25 PM, Christos Zoulas wrote:
|  Module Name:src
|  Committed By:   christos
|  Date:   Mon Dec 19 22:25:46 UTC 2011
|  
|  Modified Files:
|  src/external/bsd/atf/dist/atf-run: timer.cpp
|  
|  Log Message:
|  - make all the ifdefs match
|  - make it compile, and test
| 
| This was still broken.
| 
| timer_t and itimerspec do not exist, so the timer.hpp file is unusable.
|  The definition of HAVE_POSIX_TIMER does not work because SIGEV_NONE is
| defined in OS X.  The change of sys/time.h and signal.h to ctime and
| csignal seems to cause issues too.
| 
| I have had to fix this by adding a configure test for timer_t, using the
| pimpl idiom for the timer class definition to prevent further ifdef mess
| in timer.hpp, and had to sprinkle some more ifdef stuff in the code.
| 
| The result is incredibly ugly, and I doubt there is any real benefit
| other than using modern interfaces.  Was it really worth it?  (I have
| not committed these fixes to the NetBSD tree because I cannot test
| them at the moment.)

I don't know. I would not have guessed that OS/X is lacking them, since
they've been around for more than a decade.

christos


Re: CVS commit: src/external/bsd/atf/dist/atf-run

2011-12-21 Thread Julio Merino
On Sun, Dec 18, 2011 at 10:34 PM, Christos Zoulas chris...@netbsd.orgwrote:

 Module Name:src
 Committed By:   christos
 Date:   Sun Dec 18 22:34:06 UTC 2011

 Modified Files:
src/external/bsd/atf/dist/atf-run: timer.cpp timer.hpp

 Log Message:
 Don't use antiquated BSD API's that require global variable, use posix
 timers
 instead.


Interesting; didn't know about these.

But what's the point of this change?  It breaks OS X at least and does not
fix anything AFAICT.

-- 
Julio Merino / @jmmv


Re: CVS commit: src/external/bsd/atf/dist/atf-run

2011-12-21 Thread Julio Merino
On Mon, Dec 19, 2011 at 5:58 PM, Christos Zoulas chris...@zoulas.comwrote:

 On Dec 19,  5:00pm, j...@netbsd.org (Julio Merino) wrote:
 -- Subject: Re: CVS commit: src/external/bsd/atf/dist/atf-run

 | Interesting; didn't know about these.
 |
 | But what's the point of this change?  It breaks OS X at least and does
 not
 | fix anything AFAICT.

 I am just trying to use modern POSIX API's to improve portability


Well... modern has come to mean less portable in my book.  (I like using
modern APIs, but they tend to break grgrgr.)


 (and functionality in this case). For example, by using sigevent,
 one doesn't need to have global variables and he can pass the struct
 he wants to modify in the signal. In addition, one can use the
 monotonic clock, which is immune against time changes, and also
 use timespec which is more precise. Finally one is not limited to
 sigalrm for timers, but can send any signal.


Thanks.


 I am really suprised
 that OS/X does not have them; I would have expected it to work on
 more systems than it does currently...


I could only check with Snow Leopard and there is no timer_t there.  I
don't have access to Lion at the moment; when I do, I'll check again.  If
there is no support in it, I'll have to implement some conditional logic to
use the new timers only if available (unless you have a better
alternative?).  If there is support, then I won't care about backwards
compatibility.

-- 
Julio Merino / @jmmv


Re: CVS commit: src/external/bsd/atf/dist/atf-run

2011-12-21 Thread Julio Merino
On Mon, Dec 19, 2011 at 8:32 PM, Christos Zoulas chris...@zoulas.comwrote:

 On Dec 19,  6:06pm, j...@netbsd.org (Julio Merino) wrote:
 -- Subject: Re: CVS commit: src/external/bsd/atf/dist/atf-run

 | I could only check with Snow Leopard and there is no timer_t there.  I
 | don't have access to Lion at the moment; when I do, I'll check again.  If
 | there is no support in it, I'll have to implement some conditional logic
 to
 | use the new timers only if available (unless you have a better
 | alternative?).  If there is support, then I won't care about backwards
 | compatibility.

 Since it is my fault that I broke it, I will add a shim for OS/X that
 does not do anything fancy and implements the previous basic functionality
 that setitimer had.


Could you check if this support exists in Lion first?  If that's the case,
I personally don't think it is a big deal.  But thanks if you do that!

-- 
Julio Merino / @jmmv


Re: CVS commit: src/external/bsd/atf/dist/atf-run

2011-12-19 Thread Christos Zoulas
On Dec 19,  5:00pm, j...@netbsd.org (Julio Merino) wrote:
-- Subject: Re: CVS commit: src/external/bsd/atf/dist/atf-run

| Interesting; didn't know about these.
| 
| But what's the point of this change?  It breaks OS X at least and does not
| fix anything AFAICT.

I am just trying to use modern POSIX API's to improve portability
(and functionality in this case). For example, by using sigevent,
one doesn't need to have global variables and he can pass the struct
he wants to modify in the signal. In addition, one can use the
monotonic clock, which is immune against time changes, and also
use timespec which is more precise. Finally one is not limited to
sigalrm for timers, but can send any signal. I am really suprised
that OS/X does not have them; I would have expected it to work on
more systems than it does currently...

christos


Re: CVS commit: src/external/bsd/atf/dist/atf-run

2011-12-19 Thread Christos Zoulas
On Dec 19,  6:06pm, j...@netbsd.org (Julio Merino) wrote:
-- Subject: Re: CVS commit: src/external/bsd/atf/dist/atf-run

| I could only check with Snow Leopard and there is no timer_t there.  I
| don't have access to Lion at the moment; when I do, I'll check again.  If
| there is no support in it, I'll have to implement some conditional logic to
| use the new timers only if available (unless you have a better
| alternative?).  If there is support, then I won't care about backwards
| compatibility.

Since it is my fault that I broke it, I will add a shim for OS/X that
does not do anything fancy and implements the previous basic functionality
that setitimer had.

christos


Re: CVS commit: src/external/bsd/atf/dist/atf-run

2011-12-19 Thread Christos Zoulas
On Dec 19,  8:37pm, j...@netbsd.org (Julio Merino) wrote:
-- Subject: Re: CVS commit: src/external/bsd/atf/dist/atf-run

| Could you check if this support exists in Lion first?  If that's the case,
| I personally don't think it is a big deal.  But thanks if you do that!

It does not, and I've put compatibility code back.

christos


Re: CVS commit: src/external/bsd/atf/dist/atf-run

2011-03-30 Thread Paul Goyette

Module Name:src
Committed By:   jmmv
Date:   Wed Mar 30 11:10:56 UTC 2011

Modified Files:
   src/external/bsd/atf/dist/atf-run: fs.cpp

Log Message:
Pull up upstream revision 648ed6360b2b7cda81a6079b00dc436d09c745b8:

Retry calls that raise file system errors during cleanup


Does this fix the occassional failures similar to the following?

fs/psshfs/t_psshfs (94/365): 3 test cases
inode_nos: atf-run: ERROR: XXX: Cannot get information of 
/tmp/atf-run.00369p/mnt; lstat(2) failed: Device not configured
Passed.
atf-report: ERROR: 5704: Unexpected token `EOF'; expected start of test
atf-report: case



-
| 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/external/bsd/atf/dist/atf-run

2011-03-17 Thread Christos Zoulas
In article 20110317194537.13adb17...@cvs.netbsd.org,
Julio Merino source-changes-d@NetBSD.org wrote:
-=-=-=-=-=-

Module Name:   src
Committed By:  jmmv
Date:  Thu Mar 17 19:45:36 UTC 2011

Modified Files:
   src/external/bsd/atf/dist/atf-run: test-program.cpp

Log Message:
Pull up revision 3dd2481ec97b2fde76521939b6451d03ce989745 from upstream:

Really kill subprocesses of a test case before waiting for its completion

Before waiting for any leftover output of the test case after it terminates,
we must ensure that all of its subprocess are really, really dead.  Otherwise,
these subprocesses may be sharing the stdout of the test case, in which case
our wait will block (potentially indefinitely).

This finally (well, hopefully) fixes some random lockups exposed by the
NetBSD test suite.  Reported by Antti Kantee after
tests/fs/vfs/t_full:p2k_ffs_fillfs was exposing this problem in a pretty
reproducible manner.


To generate a diff of this commit:
cvs rdiff -u -r1.7 -r1.8 src/external/bsd/atf/dist/atf-run/test-program.cpp

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.


-=-=-=-=-=-

Modified files:

Index: src/external/bsd/atf/dist/atf-run/test-program.cpp
diff -u src/external/bsd/atf/dist/atf-run/test-program.cpp:1.7
src/external/bsd/atf/dist/atf-run/test-program.cpp:1.8
--- src/external/bsd/atf/dist/atf-run/test-program.cpp:1.7 Tue Nov 16
17:55:56 2010
+++ src/external/bsd/atf/dist/atf-run/test-program.cpp Thu Mar 17 19:45:36 2011
@@ -1,7 +1,7 @@
 //
 // Automated Testing Framework (atf)
 //
-// Copyright (c) 2007, 2008, 2009, 2010 The NetBSD Foundation, Inc.
+// Copyright (c) 2007, 2008, 2009, 2010, 2011 The NetBSD Foundation, Inc.
 // All rights reserved.
 //
 // Redistribution and use in source and binary forms, with or without
@@ -724,10 +724,9 @@
 UNREACHABLE;
 }
 
-::killpg(child_pid, SIGTERM);
+::killpg(child_pid, SIGKILL);

This is not very polite, as you are not giving them a chance to cleanup.

christos