Re: svn commit: r322875 - head/sys/dev/nvme

2017-08-25 Thread David Chisnall
On 25 Aug 2017, at 07:32, Mark Millard  wrote:
> 
> As I remember _Static_assert is from C11, not
> the older C99.

In pre-C11 dialects of C, _Static_assert is an identifier reserved for the 
implementation.  sys/cdefs.h defines it to generate a zero-length array if the 
condition is true or a negative-length array if it is false, emulating the 
behaviour (though giving less helpful error messages)

> 
> As I understand head/sys/dev/nvme/nvme.h use by
> C++ code could now reject attempts to use
> _Static_assert .

In C++, _Static_assert is an identifier reserved for the implementation, but in 
C++11 or newer static_assert is a keyword.  sys/cdefs.h defines _Static_assert 
to static_assert for newer versions of C++ and defines it to the 
C-before-11-compatible version for C++-before-11.

TL;DR: We have gone to a lot of effort to ensure that these keywords work in 
all C/C++ dialects, please use them, please report bugs if you find a case 
where they don’t work.

David

___
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"

Re: svn commit: r322875 - head/sys/dev/nvme

2017-08-25 Thread Ed Schouten
2017-08-25 8:32 GMT+02:00 Mark Millard :
>> # g++49 main.cc
>> main.cc:2:15: error: expected constructor, destructor, or type conversion 
>> before '(' token
>>  _Static_assert(1,"Test");

Yeah, that's because GCC is such a pain in the neck compiler that it
doesn't want to expose these C11 keywords when building C++, even
though they are in the reserved namespace (_[A-Z]). GCC would be
permitted to expose these and still comply to standards. Doing so
would make things so much easier for operating system implementors,
like us. Clang does get it right, in my opinion.

We should just extend  to define _Static_assert() when
using GCC in C++ mode (if we're not doing so already).

-- 
Ed Schouten 
Nuxi, 's-Hertogenbosch, the Netherlands
KvK-nr.: 62051717
___
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: svn commit: r322875 - head/sys/dev/nvme

2017-08-25 Thread Mark Millard

On 2017-Aug-25, at 12:14 AM, David Chisnall  wrote:

> On 25 Aug 2017, at 07:32, Mark Millard  wrote:
>> 
>> As I remember _Static_assert is from C11, not
>> the older C99.
> 
> In pre-C11 dialects of C, _Static_assert is an identifier reserved for the 
> implementation.  sys/cdefs.h defines it to generate a zero-length array if 
> the condition is true or a negative-length array if it is false, emulating 
> the behaviour (though giving less helpful error messages)
> 
>> 
>> As I understand head/sys/dev/nvme/nvme.h use by
>> C++ code could now reject attempts to use
>> _Static_assert .
> 
> In C++, _Static_assert is an identifier reserved for the implementation, but 
> in C++11 or newer static_assert is a keyword.  sys/cdefs.h defines 
> _Static_assert to static_assert for newer versions of C++ and defines it to 
> the C-before-11-compatible version for C++-before-11.
> 
> TL;DR: We have gone to a lot of effort to ensure that these keywords work in 
> all C/C++ dialects, please use them, please report bugs if you find a case 
> where they don’t work.

It appears that at least 11.1-STABLE -r322807 does not handle
-std=c++98 styles of use of _Static_assert for g++7 in that
g++7 reports an error:

# uname -apKU
FreeBSD hzFreeBSD11S 11.1-STABLE FreeBSD 11.1-STABLE  r322807  amd64 amd64 
1101501 1101501

# more main.cc
#include "/usr/include/sys/cdefs.h"
_Static_assert(1,"Test");
int main(void)
{
   return 0;
}

# g++7 -std=c++98 main.cc
main.cc:2:15: error: expected constructor, destructor, or type conversion 
before '(' token
 _Static_assert(1,"Test");
   ^

So it appears that as stands the _Static_assert
implementation requires a more modern C++ standard
vintage.


With the likes of -Wpedantic clang++ from 11.1-STABLE
-r322807 reports a warning:

# clang++ -Wpedantic -std=c++11 main.cc
main.cc:2:1: warning: _Static_assert is a C11-specific feature 
[-Wc11-extensions]
_Static_assert(1,"Test");
^
1 warning generated.

# clang++ -Wpedantic -std=c++98 main.cc
In file included from main.cc:1:
/usr/include/sys/cdefs.h:852:27: warning: variadic macros are a C99 feature 
[-Wvariadic-macros]
#define __locks_exclusive(...) \
  ^
. . . (more such macro reports) . . .
main.cc:2:1: warning: _Static_assert is a C11-specific feature 
[-Wc11-extensions]
_Static_assert(1,"Test");
^
11 warnings generated.

By contrast "g++7 -Wpedantic -std=c++11 main.cc" is silent about it.


===
Mark Millard
markmi at dsl-only.net

___
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"

Re: file system deadlock in RELENG_11

2017-08-25 Thread Mike Tancsa
On 8/24/2017 9:33 PM, Shane Ambler wrote:
> On 25/08/2017 05:40, Mike Tancsa wrote:
>> On 8/24/2017 4:01 PM, Mike Tancsa wrote:
>>> OK, this is fairly easy to repeat. If I start a sync of a snapshot via
>>> zrep, it hangs the box.  CTRL+T shows
>>>
>>>
>>> DEBUG: overiding stale lock on zroot/chyves from pid 19378
>>> sending zroot/chyves@zrep_10 to 10.151.9.2:zroot/chyves
>>> cannot receive new filesystem stream: destination
>>> 'zroot/chyves/guests/resi/disk1' exists
>>> must specify -F to overwrite it
> 
> Are you sending a snapshot from the host to the guest?
> or is the guest sending to the host?

sending a snapshot from an active host, to a guest.

>> root 29683   0.0  0.0    7752   3824  5  DE+  15:53  0:00.32 zfs
>> send -R -I zroot/chyves@zrep_0d zroot/chyves@zrep_10
>> root 29690   0.0  0.0    7752   3492  5  D+   15:53  0:00.00 zfs
>> rename zroot/chyves@zrep_10 zroot/chyves@zrep_10_unsent
>>
> 
> Should be unrelated but several years ago there was a deadlock issue
> when renaming a zvol, unless the fix got undone recently this may just
> be a distraction or a hint of a solution...
> 
> https://svnweb.freebsd.org/base?view=revision&revision=272474

Hmmm, that does sound familiar.  I will try and recreate this next week
on a non production box.

---Mike



-- 
---
Mike Tancsa, tel +1 519 651 3400
Sentex Communications, m...@sentex.net
Providing Internet services since 1994 www.sentex.net
Cambridge, Ontario Canada   http://www.tancsa.com/
___
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"

Re: svn commit: r322875 - head/sys/dev/nvme

2017-08-25 Thread Ed Schouten
2017-08-25 9:46 GMT+02:00 Mark Millard :
> It appears that at least 11.1-STABLE -r322807 does not handle
> -std=c++98 styles of use of _Static_assert for g++7 in that
> g++7 reports an error:

Maybe we need to do something like this?

Index: sys/sys/cdefs.h
===
--- sys/sys/cdefs.h (revision 322887)
+++ sys/sys/cdefs.h (working copy)
@@ -294,7 +294,7 @@
 #if (defined(__cplusplus) && __cplusplus >= 201103L) || \
 __has_extension(cxx_static_assert)
 #define _Static_assert(x, y) static_assert(x, y)
-#elif __GNUC_PREREQ__(4,6)
+#elif __GNUC_PREREQ__(4,6) && !defined(__cplusplus)
 /* Nothing, gcc 4.6 and higher has _Static_assert built-in */
 #elif defined(__COUNTER__)
 #define _Static_assert(x, y) __Static_assert(x, __COUNTER__)


-- 
Ed Schouten 
Nuxi, 's-Hertogenbosch, the Netherlands
KvK-nr.: 62051717
___
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


Re: svn commit: r322875 - head/sys/dev/nvme

2017-08-25 Thread Warner Losh
On Fri, Aug 25, 2017 at 6:53 AM, Ed Schouten  wrote:

> 2017-08-25 9:46 GMT+02:00 Mark Millard :
> > It appears that at least 11.1-STABLE -r322807 does not handle
> > -std=c++98 styles of use of _Static_assert for g++7 in that
> > g++7 reports an error:
>
> Maybe we need to do something like this?
>
> Index: sys/sys/cdefs.h
> ===
> --- sys/sys/cdefs.h (revision 322887)
> +++ sys/sys/cdefs.h (working copy)
> @@ -294,7 +294,7 @@
>  #if (defined(__cplusplus) && __cplusplus >= 201103L) || \
>  __has_extension(cxx_static_assert)
>  #define _Static_assert(x, y) static_assert(x, y)
> -#elif __GNUC_PREREQ__(4,6)
> +#elif __GNUC_PREREQ__(4,6) && !defined(__cplusplus)
>  /* Nothing, gcc 4.6 and higher has _Static_assert built-in */
>  #elif defined(__COUNTER__)
>  #define _Static_assert(x, y) __Static_assert(x, __COUNTER__)



This looks good to my eye, but my level of C++ pedantic knowledge is
suboptimal.

Warner
___
freebsd-stable@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/freebsd-stable
To unsubscribe, send any mail to "freebsd-stable-unsubscr...@freebsd.org"


FreeBSD 10.4-BETA2 Now Available

2017-08-25 Thread Marius Strobl
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA512


The second BETA build of the 10.4-RELEASE release cycle is now available.

Installation images are available for:

o amd64 GENERIC
o i386 GENERIC
o ia64 GENERIC
o powerpc GENERIC
o powerpc64 GENERIC64
o sparc64 GENERIC
o armv6 CUBOX-HUMMINGBOARD
o armv6 GUMSTIX
o armv6 PANDABOARD
o armv6 RPI-B

Note regarding arm/armv6 images: For convenience for those without
console access to the system, a freebsd user with a password of
freebsd is available by default for ssh(1) access.  Additionally,
the root user password is set to root.  It is strongly recommended
to change the password for both users after gaining access to the
system.

Installer images and memory stick images are available here:

https://download.freebsd.org/ftp/releases/ISO-IMAGES/10.4/

The image checksums follow at the end of this e-mail.

If you notice problems you can report them through the Bugzilla PR
system or on the -stable mailing list.

If you would like to use SVN to do a source based update of an existing
system, use the "stable/10" branch.

A list of changes since 10.3-RELEASE are available in the stable/10
release notes:

https://www.freebsd.org/relnotes/10-STABLE/relnotes/article.html

Please note, the release notes page is not yet complete, and will be
updated on an ongoing basis as the 10.4-RELEASE cycle progresses.

=== Noteworthy Changes Since 10.4-BETA1 ===

o The qlnxe(4) driver received a few performance optimizations and
  options.

o Also in case a GPT disk label is used, the fsck_ffs(8) utility now is
  able to find alternate superblocks.

o The daily output of periodic(8) has been restored to consistently use
  the much more readable unified format for presenting differences in
  files.

o Userland coredumps can now trigger events such as generating a human
  readable crash report via devd(8).  This feature is off by default.

o A Makefile allowing geom_map(4) to built as a kernel module has been
  added, without hooking it up to the default build, though.

o The hn(4) driver for Hyper-V is now able to handle transparent mode
  network VF devices.

o RPI-B support has been brought in line with head, allowing the use of
  newer device tree and firmware versions to be used.  Thus, the RPI-B
  image works again and is available as part of the 10.4-BETA2 set.

o Bugs in the mpr(4) and mps(4) drivers that could lead to panics after
  performing a controller firmware upgrade have been corrected.

=== Known Issues ===

During initial testing of 10.4-BETA2 it turned out that the BEAGLEBONE,
WANDBOARD images do not boot.  Thus, they have not been made available.
Images for these boards will be published again at a later point in the
10.4-RELEASE cycle once the underlying problems have been addressed.

=== Virtual Machine Disk Images ===

VM disk images are available for the amd64 and i386 architectures.
Disk images may be downloaded from the following URL (or any of the
FreeBSD FTP mirrors):

https://download.freebsd.org/ftp/releases/VM-IMAGES/10.4-BETA2/

The partition layout is:

~ 16 kB - freebsd-boot GPT partition type (bootfs GPT label)
~ 1 GB  - freebsd-swap GPT partition type (swapfs GPT label)
~ 20 GB - freebsd-ufs GPT partition type (rootfs GPT label)

The disk images are available in QCOW2, VHD, VMDK, and raw disk image
formats.  The image download size is approximately 160 MB and 128 MB
respectively (amd64/i386), decompressing to a 21 GB sparse image.

=== Amazon EC2 AMI Images ===

FreeBSD/amd64 EC2 AMIs are available in the following regions:

Created AMI in ap-south-1 region: ami-52c2873d
Created AMI in eu-west-2 region: ami-0b0b1b6f
Created AMI in eu-west-1 region: ami-54ce372d
Created AMI in ap-northeast-2 region: ami-f109d19f
Created AMI in ap-northeast-1 region: ami-fafe019c
Created AMI in sa-east-1 region: ami-63f0800f
Created AMI in ca-central-1 region: ami-9866d8fc
Created AMI in ap-southeast-1 region: ami-c63c5ca5
Created AMI in ap-southeast-2 region: ami-bf170ddc
Created AMI in eu-central-1 region: ami-f804af97
Created AMI in us-east-1 region: ami-f9b2b382
Created AMI in us-east-2 region: ami-8f1f3cea
Created AMI in us-west-1 region: ami-28d0e548
Created AMI in us-west-2 region: ami-9912fbe1

=== Vagrant Images ===

FreeBSD/amd64 images are available on the Hashicorp Atlas site, and can
be installed by running:

% vagrant init freebsd/FreeBSD-10.4-BETA2
% vagrant up

=== Upgrading ===

The freebsd-update(8) utility supports binary upgrades of amd64 and i386
systems running earlier FreeBSD releases.  Systems running earlier
FreeBSD releases can upgrade as follows:

# freebsd-update upgrade -r 10.4-BETA2

During this process, freebsd-update(8) may ask the user to help by
merging some configuration files or by confirming that the automatically
performed merging was done correctly.

# freebsd-update install

The system must be rebooted with the newly installed kernel before
continuing.

# shutdown -r now

Af