Re: CVS commit: src/tests/kernel

2016-11-06 Thread Nicolas Joly
On Sun, Nov 06, 2016 at 11:56:31PM +0700, Robert Elz wrote:
> Date:Sun, 6 Nov 2016 16:24:16 +
> From:"Kamil Rytarowski" <ka...@netbsd.org>
> Message-ID:  <20161106162416.95d77f...@cvs.netbsd.org>
> 
>   | assert_pid1 asserts that non-root user cannot attach to PID 1 as it is the
>   | /dev/init process. This tests is skipped if run as root.
> 
> There's no need to skip it, just
> 
>   child=fork();   /* err if -1 */
>   if (child == 0) {
>   (void)setuid(10);
>   if (ptrace(.) < 0)
>   _exit(errno);
>   else
>   _exit(0);
>   }
>   waitpid(child, , 0);
>   /* and check status */
> 
> If you're root, the setuid() works, and the child isn't root any more.
> if you happened to be uid(10), the setuid() is a no-op, if you were some
> other user the setuid() fails, but you don't care.

Or use dedicated ATF properties :

  atf_tc_set_md_var(tc, "require.user", "unprivileged");

Documented in atf-test-case(4).

-- 
Nicolas Joly

Cluster & Computing Group
Biology IT Center
Institut Pasteur, Paris.


Re: CVS commit: src/sys/miscfs/procfs

2014-07-12 Thread Nicolas Joly
On Sat, Jul 12, 2014 at 08:11:46PM +1000, matthew green wrote:
 
 Nicolas Joly writes:
  Module Name:src
  Committed By:   njoly
  Date:   Sat Jul 12 09:58:39 UTC 2014
  
  Modified Files:
  src/sys/miscfs/procfs: procfs_linux.c
  
  Log Message:
  Use kproc2 to provide sensible informations for /proc/pid/stat.
 
 hmm, kernel code should really avoid using the userland compat layer.
 you're processing something from one known layout to another known
 layout.. userland needs it because it only knows one of them, which
 has a known forwards/backwards compat layout.

I was trying to avoid duplicating all the needed computation ...
/proc/pid/stat is another exact version (kernel) of the userland
processes infos.

Do we need another intermediate layer to fill a kernel only structure
which can then be easily translated to kproc2 ?

-- 
Nicolas Joly

Biology IT Center
Institut Pasteur, Paris.


Re: CVS commit: src/tests/fs/common

2013-03-18 Thread Nicolas Joly
On Sat, Mar 16, 2013 at 05:25:00AM +, Julio M. Merino Vidal wrote:
 Module Name:  src
 Committed By: jmmv
 Date: Sat Mar 16 05:25:00 UTC 2013
 
 Modified Files:
   src/tests/fs/common: h_fsmacros.h
 
 Log Message:
 Mark the zfs tests as requiring root.
 
 This is wrong.  The zfs tests already use rump so they should not require
 root.  However, I've already spent much more time than I wanted trying to
 figure out why that's the case without much luck.  If you can find why,
 just remove this hack.

The zfs tests are failing when run as an unprivileged user in
thread_create() ... because default limit for threads (160) is too
low ! When run as root, the limit value (2500) seems to be high enough.

-- 
Nicolas Joly

Biology IT Center
Institut Pasteur, Paris.


Re: CVS commit: src/etc/rc.d

2012-12-17 Thread Nicolas Joly
On Fri, Dec 14, 2012 at 06:42:26PM +, Alan Barrett wrote:
 Module Name:  src
 Committed By: apb
 Date: Fri Dec 14 18:42:25 UTC 2012
 
 Modified Files:
   src/etc/rc.d: random_seed
 
 Log Message:
 Avoid using programs from /usr/bin.  This should fix PR 47326.
 
 - no need for dirname, because df -G can take a file name directly.
 - replace use of awk with a shell while read loop.
 - replace use of stat -s with ls -ldn.
 - no need for tail now that the use of stat has changed.
 
 While here, also add some shell quotes and improve the grammar in a comment.

With this change, i do still see a bootstrap problem when
${random_file} doesn't exists ...

njoly@lynche [~]# ls -l /var/db/entropy-file
ls: /var/db/entropy-file: No such file or directory
root@lynche [~]# /etc/rc.d/random_seed stop
df: /var/db/entropy-file: No such file or directory

Actually, if the file does not exists it will fail to create one.

random_save()
{
oum=$(umask)
umask 077

rm -Pf ${random_file}

if ! fs_safe ${random_file}; then
return 1
fi

if rndctl -S ${random_file}; then
echo Saved entropy to disk.
fi
}

First, rm(1) is called before fs_safe() check which will always
fail. Even with the rm call commented or better moved just before
rndctl, the fs_safe call will fail in df(1) if file does not already
exists. Chicken or Egg ...

-- 
Nicolas Joly

Biology IT Center
Institut Pasteur, Paris.


Re: CVS commit: src/lib/libc/arch/alpha/gen

2012-03-21 Thread Nicolas Joly
On Wed, Mar 21, 2012 at 10:42:58PM +0200, Alan Barrett wrote:
 On Wed, 21 Mar 2012, Havard Eidnes wrote:
 Modified Files:
  src/lib/libc/arch/alpha/gen: fpgetround.c fpsetround.c
 
 Log Message:
 Add some casts to get rid of bitwise op on signed value is non-portable
 warning from lint.
 
 I see no bitwise ops on signed values here.
 
 -return ((fpcrval.u64  58)  0x3);
 +return ((fp_rnd)(fpcrval.u64  58)  0x3);
 
 fpcrval.u64 is uint64_t.  After the integer promotions,
 it's still uint64_t (unless that's smaller than int, which is not 
 the case for any existing NetBSD port).  After 58, it's still 
 uint64_t.  0x3 is a signed int, but the usual arithmetic conversions
 should convert it to uint64_t.

The commit message reference the wrong lint warning.

/local/src/NetBSD/src/lib/libc/arch/alpha/gen/fpgetround.c(61): warning: 
conversion from 'unsigned long' to 'enum unnamed' may lose accuracy [132]
/local/src/NetBSD/src/lib/libc/arch/alpha/gen/fpsetround.c(61): warning: 
conversion from 'unsigned long' to 'enum unnamed' may lose accuracy [132]

-- 
Nicolas Joly

Projects and Developments in Bioinformatics
Institut Pasteur, Paris.


Re: CVS commit: src/sbin/ifconfig

2012-03-17 Thread Nicolas Joly
On Sat, Mar 17, 2012 at 06:53:31PM +0200, Jukka Ruohonen wrote:
 On Fri, Mar 16, 2012 at 10:25:08PM -0400, Christos Zoulas wrote:
  Module Name:src
  Committed By:   christos
  Date:   Sat Mar 17 02:25:08 UTC 2012
  
  Modified Files:
  src/sbin/ifconfig: af_inetany.c
  
  Log Message:
  PR/43141: Tobias Nygren: Print an error on unknown interfaces.
 
 Now this is trival and it is fixed. But I guess there is a bug here in ATF.
 The test only checks that the exit code is not zero:
 
 atf_check -s not-exit:0 ifconfig nonexistent0 1.2.3.4/24
 
 But why is stderr being involved?

atf_check defaults to '-s exit:0 -o empty -e empty'.
Adding '-e ignore' should do the trick.

-- 
Nicolas Joly

Projects and Developments in Bioinformatics
Institut Pasteur, Paris.


Re: CVS commit: src/external/bsd/mdocml/dist

2011-12-18 Thread Nicolas Joly
On Sun, Dec 18, 2011 at 04:58:02PM +0100, Joerg Sonnenberger wrote:
 On Sun, Dec 18, 2011 at 01:40:08PM +, Nicolas Joly wrote:
  Module Name:src
  Committed By:   njoly
  Date:   Sun Dec 18 13:40:08 UTC 2011
  
  Modified Files:
  src/external/bsd/mdocml/dist: arch.in
  
  Log Message:
  Lowercase arch strings, and add missing ones.
 
 The former is wrong and should have at least been discussed on the
 mdocml mailing lists...

Really ? Doesn't arch.in, like other .in files, intended for operating
system customization ?

-- 
Nicolas Joly

Projects and Developments in Bioinformatics
Institut Pasteur, Paris.


Re: amd64 direct map causing crashes at boot (Re: CVS commit: src/sys/arch)

2011-12-09 Thread Nicolas Joly
On Fri, Dec 09, 2011 at 02:41:16PM +0100, Manuel Bouyer wrote:
 On Thu, Dec 08, 2011 at 11:24:35PM +0100, Nicolas Joly wrote:
  On Thu, Dec 08, 2011 at 11:21:31PM +0100, Joerg Sonnenberger wrote:
   On Thu, Dec 08, 2011 at 11:10:41PM +0100, Nicolas Joly wrote:
I do have two machines that fail to boot with this change.

1) A Dell Optiplex 740 that reboots early after loading the kernel.
   Includes 1 AMD Athlon(tm) 64 X2 Dual Core Processor 4800+ CPU.

2) A Supermicro H8DG6-F motherboard (only 1 socket populated) later on
   boot mostly when sshd start (or fc-cache is updated).
   Includes 1 AMD Opteron(tm) Processor 6128A CPU
   
   Can you try to disable the use of 1GB pages?
  
  Already tested for the 6128A, still no luck.
 
 Can you print the content of mem_clusters[] and mem_cluster_count ?
 I wonder if we're missing some memory ...

Here's the DEBUG_MEMLOAD output that Chuck already asked

BIOS MEMORY MAP (12 ENTRIES):
addr 0x0  size 0x93800  type 0x1
addr 0x93800  size 0xc800  type 0x2
addr 0xe6000  size 0x1a000  type 0x2
addr 0x10  size 0xb7d8  type 0x1
addr 0xb7e8e000  size 0x2000  type 0x9
addr 0xb7e9  size 0x24000  type 0x3
addr 0xb7eb4000  size 0x2c000  type 0x4
addr 0xb7ee  size 0x2  type 0x2
addr 0xb7f0  size 0x10  type 0x2
addr 0xe000  size 0x1000  type 0x2
addr 0xffe0  size 0x20  type 0x2
addr 0x1  size 0x14800  type 0x1
loading first16q 0xf000-0x93000 (0xf-0x93)
loading first4gq 0x133e000-0xb7e8 (0x133e-0xb7e80)
loading default 0x1-0x24800 (0x10-0x248000)

Does this fit your needs or do you need mem_clusters output too ?

-- 
Nicolas Joly

Projects and Developments in Bioinformatics
Institut Pasteur, Paris.


Re: amd64 direct map causing crashes at boot (Re: CVS commit: src/sys/arch)

2011-12-09 Thread Nicolas Joly
On Fri, Dec 09, 2011 at 03:30:38PM +0100, Manuel Bouyer wrote:
 
 I'd like to see what mem_clusters[] looks like, especially
 mem_clusters[mem_cluster_cnt - 1]

Added the printfs at the end of initx86_parse_memmap(), and got this:

mem_cluster_cnt = 3
  0  addr 0x0  size 0x93000
  1  addr 0x10  size 0xb7d8
  2  addr 0x1  size 0x14800

-- 
Nicolas Joly

Projects and Developments in Bioinformatics
Institut Pasteur, Paris.


Re: amd64 direct map causing crashes at boot (Re: CVS commit: src/sys/arch)

2011-12-08 Thread Nicolas Joly
On Thu, Dec 08, 2011 at 07:47:07AM -0800, Chuck Silvers wrote:
 
 I got another report yesterday morning that this is causing problems.
 from the info I've gotten from the other person so far, I'm at a loss
 to explain why this doesn't work for some people.  I've added back
 some code to allow building a kernel with __HAVE_DIRECT_MAP disabled,
 just comment out that block in arch/amd64/include/types.h.

That was me.

I do have two machines that fail to boot with this change.

1) A Dell Optiplex 740 that reboots early after loading the kernel.
   Includes 1 AMD Athlon(tm) 64 X2 Dual Core Processor 4800+ CPU.

2) A Supermicro H8DG6-F motherboard (only 1 socket populated) later on
   boot mostly when sshd start (or fc-cache is updated).
   Includes 1 AMD Opteron(tm) Processor 6128A CPU

Since then i checked on a 3rd machine which has no problem so far.

3) A Sony VAIO VGNBZ12-VN laptop.
   Includes 1 Ïntel(R) Core(TM)2 Duo CPU P8600  @ 2.40GHz CPU.

-- 
Nicolas Joly

Projects and Developments in Bioinformatics
Institut Pasteur, Paris.


Re: amd64 direct map causing crashes at boot (Re: CVS commit: src/sys/arch)

2011-12-08 Thread Nicolas Joly
On Thu, Dec 08, 2011 at 11:21:31PM +0100, Joerg Sonnenberger wrote:
 On Thu, Dec 08, 2011 at 11:10:41PM +0100, Nicolas Joly wrote:
  I do have two machines that fail to boot with this change.
  
  1) A Dell Optiplex 740 that reboots early after loading the kernel.
 Includes 1 AMD Athlon(tm) 64 X2 Dual Core Processor 4800+ CPU.
  
  2) A Supermicro H8DG6-F motherboard (only 1 socket populated) later on
 boot mostly when sshd start (or fc-cache is updated).
 Includes 1 AMD Opteron(tm) Processor 6128A CPU
 
 Can you try to disable the use of 1GB pages?

Already tested for the 6128A, still no luck.

-- 
Nicolas Joly

Projects and Developments in Bioinformatics
Institut Pasteur, Paris.


Re: amd64 direct map causing crashes at boot (Re: CVS commit: src/sys/arch)

2011-12-08 Thread Nicolas Joly
On Thu, Dec 08, 2011 at 11:17:54PM +0100, Manuel Bouyer wrote:
 On Thu, Dec 08, 2011 at 11:10:41PM +0100, Nicolas Joly wrote:
  That was me.
  
  I do have two machines that fail to boot with this change.
  
  1) A Dell Optiplex 740 that reboots early after loading the kernel.
 Includes 1 AMD Athlon(tm) 64 X2 Dual Core Processor 4800+ CPU.
  
  2) A Supermicro H8DG6-F motherboard (only 1 socket populated) later on
 boot mostly when sshd start (or fc-cache is updated).
 Includes 1 AMD Opteron(tm) Processor 6128A CPU
 
 Do they announce 1GB pages support ?

Only the 6128A Opteron.

-- 
Nicolas Joly

Projects and Developments in Bioinformatics
Institut Pasteur, Paris.


Re: CVS commit: src/sys/arch/alpha/alpha

2011-07-26 Thread Nicolas Joly
On Tue, Jul 26, 2011 at 05:27:38PM +0200, Joerg Sonnenberger wrote:
 On Tue, Jul 26, 2011 at 02:59:04PM +, Nicolas Joly wrote:
  Module Name:src
  Committed By:   njoly
  Date:   Tue Jul 26 14:59:03 UTC 2011
  
  Modified Files:
  src/sys/arch/alpha/alpha: autoconf.c
  
  Log Message:
  Make atoi func static, and constify
 
 Shouldn't this use strtol to implement atoi?

We don't have strtol for kernel use.

-- 
Nicolas Joly

Projects and Developments in Bioinformatics
Institut Pasteur, Paris.


Re: CVS commit: src/sys/arch/alpha/alpha

2011-07-26 Thread Nicolas Joly
On Tue, Jul 26, 2011 at 06:45:31PM +0200, Joerg Sonnenberger wrote:
 On Tue, Jul 26, 2011 at 06:19:21PM +0200, Nicolas Joly wrote:
  On Tue, Jul 26, 2011 at 05:27:38PM +0200, Joerg Sonnenberger wrote:
   On Tue, Jul 26, 2011 at 02:59:04PM +, Nicolas Joly wrote:
Module Name:src
Committed By:   njoly
Date:   Tue Jul 26 14:59:03 UTC 2011

Modified Files:
src/sys/arch/alpha/alpha: autoconf.c

Log Message:
Make atoi func static, and constify
   
   Shouldn't this use strtol to implement atoi?
  
  We don't have strtol for kernel use.
 
 Then use strtoll. We have at least some conversion code in libkern.

Looking how many atoi() copies we have in tree, does it make sense to
add the following at the end of libkern.h

LIBKERN_INLINE int atoi(const char *) __unused;

#ifdef LIBKERN_BODY
LIBKERN_INLINE int
atoi(const char *s)
{
return (int)strtoll(s, NULL, 10);
}
#endif

and rename the conflicting ones (dm, ptyfs and procfs).

njoly@lanfeust [NetBSD/src] find sys -type f -name '*.[ch]'| xargs grep 
'atoi(.*char'
sys/arch/alpha/alpha/autoconf.c:static int atoi(const char *);
sys/arch/alpha/alpha/autoconf.c:atoi(const char *s)
sys/arch/amiga/dev/ite.c:inline static int atoi(const char *);
sys/arch/amiga/dev/ite.c:atoi(const char *cp)
sys/arch/atari/dev/ite.c:static inline int  atoi(const char *);
sys/arch/hp300/stand/common/devopen.c:atoi(char *cp)
sys/arch/hp300/stand/common/samachdep.h:int atoi(char *);
sys/arch/i386/stand/lib/bootmenu.c:atoi(const char *in)
sys/arch/i386/stand/lib/bootmenu.h:int atoi(const char *);
sys/arch/next68k/next68k/autoconf.c:static int atoi(const char *);
sys/arch/next68k/next68k/autoconf.c:atoi(const char *s)
sys/arch/next68k/stand/boot/devopen.c:int atoi(const char *);
sys/arch/next68k/stand/boot/devopen.c:atoi(const char *cp)
sys/arch/prep/stand/boot/devopen.c:int atoi(char *);
sys/arch/prep/stand/boot/devopen.c:atoi(char *cp)
sys/arch/rs6000/stand/boot/devopen.c:int atoi(char *);
sys/arch/rs6000/stand/boot/devopen.c:atoi(char *cp)
sys/arch/vax/boot/boot/devopen.c:intatoi(char *);
sys/arch/x68k/dev/ite.c:inline static int atoi(const char *);
sys/arch/x68k/dev/ite.c:atoi(const char *cp)
sys/arch/zaurus/stand/zboot/bootmenu.c:atoi(const char *in)
sys/arch/zaurus/stand/zboot/bootmenu.h:int atoi(const char *);
sys/compat/ndis/subr_ntoskrnl.c:atoi(const char *str)
sys/dev/dm/dm.h:uint64_t atoi(const char *);
sys/dev/dm/dm_target_linear.c:atoi(const char *s)
sys/dev/raidframe/rf_utils.c:rf_atoi(char *p)
sys/dev/raidframe/rf_utils.h:int rf_atoi(char *p);
sys/fs/ptyfs/ptyfs_vnops.c:static int atoi(const char *, size_t);
sys/fs/ptyfs/ptyfs_vnops.c:atoi(const char *b, size_t len)
sys/miscfs/procfs/procfs_vnops.c:static int atoi(const char *, size_t);
sys/miscfs/procfs/procfs_vnops.c:atoi(const char *b, size_t len)

-- 
Nicolas Joly

Projects and Developments in Bioinformatics
Institut Pasteur, Paris.


Re: CVS commit: src/sys/arch/alpha/alpha

2011-07-26 Thread Nicolas Joly
On Wed, Jul 27, 2011 at 02:33:24AM +0900, Izumi Tsutsui wrote:
  Looking how many atoi() copies we have in tree, does it make sense to
  add the following at the end of libkern.h
 
 Please don't use it for #ifdef _STANDALONE ones.
 libc's strtoll() is larger than dumb atoi()s.

Fine. No need then, i'll only update the alpha one.

-- 
Nicolas Joly

Projects and Developments in Bioinformatics
Institut Pasteur, Paris.


Re: CVS commit: src/distrib/sets/lists

2011-05-30 Thread Nicolas Joly
On Mon, May 30, 2011 at 09:17:52AM +, Christos Zoulas wrote:
 In article 9fd1caa9-1c17-4198-a9cc-57f4de798...@gmail.com,
 Adam Hamsik  haa...@gmail.com wrote:
 
 libdns was minor bumped after last bind update you should mark old
 entries obsolete
 and add new ones. Same should be done for all 64 archs.
 
 I think that this is not true for shared libraries; this happens
 automatically now. Perhaps not for .debug libraries? If that's the
 case it should be fixed.

I tweaked postinstall, quite some time ago, to handle debug libraries
too. AFAIK, it works.

-- 
Nicolas Joly

Projects and Developments in Bioinformatics
Institut Pasteur, Paris.


Re: CVS commit: src/distrib/sets/lists

2011-05-30 Thread Nicolas Joly
On Mon, May 30, 2011 at 12:52:57PM +0200, Adam Hamsik wrote:
 
 On May,Monday 30 2011, at 11:23 AM, Nicolas Joly wrote:
 
  On Mon, May 30, 2011 at 09:17:52AM +, Christos Zoulas wrote:
  In article 9fd1caa9-1c17-4198-a9cc-57f4de798...@gmail.com,
  Adam Hamsik  haa...@gmail.com wrote:
  
  libdns was minor bumped after last bind update you should mark old
  entries obsolete
  and add new ones. Same should be done for all 64 archs.
  
  I think that this is not true for shared libraries; this happens
  automatically now. Perhaps not for .debug libraries? If that's the
  case it should be fixed.
  
  I tweaked postinstall, quite some time ago, to handle debug libraries
  too. AFAIK, it works.
 
 I was not aware of that, it might be a good idea to document this difference
 in set lists file which is different. e.g. in shl.mi now.

Actually, only minor number changes are handled automatically for both
shared/debug libraries.

I do have, on my TODO list, to add a postinstall majorlib target
(which will default to off) to ease builds when major is incremented.
This is a real pain for MKDEBUG builds ... Just like kernel version
bump versus module tree.

-- 
Nicolas Joly

Projects and Developments in Bioinformatics
Institut Pasteur, Paris.


Re: CVS commit: src/distrib/sets/lists

2011-05-30 Thread Nicolas Joly
On Mon, May 30, 2011 at 03:37:13PM +0200, Nicolas Joly wrote:
 On Mon, May 30, 2011 at 12:52:57PM +0200, Adam Hamsik wrote:
  
  On May,Monday 30 2011, at 11:23 AM, Nicolas Joly wrote:
  
   On Mon, May 30, 2011 at 09:17:52AM +, Christos Zoulas wrote:
   In article 9fd1caa9-1c17-4198-a9cc-57f4de798...@gmail.com,
   Adam Hamsik  haa...@gmail.com wrote:
   
   libdns was minor bumped after last bind update you should mark old
   entries obsolete
   and add new ones. Same should be done for all 64 archs.
   
   I think that this is not true for shared libraries; this happens
   automatically now. Perhaps not for .debug libraries? If that's the
   case it should be fixed.
   
   I tweaked postinstall, quite some time ago, to handle debug libraries
   too. AFAIK, it works.
  
  I was not aware of that, it might be a good idea to document this difference
  in set lists file which is different. e.g. in shl.mi now.
 
 Actually, only minor number changes are handled automatically for both
 shared/debug libraries.
 
 I do have, on my TODO list, to add a postinstall majorlib target
 (which will default to off) to ease builds when major is incremented.
 This is a real pain for MKDEBUG builds ... Just like kernel version
 bump versus module tree.

Well, not MKDEBUG, but MKUPDATE builds.

-- 
Nicolas Joly

Projects and Developments in Bioinformatics
Institut Pasteur, Paris.


Re: CVS commit: src/distrib/sets/lists/comp

2011-05-09 Thread Nicolas Joly
On Mon, May 09, 2011 at 03:17:54PM +0200, Adam Hamsik wrote:
 
 I'm getting this error with sources updated couple of minutes ago 
 
 ===  24 extra files in DESTDIR  =
 Files in DESTDIR but missing from flist.
 File is obsolete or flist is out of date ?
 --
 ./usr/include/perfuse.h
 ./usr/lib/i386/libperfuse.a
 ./usr/lib/i386/libperfuse.so
 ./usr/lib/i386/libperfuse.so.0
 ./usr/lib/i386/libperfuse.so.0.0
 ./usr/lib/i386/libperfuse_p.a
 ./usr/lib/i386/libperfuse_pic.a
 ./usr/lib/libperfuse.a
 ./usr/lib/libperfuse.so
 ./usr/lib/libperfuse.so.0
 ./usr/lib/libperfuse.so.0.0
 ./usr/lib/libperfuse_p.a
 ./usr/lib/libperfuse_pic.a
 ./usr/libdata/debug/usr/lib/i386/libperfuse.so.0.0.debug
 ./usr/libdata/debug/usr/lib/libperfuse.so.0.0.debug
 ./usr/libdata/debug/usr/sbin/perfused.debug
 ./usr/libdata/lint/llib-lperfuse.ln
 ./usr/sbin/perfused
 ./usr/share/man/cat3/libperfuse.0
 ./usr/share/man/cat8/perfused.0
 ./usr/share/man/html3/libperfuse.html
 ./usr/share/man/html8/perfused.html
 ./usr/share/man/man3/libperfuse.3
 ./usr/share/man/man8/perfused.8
 =  end of 24 extra files  ===

All these entries have the `perfuse' keyword, which means that they
will be selected for MKPERFUSE=yes builds only. But MKPERFUSE variable
is not defined anywhere ...

Do we need to add another optional component here (Makefiles will then
need some tweaks), or should the keywords need to be wiped out from
lists ?

Manu ?

-- 
Nicolas Joly

Projects and Developments in Bioinformatics
Institut Pasteur, Paris.


Re: CVS commit: src/tests/syscall

2011-04-04 Thread Nicolas Joly
On Mon, Apr 04, 2011 at 08:32:14AM +0300, Jukka Ruohonen wrote:
 On Mon, Apr 04, 2011 at 01:59:50AM +, Christos Zoulas wrote:
  Check for getuid(2) == 0.
  
  Why not setuid() to fix it?
 
 That would indeed be the right thing to do. However, I am not quite sure how
 atf(7) actually works. It seems to create some temporary files such that
 simply changing the real and effective UID in the middle of a test gives
 
tc-se:FATAL ERROR: Cannot create results file '/tmp/atf-run.21878a/tcr':
Permission denied
 
 I am not sure whether this particular test deserves a more complex solution.

Adding the following to the testcase header should do the trick:

   atf_tc_set_md_var(tc,require.user,unprivileged);

In that case, if run as root, it will lower its privileges to the
unprivileged user _atf before running the test.

-- 
Nicolas Joly

Projects and Developments in Bioinformatics
Institut Pasteur, Paris.


Re: CVS commit: src/tests/syscall

2011-04-04 Thread Nicolas Joly
On Mon, Apr 04, 2011 at 10:18:52AM +0300, Jukka Ruohonen wrote:
 On Mon, Apr 04, 2011 at 09:05:19AM +0200, Nicolas Joly wrote:
  Adding the following to the testcase header should do the trick:
  
 atf_tc_set_md_var(tc,require.user,unprivileged);
  
  In that case, if run as root, it will lower its privileges to the
  unprivileged user _atf before running the test.
 
 Thanks, that indeed does the job.
 
 If I may express my humble opinion, there seems to be currently way too much
 weird macro-magic and undocumented calls in atf(7)...

Meta-data properties, like this one, are already described in
atf-test-case(4) man page.

-- 
Nicolas Joly

Projects and Developments in Bioinformatics
Institut Pasteur, Paris.


Re: CVS commit: src/tests

2011-03-25 Thread Nicolas Joly
On Fri, Mar 25, 2011 at 10:00:32AM +, Jukka Ruohonen wrote:
 Module Name:  src
 Committed By: jruoho
 Date: Fri Mar 25 10:00:32 UTC 2011
 
 Modified Files:
   src/tests/include/sys: t_bitops.c
   src/tests/lib/libm: t_ceil.c t_floor.c
 
 Log Message:
 Bluntly skip the tests that fail under QEMU. XXX: system(3) is used for this?

Skipping them is not the right solution IMO. I would expect them to
fail if run under QEMU:

if (system(cpuctl identify 0 | grep -q QEMU) == 0)
atf_tc_expect_fail(PR misc/44767: floating point support broken in 
QEMU);

 To generate a diff of this commit:
 cvs rdiff -u -r1.4 -r1.5 src/tests/include/sys/t_bitops.c
 cvs rdiff -u -r1.1 -r1.2 src/tests/lib/libm/t_ceil.c
 cvs rdiff -u -r1.2 -r1.3 src/tests/lib/libm/t_floor.c
 
 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

-- 
Nicolas Joly

Projects and Developments in Bioinformatics
Institut Pasteur, Paris.


Re: CVS commit: src/tests

2011-03-25 Thread Nicolas Joly
On Fri, Mar 25, 2011 at 12:15:08PM +0200, Jukka Ruohonen wrote:
 On Fri, Mar 25, 2011 at 11:09:26AM +0100, Nicolas Joly wrote:
  Skipping them is not the right solution IMO.
 
 I have no strong opinion about this. But to me it seems that these
 bugs/tests are really testing an emulator instead of NetBSD itself.

We do exercise with tests the tuple of hardware (or emulator) and OS.
Tests should show existing problems on the tested infrastructure.

And it could be a good way to know if/when QEMU fixed the reported
problems, without following it too closely ...

-- 
Nicolas Joly

Projects and Developments in Bioinformatics
Institut Pasteur, Paris.


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

2010-11-26 Thread Nicolas Joly
On Fri, Nov 26, 2010 at 12:04:36PM +, Antti Kantee wrote:
 Module Name:  src
 Committed By: pooka
 Date: Fri Nov 26 12:04:36 UTC 2010
 
 Modified Files:
   src/external/bsd/atf/dist/atf-sh: atf-check.cpp
 
 Log Message:
 Remove spammy (debug?) prints.  took ages to figure out they were
 not coming from my application...
 
 XXX: the memcmp below looks suspicious

XXX: Likewise for error messages.

-- 
Nicolas Joly

Biological Software and Databanks.
Institut Pasteur, Paris.


Re: CVS commit: src/lib/libc/stdlib

2010-09-30 Thread Nicolas Joly
On Thu, Sep 30, 2010 at 02:11:19PM +0100, Matthias Scheler wrote:
 On Thu, Sep 30, 2010 at 03:05:26PM +0200, Nicolas Joly wrote:
  One possibility could be to not free memory at all in setenv, but only
  with unsetenv.
 
 I'm not convinced about that.
 
  IMHO, it's a programmer error to call setenv more than once on the
  same variable without a corresponding unsetenv in between (just like
  malloc()/free() behaviour).
 
 Is there any standard which backs this statement?

Not that i know.

  Otherwise, if i understand things
  correctly, it's more putenv that shoud work that way.
 
 Our putenv(3) is implemented via setenv(3).

That may be part of the problem (at least for zsh 4.2).

http://www.opengroup.org/onlinepubs/009695399/functions/putenv.html

From the OpenGroup function description; this function does not copy
the provided string, but use it directly instead. It's the caller
responsability to clean it when not in use anymore.

zsh 4.2 seems to follow this and try to deallocate the previous
variable string when it has been replaced by a new one. But our
putenv, which calls setenv, has already done the same ...

-- 
Nicolas Joly

Biological Software and Databanks.
Institut Pasteur, Paris.


Re: CVS commit: src/lib/libc/stdlib

2010-09-30 Thread Nicolas Joly
On Thu, Sep 30, 2010 at 12:41:34PM +, Matthias Scheler wrote:
 Module Name:  src
 Committed By: tron
 Date: Thu Sep 30 12:41:33 UTC 2010
 
 Modified Files:
   src/lib/libc/stdlib: setenv.c unsetenv.c
 
 Log Message:
 Be slightly more careful about freeing memory allocated for environment
 variables: only free memory if the current value points to the same
 memory area as the allocated block. This will prevent crashes if an
 application changes the order of the environment array.
 
 Unfortunately this is still not enough to stop zsh 4.2.* from crashing.
 zsh 4.3.* works fine before and after this change.

Thanks Matthias,

One possibility could be to not free memory at all in setenv, but only
with unsetenv.

IMHO, it's a programmer error to call setenv more than once on the
same variable without a corresponding unsetenv in between (just like
malloc()/free() behaviour). Otherwise, if i understand things
correctly, it's more putenv that shoud work that way.

-- 
Nicolas Joly

Biological Software and Databanks.
Institut Pasteur, Paris.


Re: CVS commit: src/bin/ps

2010-07-28 Thread Nicolas Joly
On Wed, Jul 28, 2010 at 01:14:40PM +0200, Alan Barrett wrote:
 On Tue, 27 Jul 2010, Nicolas Joly wrote:
  v = ve-var;
  -   doubleprintorsetwidth(v, getpcpu(k), 1, mode);
  +   dbl = getpcpu(k);
  +   doubleprintorsetwidth(v, dbl, (dbl = 100.0) ? 0 : 1, mode);
   }
 
 I think you need to test (dbl = 99.95); otherwise values in the range
 from 99.95 to 99.... will be printed with one decimal place, as
 100.0.

Right, will fix.

-- 
Nicolas Joly

Biological Software and Databanks.
Institut Pasteur, Paris.


Re: CVS commit: src/usr.bin/mkdep

2010-05-26 Thread Nicolas Joly
On Wed, May 26, 2010 at 02:07:34PM -0400, Christos Zoulas wrote:
 Module Name:  src
 Committed By: christos
 Date: Wed May 26 18:07:34 UTC 2010
 
 Modified Files:
   src/usr.bin/mkdep: mkdep.c
 
 Log Message:
 fix empty suffix case.

Thanks again. But still not quite right, the .o extension remains
while according to the man page it should be removed.

nj...@lanfeust [~] mkdep -p -f main.dep main.c
nj...@lanfeust [~]  cat main.dep
main.o: main.c
nj...@lanfeust [~] mkdep -s '' -f main.dep main.c
nj...@lanfeust [~] cat main.dep
main.o: main.c

-- 
Nicolas Joly

Biological Software and Databanks.
Institut Pasteur, Paris.


CVS commit: src/sys/conf

2010-03-05 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Fri Mar  5 23:06:49 UTC 2010

Modified Files:
src/sys/conf: Makefile.kern.inc

Log Message:
Use 'a  b  ...' contructs for running multiple commands on a single line
in Makefiles, to properly detect/report failures.


To generate a diff of this commit:
cvs rdiff -u -r1.126 -r1.127 src/sys/conf/Makefile.kern.inc

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



CVS commit: src/sys/conf

2010-03-05 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Fri Mar  5 23:06:49 UTC 2010

Modified Files:
src/sys/conf: Makefile.kern.inc

Log Message:
Use 'a  b  ...' contructs for running multiple commands on a single line
in Makefiles, to properly detect/report failures.


To generate a diff of this commit:
cvs rdiff -u -r1.126 -r1.127 src/sys/conf/Makefile.kern.inc

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

Modified files:

Index: src/sys/conf/Makefile.kern.inc
diff -u src/sys/conf/Makefile.kern.inc:1.126 src/sys/conf/Makefile.kern.inc:1.127
--- src/sys/conf/Makefile.kern.inc:1.126	Mon Mar  1 21:10:14 2010
+++ src/sys/conf/Makefile.kern.inc	Fri Mar  5 23:06:49 2010
@@ -1,4 +1,4 @@
-#	$NetBSD: Makefile.kern.inc,v 1.126 2010/03/01 21:10:14 darran Exp $
+#	$NetBSD: Makefile.kern.inc,v 1.127 2010/03/05 23:06:49 njoly Exp $
 #
 # This file contains common `MI' targets and definitions and it is included
 # at the bottom of each `MD' ${MACHINE}/conf/Makefile.${MACHINE}.
@@ -123,7 +123,7 @@
 # Add CTF sections for DTrace
 .if defined(CTFCONVERT)
 COMPILE_CTFCONVERT=	${_MKSHECHO}\
-			${CTFCONVERT} ${CTFFLAGS} ${.TARGET}; \
+			${CTFCONVERT} ${CTFFLAGS} ${.TARGET}  \
 			${CTFCONVERT} ${CTFFLAGS} ${.TARGET}
 .else
 COMPILE_CTFCONVERT=	${_MKSHECHO}
@@ -131,19 +131,19 @@
 
 # compile rules: rules are named ${TYPE}_${SUFFIX} where TYPE is NORMAL or
 # NOPROF and SUFFIX is the file suffix, capitalized (e.g. C for a .c file).
-NORMAL_C?=	@${_MKSHMSG} compile  ${.CURDIR:T}/${.TARGET}; \
+NORMAL_C?=	@${_MKSHMSG} compile  ${.CURDIR:T}/${.TARGET}  \
 		${_MKSHECHO}\
-		${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $; \
-		${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $; \
+		${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $  \
+		${CC} ${CFLAGS} ${CPPFLAGS} ${PROF} -c $  \
 		${COMPILE_CTFCONVERT}
-NOPROF_C?=	@${_MKSHMSG} compile  ${.CURDIR:T}/${.TARGET}; \
+NOPROF_C?=	@${_MKSHMSG} compile  ${.CURDIR:T}/${.TARGET}  \
 		${_MKSHECHO}\
-		${CC} ${CFLAGS} ${CPPFLAGS} -c $; \
-		${CC} ${CFLAGS} ${CPPFLAGS} -c $; \
+		${CC} ${CFLAGS} ${CPPFLAGS} -c $  \
+		${CC} ${CFLAGS} ${CPPFLAGS} -c $  \
 		${COMPILE_CTFCONVERT}
-NORMAL_S?=	@${_MKSHMSG} compile  ${.CURDIR:T}/${.TARGET}; \
+NORMAL_S?=	@${_MKSHMSG} compile  ${.CURDIR:T}/${.TARGET}  \
 		${_MKSHECHO}\
-		${CC} ${AFLAGS} ${CPPFLAGS} -c $; \
+		${CC} ${AFLAGS} ${CPPFLAGS} -c $  \
 		${CC} ${AFLAGS} ${CPPFLAGS} -c $
 
 ##



CVS commit: src/sys/dev/i2c

2010-03-01 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Mon Mar  1 17:35:21 UTC 2010

Modified Files:
src/sys/dev/i2c: i2c.c

Log Message:
Do initialise i2c_attach_args new members, for indirect configuration
too.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/i2c/i2c.c

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



CVS commit: src/sys/dev/i2c

2010-03-01 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Mon Mar  1 17:35:21 UTC 2010

Modified Files:
src/sys/dev/i2c: i2c.c

Log Message:
Do initialise i2c_attach_args new members, for indirect configuration
too.


To generate a diff of this commit:
cvs rdiff -u -r1.24 -r1.25 src/sys/dev/i2c/i2c.c

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

Modified files:

Index: src/sys/dev/i2c/i2c.c
diff -u src/sys/dev/i2c/i2c.c:1.24 src/sys/dev/i2c/i2c.c:1.25
--- src/sys/dev/i2c/i2c.c:1.24	Sun Feb 28 11:34:42 2010
+++ src/sys/dev/i2c/i2c.c	Mon Mar  1 17:35:21 2010
@@ -1,4 +1,4 @@
-/*	$NetBSD: i2c.c,v 1.24 2010/02/28 11:34:42 martin Exp $	*/
+/*	$NetBSD: i2c.c,v 1.25 2010/03/01 17:35:21 njoly Exp $	*/
 
 /*
  * Copyright (c) 2003 Wasabi Systems, Inc.
@@ -36,7 +36,7 @@
  */
 
 #include sys/cdefs.h
-__KERNEL_RCSID(0, $NetBSD: i2c.c,v 1.24 2010/02/28 11:34:42 martin Exp $);
+__KERNEL_RCSID(0, $NetBSD: i2c.c,v 1.25 2010/03/01 17:35:21 njoly Exp $);
 
 #include sys/param.h
 #include sys/systm.h
@@ -108,6 +108,10 @@
 	ia.ia_size = cf-cf_loc[IICCF_SIZE];
 	ia.ia_type = sc-sc_type;
 
+	ia.ia_name = NULL;
+	ia.ia_ncompat = 0;
+	ia.ia_compat = NULL;
+
 	if (config_match(parent, cf, ia)  0)
 		config_attach(parent, cf, ia, iic_print);
 



CVS commit: src/share/mk

2010-02-22 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Mon Feb 22 12:33:22 UTC 2010

Modified Files:
src/share/mk: bsd.README bsd.lib.mk

Log Message:
Change shared object file extension from .so to .pico, to avoid
conflicts with shared libaries names libXX.so; as recently seen with
MKUPDATE=yes builds for libelf and libnvpair.

All now stalled regular .so files need to be manually removed from
object directories.


To generate a diff of this commit:
cvs rdiff -u -r1.264 -r1.265 src/share/mk/bsd.README
cvs rdiff -u -r1.303 -r1.304 src/share/mk/bsd.lib.mk

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



CVS commit: src

2010-02-22 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Mon Feb 22 12:35:32 UTC 2010

Modified Files:
src: UPDATING

Log Message:
Note shared objects extension change, and stalled files.


To generate a diff of this commit:
cvs rdiff -u -r1.208 -r1.209 src/UPDATING

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



CVS commit: src

2010-02-22 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Mon Feb 22 12:35:32 UTC 2010

Modified Files:
src: UPDATING

Log Message:
Note shared objects extension change, and stalled files.


To generate a diff of this commit:
cvs rdiff -u -r1.208 -r1.209 src/UPDATING

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

Modified files:

Index: src/UPDATING
diff -u src/UPDATING:1.208 src/UPDATING:1.209
--- src/UPDATING:1.208	Thu Feb  4 22:25:21 2010
+++ src/UPDATING	Mon Feb 22 12:35:32 2010
@@ -1,4 +1,4 @@
-$NetBSD: UPDATING,v 1.208 2010/02/04 22:25:21 roy Exp $
+$NetBSD: UPDATING,v 1.209 2010/02/22 12:35:32 njoly Exp $
 
 This file (UPDATING) is intended to be a brief reference to recent
 changes that might cause problems in the build process, and a guide for
@@ -16,6 +16,12 @@
 Recent changes:
 ^^^
 
+20100222:
+	The shared objects file extension has been changed from .so to
+	.pico, in order to avoid conflicts with shared libraries names
+	libXX.so.  All now stale regular .so files can be removed from
+	your object directories.
+
 20100204:
 	The termcap database has been removed from the sources,
 	but has not been marked obsolete so it is not removed



CVS commit: src/external/bsd/flex/dist

2010-02-19 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Fri Feb 19 14:22:43 UTC 2010

Modified Files:
src/external/bsd/flex/dist: initparse.c initscan.c

Log Message:
Regen initparse.c/initscan.c without #line directives, to avoid host
tool depency problems when NETBSDSRCDIR != /usr/src.


To generate a diff of this commit:
cvs rdiff -u -r1.1 -r1.2 src/external/bsd/flex/dist/initparse.c
cvs rdiff -u -r1.4 -r1.5 src/external/bsd/flex/dist/initscan.c

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



Re: CVS commit: src/external/cddl/osnet/lib/libnvpair

2010-02-17 Thread Nicolas Joly
On Thu, Feb 18, 2010 at 07:39:05AM +1100, matthew green wrote:

Well, I think it is worth it because it infrequently breaks random things.
I am happy with .ro too for relocatable.
 
 let's go with .pico -- crunch already uses .ro.

Fine with me. Unless someone beats me, i'll try to have a bsd.lib.mk
patch to review/test soon ...

-- 
Nicolas Joly

Biological Software and Databanks.
Institut Pasteur, Paris.


CVS commit: src/sys/dev/ic

2010-02-09 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Tue Feb  9 23:04:15 UTC 2010

Modified Files:
src/sys/dev/ic: nslm7x.c

Log Message:
Kill extra semi-column.


To generate a diff of this commit:
cvs rdiff -u -r1.52 -r1.53 src/sys/dev/ic/nslm7x.c

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



CVS commit: src/distrib/sets/lists/comp

2010-02-05 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Fri Feb  5 12:46:33 UTC 2010

Modified Files:
src/distrib/sets/lists/comp: mi

Log Message:
+infocmp.debug +tic.debug


To generate a diff of this commit:
cvs rdiff -u -r1.1383 -r1.1384 src/distrib/sets/lists/comp/mi

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



CVS commit: src/sys/dev/pci

2010-02-01 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Mon Feb  1 12:51:16 UTC 2010

Modified Files:
src/sys/dev/pci: auich.c

Log Message:
Do not print ac97 link rate message unless verbose boot is requested.


To generate a diff of this commit:
cvs rdiff -u -r1.135 -r1.136 src/sys/dev/pci/auich.c

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



CVS commit: src/sys/kern

2010-02-01 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Mon Feb  1 12:58:04 UTC 2010

Modified Files:
src/sys/kern: kern_ssp.c

Log Message:
Aprintify.


To generate a diff of this commit:
cvs rdiff -u -r1.3 -r1.4 src/sys/kern/kern_ssp.c

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



CVS commit: src/sys/kern

2010-02-01 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Mon Feb  1 16:14:58 UTC 2010

Modified Files:
src/sys/kern: kern_ssp.c

Log Message:
Switch SSP init output to aprint_debug() instead of aprint_normal()
under DIAGNOSTIC ifdefs.


To generate a diff of this commit:
cvs rdiff -u -r1.4 -r1.5 src/sys/kern/kern_ssp.c

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



CVS commit: src/share/man/man3

2010-01-24 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Sun Jan 24 22:21:34 UTC 2010

Modified Files:
src/share/man/man3: Makefile

Log Message:
Do not link timeradd.3 to itself.


To generate a diff of this commit:
cvs rdiff -u -r1.34 -r1.35 src/share/man/man3/Makefile

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



CVS commit: src/sys/miscfs/kernfs

2010-01-22 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Fri Jan 22 22:46:01 UTC 2010

Modified Files:
src/sys/miscfs/kernfs: kernfs_vnops.c

Log Message:
Remove unneeded strlen() call in KFShostname case.


To generate a diff of this commit:
cvs rdiff -u -r1.139 -r1.140 src/sys/miscfs/kernfs/kernfs_vnops.c

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



CVS commit: src/sys/arch/amd64/amd64

2010-01-18 Thread Nicolas Joly
Module Name:src
Committed By:   njoly
Date:   Mon Jan 18 21:55:40 UTC 2010

Modified Files:
src/sys/arch/amd64/amd64: procfs_machdep.c

Log Message:
Do not check more than 32 bits against ci_feature_flags, to avoid printing
bogus data on /proc/cpuinfo flags line.


To generate a diff of this commit:
cvs rdiff -u -r1.12 -r1.13 src/sys/arch/amd64/amd64/procfs_machdep.c

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