profile
viewpoint
If you are wondering where the data of this site comes from, please visit https://api.github.com/users/DimitryAndric/events. GitMemory does not store any data, but only uses NGINX to cache data for a period of time. The idea behind GitMemory is simply to give users a better reading experience.
Dimitry Andric DimitryAndric The Netherlands

llvm/llvm-project 9668

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies. Note: the repository does not accept github pull requests at this moment. Please submit your patches at http://reviews.llvm.org.

DimitryAndric/i7z 1

Thermal and C-state reporting utility for Intel Core CPUs

DimitryAndric/cpython 0

The Python programming language

DimitryAndric/freebsd-src 0

FreeBSD src tree (read-only mirror)

DimitryAndric/iterm2-website 0

Website for iTerm2

DimitryAndric/libarchive 0

Multi-format archive and compression library

DimitryAndric/libjpeg-turbo 0

Main libjpeg-turbo repository

DimitryAndric/llvm-project 0

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies. Note: the repository does not accept github pull requests at this moment. Please submit your patches at http://reviews.llvm.org.

issue closedbfgroup/b2

bfgroup.xyz domain expired

Make sure you completed the following tasks

Environment and version details

Irrelevant

Brief problem description

All links to the documentation site, such as https://www.bfgroup.xyz/b2/LICENSE.txt, https://www.bfgroup.xyz/b2/ etc return errors, resulting in "server not found".

Steps to reproduce the issue

Visit https://www.bfgroup.xyz/b2/

$ whois www.bfgroup.xyz
% IANA WHOIS server
% for more information on IANA, visit http://www.iana.org
% This query returned 1 object

refer:        whois.nic.xyz

domain:       XYZ

organisation: XYZ.COM LLC
address:      2121 E Tropicana Ave
address:      Las Vegas
address:      NV 89119
address:      United States

contact:      administrative
name:         General Counsel
organisation: XYZ.COM LLC
address:      2121 E Tropicana Ave., STE2
address:      Las Vegas
address:      NV 89119
address:      United States
phone:        +1.7027632191
e-mail:       hello@xyz.com

contact:      technical
name:         CTO
organisation: CentralNic
address:      Saddlers House, 4th Floor
address:      44 Gutter Lane
address:      London EC2V 6BR
address:      United Kingdom
phone:        +44.2033880600
fax-no:       +44.2033880601
e-mail:       tld.ops@centralnic.com

nserver:      GENERATIONXYZ.NIC.XYZ 212.18.249.42 2a04:2b00:13ff:0:0:0:0:42
nserver:      X.NIC.XYZ 194.169.218.42 2001:67c:13cc:0:0:0:1:42
nserver:      Y.NIC.XYZ 185.24.64.42 2a04:2b00:13cc:0:0:0:1:42
nserver:      Z.NIC.XYZ 212.18.248.42 2a04:2b00:13ee:0:0:0:0:42
ds-rdata:     3599 8 1 3FA3B264F45DB5F38BEDEAF1A88B76AA318C2C7F
ds-rdata:     3599 8 2 B9733869BC84C86BB59D102BA5DA6B27B2088552332A39DCD54BC4E8D66B0499

whois:        whois.nic.xyz

status:       ACTIVE
remarks:      Registration information: https://nic.xyz

created:      2014-02-06
changed:      2020-10-09
source:       IANA

# whois.nic.xyz

The queried object does not exist: DOMAIN NOT FOUND

closed time in 5 days

DimitryAndric

issue commentbfgroup/b2

bfgroup.xyz domain expired

Hm interesting, it was probably a hiccup on the registrar side? All DNS lookups failed, and whois.nic.xyz returned "domain not found". But now it indeed also works again for me:

# whois.nic.xyz

Domain Name: BFGROUP.XYZ
Registry Domain ID: D207428483-CNIC
Registrar WHOIS Server: whois.domain.com
Registrar URL: http://www.domain.com
Updated Date: 2020-11-12T23:45:11.0Z
Creation Date: 2020-11-07T23:36:09.0Z
Registry Expiry Date: 2022-11-07T23:59:59.0Z
Registrar: Domain.com, LLC
Registrar IANA ID: 886
Domain Status: ok https://icann.org/epp#ok
Registrant Organization: Rene Rivera
Registrant State/Province: IL
Registrant Country: US
Registrant Email: Please query the RDDS service of the Registrar of Record identified in this output for information on how to contact the Registrant, Admin, or Tech contact of the queried domain name.
Admin Email: Please query the RDDS service of the Registrar of Record identified in this output for information on how to contact the Registrant, Admin, or Tech contact of the queried domain name.
Tech Email: Please query the RDDS service of the Registrar of Record identified in this output for information on how to contact the Registrant, Admin, or Tech contact of the queried domain name.
Name Server: NS1.DREAMHOST.COM
Name Server: NS2.DREAMHOST.COM
Name Server: NS3.DREAMHOST.COM
DNSSEC: unsigned
Billing Email: Please query the RDDS service of the Registrar of Record identified in this output for information on how to contact the Registrant, Admin, or Tech contact of the queried domain name.
Registrar Abuse Contact Email: support@domain-inc.net
Registrar Abuse Contact Phone:
URL of the ICANN Whois Inaccuracy Complaint Form: https://www.icann.org/wicf/
>>> Last update of WHOIS database: 2021-07-20T13:40:04.0Z <<<

and:

$ dig www.bfgroup.xyz @ns1.dreamhost.com

; <<>> DiG 9.16.18 <<>> www.bfgroup.xyz @ns1.dreamhost.com
;; global options: +cmd
;; Got answer:
;; ->>HEADER<<- opcode: QUERY, status: NXDOMAIN, id: 3138
;; flags: qr aa rd; QUERY: 1, ANSWER: 1, AUTHORITY: 1, ADDITIONAL: 1
;; WARNING: recursion requested but not available

;; OPT PSEUDOSECTION:
; EDNS: version: 0, flags:; udp: 1232
;; QUESTION SECTION:
;www.bfgroup.xyz.               IN      A

;; ANSWER SECTION:
www.bfgroup.xyz.        300     IN      CNAME   bfgroup.github.io.

;; AUTHORITY SECTION:
github.io.              14400   IN      SOA     ns1.dreamhost.com. hostmaster.dreamhost.com. 2016051200 19768 1800 1814400 14400

;; Query time: 163 msec
;; SERVER: 162.159.26.14#53(162.159.26.14)
;; WHEN: Tue Jul 20 15:43:08 CEST 2021
;; MSG SIZE  rcvd: 139

So just a transient error, let's close this then.

DimitryAndric

comment created time in 5 days

issue openedbfgroup/b2

bfgroup.xyz domain expired

Make sure you completed the following tasks

Environment and version details

Irrelevant

Brief problem description

All links to the documentation site, such as https://www.bfgroup.xyz/b2/LICENSE.txt, https://www.bfgroup.xyz/b2/ etc return errors, resulting in "server not found".

Steps to reproduce the issue

Visit https://www.bfgroup.xyz/b2/

$ whois www.bfgroup.xyz
% IANA WHOIS server
% for more information on IANA, visit http://www.iana.org
% This query returned 1 object

refer:        whois.nic.xyz

domain:       XYZ

organisation: XYZ.COM LLC
address:      2121 E Tropicana Ave
address:      Las Vegas
address:      NV 89119
address:      United States

contact:      administrative
name:         General Counsel
organisation: XYZ.COM LLC
address:      2121 E Tropicana Ave., STE2
address:      Las Vegas
address:      NV 89119
address:      United States
phone:        +1.7027632191
e-mail:       hello@xyz.com

contact:      technical
name:         CTO
organisation: CentralNic
address:      Saddlers House, 4th Floor
address:      44 Gutter Lane
address:      London EC2V 6BR
address:      United Kingdom
phone:        +44.2033880600
fax-no:       +44.2033880601
e-mail:       tld.ops@centralnic.com

nserver:      GENERATIONXYZ.NIC.XYZ 212.18.249.42 2a04:2b00:13ff:0:0:0:0:42
nserver:      X.NIC.XYZ 194.169.218.42 2001:67c:13cc:0:0:0:1:42
nserver:      Y.NIC.XYZ 185.24.64.42 2a04:2b00:13cc:0:0:0:1:42
nserver:      Z.NIC.XYZ 212.18.248.42 2a04:2b00:13ee:0:0:0:0:42
ds-rdata:     3599 8 1 3FA3B264F45DB5F38BEDEAF1A88B76AA318C2C7F
ds-rdata:     3599 8 2 B9733869BC84C86BB59D102BA5DA6B27B2088552332A39DCD54BC4E8D66B0499

whois:        whois.nic.xyz

status:       ACTIVE
remarks:      Registration information: https://nic.xyz

created:      2014-02-06
changed:      2020-10-09
source:       IANA

# whois.nic.xyz

The queried object does not exist: DOMAIN NOT FOUND

created time in 5 days

issue commentpiroor/treestyletab

The last update skewed the custom styles

Okay, for me the following worked to get the narrower tab spacing:

/* Make tabs smaller */
tab-item-substance {
  padding-top: 0px;
  padding-bottom: 0px;
}

This made the end result look identical to my 3.8.4 screenshot. It seems the "Show title of unread tabs with italic font" item still works as-is.

wvxwxvw

comment created time in 18 days

issue commentpiroor/treestyletab

The last update skewed the custom styles

E.g. the virtual spacing is much wider now.

Oops, apologies for that, I did have user styles but totally forgot about them (as they're quite deep in the TST settings). These were copied from TST snippets a very long time ago, and seem to have always kept working:

/* Show title of unread tabs with italic font */
.tab.unread .label {
  font-style: italic;
}

/* Add private browsing indicator per tab */
.tab.private-browsing .label:before {
  content: "🕶";
}

/* Make tabs smaller */
.tab {
  padding-top: 0px;
  padding-bottom: 0px;
}


/* regular width scrollbar */
#tabbar { scrollbar-width: auto; }

/* put scrollbar rightside */
:root.left #tabbar { direction: ltr; }

Are you now supposed to change .tab to something like tab-item.tab-item-substance ?

wvxwxvw

comment created time in 18 days

issue commentpiroor/treestyletab

The last update skewed the custom styles

For me the appearance of the tabs changed greatly due to this update, even though I don't have any user styles, except for hiding the top bar:

#TabsToolbar, #sidebar-header {
	visibility: collapse !important;
}

Before (3.8.4): Screenshot 2021-07-06 at 19 44 02

After (3.8.5 or 3.8.6, didn't see any difference between them): Screenshot 2021-07-06 at 19 45 59

E.g. the virtual spacing is much wider now.

wvxwxvw

comment created time in 18 days

issue commentgoogle/shaka-player

Hang on gap (which is not really a gap) at the start of video/audio

What I think is happening is the first video segment is being skipped. Because the timestamp is 86400000, but the presentationTimeOffset is 86403416, so the first timestamp is negative. The browser will evict frames up to the next key frame, so this may evict up to the next segment, which results in the gap.

If you adjust the presentationTimeOffset backward slightly so both audio and video start at or after 0, the gap will be gone. Or you can set streaming.jumpLargeGaps to true.

The timing model now requires that presentationTimeOffset be set to the beginning of the part of the presentation where both audio and video are available, which is why we set it like this. Otherwise, the beginning of the presentation would have only video, and no audio. To compensate, we also add an eptDelta attribute, as specified in MPEG DASH Amendment 5:

A Representation should cover all presentation times Tp that is are greater than and equal to the value of the @presentationTimeOffset, T0. If smaller values are present, i.e. the value of the @eptDelta is negative, then presentation of the Media Segment is expected to only take place for presentation times greater than or equal to T0.

It seems that neither Shaka nor DASH.js have explicit support for eptDelta, but DASH.js has no trouble playing this manifest from the beginning (e.g. it works on all browsers). I'm unsure what it is doing differently.

dimitry-unified-streaming

comment created time in 24 days

CommitCommentEvent

push eventDimitryAndric/freebsd-src

Dimitry Andric

commit sha 19917ed41f08a314c65686025befb33a0d7e09b0

Also remove the old ProcessFreeBSD from Plugins.def.

view details

push time in a month

create barnchDimitryAndric/freebsd-src

branch : llvm-12-update-lldb

created branch time in a month

create barnchDimitryAndric/freebsd-src

branch : llvm-12-squash

created branch time in a month

push eventDimitryAndric/freebsd-src

Ryan Moeller

commit sha 8348fac30c51564bf0c102aab35a54ca2dca50b4

Limit dbuf cache sizes based only on ARC target size by default Set the initial max sizes to ULONG_MAX to allow the caches to grow with the ARC. Recalculate the metadata cache size on demand so it can adapt, too. Update descriptions in zfs-module-parameters(5). Reviewed-by: Alexander Motin <mav@FreeBSD.org> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Matt Ahrens <matt@delphix.com> Signed-off-by: Ryan Moeller <ryan@iXsystems.com> Closes #10563 Closes #10610

view details

Brian Atkinson

commit sha 6fba7bfd0e2d7dc677278322158cd89816a53433

Add gang ABD child to parent gang ABD By design a gang ABD can not have another gang ABD as a child. This is to make sure the logical offset in a gang ABD is consistent with the individual ABDS it contains as children. If a gang ABD is added as a child of a gang ABD we will add the individual children of the gang ABD to the parent gang ABD. This allows for a consistent view of offsets within the parent gang ABD. Reviewed-by: Mark Maybee <mmaybee@cray.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Brian Atkinson <batkinson@lanl.gov> Closes #10430

view details

Ryan Moeller

commit sha cb18d88060100ced29da1900f5a35e3deded0b36

FreeBSD: Implement arc_free_memory This is only used for the kstat, but something other than 0 is nice. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Signed-off-by: Ryan Moeller <ryan@iXsystems.com> Closes #10626

view details

Ryan Moeller

commit sha d364de7a89dc339aad1bc20d429dc670e61dc1ff

FreeBSD: Remove accidental ARC size limiter i386 has some additional memory reservation logic that limits the size of the reported available memory. This was accidentally being used on all arches due to a missing header. Include machine/vmparam.h in freebsd/zfs/arc_os.c to pull in the missing UMA_MD_SMALL_ALLOC definition. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Alexander Motin <mav@FreeBSD.org> Signed-off-by: Ryan Moeller <ryan@iXsystems.com> Closes #10616

view details

Matthew Macy

commit sha f5b189f9379b092600293ac3e7a670bf2087d88c

FreeBSD: Fixes required to build ZFS on PowerPC Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Matt Macy <mmacy@FreeBSD.org> Closes #10622

view details

Matthew Macy

commit sha 6d8da84106de1fc8480e1758cc88e81393b4c0c2

Make use of ZFS_DEBUG consistent within kmod sources Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Signed-off-by: Matt Macy <mmacy@FreeBSD.org> Closes #10623

view details

Matthew Macy

commit sha e64cc4954c7862db6a6b4dc978a091ebc3f870da

Refactor ccompile.h to not include system headers This is a step toward being able to vendor the OpenZFS code in FreeBSD. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Ryan Moeller <ryan@iXsystems.com> Signed-off-by: Matt Macy <mmacy@FreeBSD.org> Closes #10625

view details

Matthew Ahrens

commit sha 3eabed74c0fca5dd9f96d2cca13c4a1a16d5c094

Fix lua stack overflow on recursive call to gsub() The `zfs program` subcommand invokes a LUA interpreter to run ZFS "channel programs". This interpreter runs in a constrained environment, with defined memory limits. The LUA stack (used for LUA functions that call each other) is allocated in the kernel's heap, and is limited by the `-m MEMORY-LIMIT` flag and the `zfs_lua_max_memlimit` module parameter. The C stack is used by certain LUA features that are implemented in C. The C stack is limited by `LUAI_MAXCCALLS=20`, which limits call depth. Some LUA C calls use more stack space than others, and `gsub()` uses an unusually large amount. With a programming trick, it can be invoked recursively using the C stack (rather than the LUA stack). This overflows the 16KB Linux kernel stack after about 11 iterations, less than the limit of 20. One solution would be to decrease `LUAI_MAXCCALLS`. This could be made to work, but it has a few drawbacks: 1. The existing test suite does not pass with `LUAI_MAXCCALLS=10`. 2. There may be other LUA functions that use a lot of stack space, and the stack space may change depending on compiler version and options. This commit addresses the problem by adding a new limit on the amount of free space (in bytes) remaining on the C stack while running the LUA interpreter: `LUAI_MINCSTACK=4096`. If there is less than this amount of stack space remaining, a LUA runtime error is generated. Reviewed-by: George Wilson <gwilson@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Ryan Moeller <ryan@ixsystems.com> Reviewed-by: Allan Jude <allanjude@freebsd.org> Reviewed-by: Serapheim Dimitropoulos <serapheim@delphix.com> Signed-off-by: Matthew Ahrens <mahrens@delphix.com> Closes #10611 Closes #10613

view details

Matthew Macy

commit sha 5678d3f59389a241c8d9c032513c38209bb53e70

Prefix zfs internal endian checks with _ZFS FreeBSD defines _BIG_ENDIAN BIG_ENDIAN _LITTLE_ENDIAN LITTLE_ENDIAN on every architecture. Trying to do cross builds whilst hiding this from ZFS has proven extremely cumbersome. Reviewed-by: Ryan Moeller <ryan@ixsystems.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Matt Macy <mmacy@FreeBSD.org> Closes #10621

view details

Serapheim Dimitropoulos

commit sha 843e9ca2e1ef347cf6b0271ed84438afc145dfd4

Introduce names for ZTHRs When debugging issues or generally analyzing the runtime of a system it would be nice to be able to tell the different ZTHRs running by name rather than having to analyze their stack. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Matthew Ahrens <mahrens@delphix.com> Co-authored-by: Ryan Moeller <ryan@iXsystems.com> Signed-off-by: Serapheim Dimitropoulos <serapheim@delphix.com> Closes #10630

view details

Matthew Macy

commit sha 27d96d22542282b81a055e2108268dc78d08eda8

Rename refcount.h to zfs_refcount.h Renamed to avoid conflicting with refcount.h when a different implementation is already provided by the platform. Reviewed-by: Ryan Moeller <ryan@ixsystems.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Matt Macy <mmacy@FreeBSD.org> Closes #10620

view details

Jonathon

commit sha ae12b023082fd91e89507a2a1fc014e64c6767f0

Verify zfs module loaded before starting services This is a minor change to the systemd service templates that verifies the zfs kernel module is loaded by the kernel prior to attempting to import any zpool. Reviewed-by: Richard Laager <rlaager@wiktel.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Jonathon Fernyhough <jonathon.fernyhough@york.ac.uk> Closes #10627

view details

Matthew Ahrens

commit sha 3a92552f755543c02c71aa29d680261907b1bea3

Fix error handling of vdev_top_zap In `vdev_load()`, we look up several entries in the `vdev_top_zap` object. In most cases, if we encounter an i/o error, it will be returned to the caller. However, when handling `VDEV_TOP_ZAP_ALLOCATION_BIAS`, if we get an i/o error, we may continue on, which in theory could cause us to not realize that a vdev should be used only for `special` allocations. In practice, if we encountered an i/o error while looking for `VDEV_TOP_ZAP_ALLOCATION_BIAS` in the `vdev_top_zap`, we'd also get an i/o error while looking for other entries in the same object, and thus the zpool open/import would fail. Therefore the impact of this problem is negligible. This commit adds error handling for i/o errors while accessing the `vdev_top_zap`, so that we aren't relying on unrelated code to fail for us. Reviewed-by: Don Brady <don.brady@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Matthew Ahrens <mahrens@delphix.com> Closes #10637

view details

Ryan Moeller

commit sha 2f571dbe06e3d65a3ddadca54d94e4ee2798529d

Use correct prefix for share/pam-configs Respect the configured install prefix. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: Arvind Sankar <nivedita@alum.mit.edu> Signed-off-by: Ryan Moeller <ryan@iXsystems.com> Closes #10604

view details

Don Brady

commit sha a15c6f33104a0ef12f36688e5dcca2f16fff8e05

ZTS: minor improvements to alloc_class_009_pos functional test * Fixed a typo that cause one of the variations to be a no-op * Added additional coverage for adding special vdev after pool create * Added additional coverage for using 4K sector size Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: John Kennedy <john.kennedy@delphix.com> Signed-off-by: Don Brady <don.brady@delphix.com> Closes #10641

view details

Matthew Ahrens

commit sha 948423a3d1b6b396b46c8edbee9d77515a62589b

zfs promote does not delete livelist of origin When a clone is promoted, its livelist is no longer accurate, so it is discarded. If the clone's origin is also a clone (i.e. we are promoting a clone of a clone), then the origin's livelist is also no longer accurate, so it should be discarded, but the code doesn't actually do that. Consider a pool with: * Filesystem A * Clone B, a clone of A * Clone C, a clone of B If we promote C, it discards C's livelist. It should discard B's livelist, but that is not happening. The impact is that when B is destroyed, we use the livelist to find the blocks to free, but the livelist is no longer correct so we end up freeing blocks that are still in use by C. The incorrectly-freed blocks can be reallocated causing checksum errors. And when C is destroyed it can double-free the incorrectly-freed blocks. The problem is that we remove the livelist of `origin_ds->ds_dir`, but the origin snapshot has already been moved to the promoted dsl_dir. So this is actually trying to remove the livelist of the promoted dsl_dir, which was already removed. As explained in a comment in the beginning of `dsl_dataset_promote_sync()`, we need to use the saved `odd` for the origin's dsl_dir. Reviewed-by: Pavel Zakharov <pavel.zakharov@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Reviewed-by: George Wilson <gwilson@delphix.com> Reviewed by: Sara Hartse <sara.hartse@delphix.com> Signed-off-by: Matthew Ahrens <mahrens@delphix.com> Closes #10652

view details

Allan Jude

commit sha 4cf6f10714109902504156c0e02ee97a11a32cc1

pyzfs: Add missing entry to zfs_errno This was causing all later errno's to have the incorrect value. Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Allan Jude <allan@klarasystems.com> Closes #10649

view details

Allan Jude

commit sha eabf270b2c5902967e04ad8b3c6eca381964f24c

Remove duplicate include of sys/zfeature.h in dmu_objset.c Reviewed-by: Ryan Moeller <ryan@ixsystems.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Allan Jude <allan@klarasystems.com> Closes #10636

view details

Allan Jude

commit sha 24f98ed383c978fe4ec385a912573fb1d9f3260e

When encountering EZFS_UNKNOWN, print the error text buffer anyway Rather than just saying there was an internal error, provide any context we might have to the user to help them understand the issue. Reviewed-by: Ryan Moeller <ryan@ixsystems.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Allan Jude <allan@klarasystems.com> Closes #10632

view details

Ryan Moeller

commit sha 25499e2139b248eef1b89148002ade27f0223ba9

lua: Increase reserved stack space for FreeBSD in debug config FreeBSD uses more stack space in debug configurations and can overflow the stack while formatting the error message when the call depth limit of 20 frames is reached. This is readily reproduced by running the gsub recursion test with increased kstack size. I hit the panic with 16 pages per kstack, and noticed it go away when bumped to 17. Reserve an additional 64 bytes on the stack when building for FreeBSD. This is enough to avoid the panic with a deep stack while not wasting too much space when the default stack size is used. Reviewed-by: Matt Ahrens <matt@delphix.com> Reviewed-by: Brian Behlendorf <behlendorf1@llnl.gov> Signed-off-by: Ryan Moeller <ryan@iXsystems.com> Closes #10634

view details

push time in a month

push eventDimitryAndric/freebsd-src

Dimitry Andric

commit sha 3d8ca8c01833b21019e095f53d88d709159d7b9a

Also add lldb-server and its manpage to OptionalObsoleteFiles.inc.

view details

push time in 2 months

push eventDimitryAndric/freebsd-src

Warner Losh

commit sha cc384c67ce2b6b0b30e08a264d4ef9a116e70505

cam: prefer cam_sim_softc() over accessing cam_sim structure directly. Use the accessor function to get the softc for this sim. This also drops an unneeded cast. Sponsored by: Netflix Reviewed by: mav@, hselasky@ Differential Revision: https://reviews.freebsd.org/D30360

view details

Kenneth D. Merry

commit sha 175ad3d00318a345790eecf2f5a33cd16b119e55

Fix mpr(4) and mps(4) state transitions and a use-after-free panic. When the mpr(4) and mps(4) drivers probe a SATA device, they issue an ATA Identify command (via mp{s,r}sas_get_sata_identify()) before the target is fully setup in the driver. The drivers wait for completion of the identify command, and have a 5 second timeout. If the timeout fires, the command is marked with the SATA_ID_TIMEOUT flag so it can be freed later. That is where the use-after-free problem comes in. Once the ATA Identify times out, the driver sends a target reset, and then frees any identify commands that have timed out. But, once the target reset completes, commands that were queued to the drive are returned to the driver by the controller. At that point, the driver (in mp{s,r}_intr_locked()) looks up the command descriptor for that particular SMID, marks it CM_STATE_BUSY and sends it on for completion handling. The problem at this stage is that the command has already been freed, and put on the free queue, so its state is CM_STATE_FREE. If INVARIANTS are turned on, we get a panic as soon as this command is allocated, because its state is no longer CM_STATE_FREE, but rather CM_STATE_BUSY. So, the solution is to not free ATA Identify commands that get stuck until they actually return from the controller. Hopefully this works correctly on older firmware versions. If not, it could result in commands hanging around indefinitely. But, the alternative is a use-after-free panic or assertion (in the INVARIANTS case). This also tightens up the state transitions between CM_STATE_FREE, CM_STATE_BUSY and CM_STATE_INQUEUE, so that the state transitions happen once, and we have assertions to make sure that commands are in the correct state before transitioning to the next state. Also, for each state assertion, we print out the current state of the command if it is incorrect. mp{s,r}.c: Add a new sysctl variable, dump_reqs_alltypes, that controls the behavior of the dump_reqs sysctl. If dump_reqs_alltypes is non-zero, it will dump all commands, not just the commands that are in the CM_STATE_INQUEUE state. (You can see the commands that are in the queue by using mp{s,r}util debug dumpreqs.) Make sure that the INQUEUE -> BUSY state transition happens in one place, the mp{s,r}_complete_command routine. mp{s,r}_sas.c: Make sure we print the current command type in command state assertions. mp{s,r}_sas_lsi.c: Add a new completion handler, mp{s,r}sas_ata_id_complete. This completion handler will free data allocated for an ATA Identify command and free the command structure. In mp{s,r}_ata_id_timeout, do not set the command state to CM_STATE_BUSY. The command is still in queue in the controller. Since we were blocking waiting for this command to complete, there was no completion handler previously. Set the completion handler, so that whenever the command does come back, it will get freed properly. Do not free ATA Identify commands that have timed out in mp{s,r}sas_add_device(). Wait for them to actually come back from the controller. mp{s,r}var.h: Add a dump_reqs_alltypes variable for the new dump_reqs_alltypes sysctl. Make sure we print the current state for state transition asserts. This was tested in the Spectra Logic test bed (as described in the review), as well Netflix's Open Connect fleet (where panics dropped from a dozen or two a month to zero). Reviewed by: imp@ (who is handling the commit with ken's OK) Sponsored by: Spectra Logic Differential Revision: https://reviews.freebsd.org/D25476

view details

Warner Losh

commit sha 33755dbb207878c10fd99de39dadf89fad713bc7

mpr/mps: Minor state machine fix When a DMA chain can't be loaded, set the state to STATE_INQUEUE so that the mp[rs]_complete_command can properly fail the command. Sponsored by: Netflix

view details

Konstantin Belousov

commit sha a603d41aca48ff21df59967c55ddef181e16ec14

madt_setup_local: skip further checks if ACPI DMAR table already disabled x2APIC Reviewed by: markj Tested by: David Sebek <dasebek@gmail.com> Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D30624

view details

Konstantin Belousov

commit sha 92adf00d0512b674ce18eb1a542ae42e85dd5bca

madt_setup_local: convert series of strcmp to iteration over the array to prepare for one more addition Reviewed by: markj Tested by: David Sebek <dasebek@gmail.com> Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D30624

view details

Konstantin Belousov

commit sha e9e00cc0c98738f0ce7bface221c920c36a1356e

madt_setup_local: extract special case checks into a helper Reviewed by: markj Tested by: David Sebek <dasebek@gmail.com> Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D30624

view details

Konstantin Belousov

commit sha 37f780d3e0a2e8e4c64c526b6e7dc77ff6b91057

Disable x2APIC for SandyBridge laptops with Samsung BIOS From the PR: Almost always, my Samsung RF511 laptop could not boot with x2APIC enabled in the kernel. It froze during SMP initialization, shortly after "ACPI APIC Table: <SECCSD LH43STAR>" was printed to the console. When the kernel is instructed not to use x2APIC, the system boots correctly. PR: 256389 Submitted by: David Sebek <dasebek@gmail.com> Reviewed by: markj MFC after: 1 week Differential revision: https://reviews.freebsd.org/D30624

view details

Kenneth Camann

commit sha 5deb35002545ca5081cc90795fec68bcea30f75d

uefisign: fix SizeOfHeaders sanity check. This check was too aggressive: it is fine if SizeOfHeaders is exactly equal to the size of the DOS stub + PE header + section table. Despite being wrong this code typically worked for most EFI binaries because SizeOfHeaders is rounded up to a multiple of FileAlignment, which is often large (e.g., 512 bytes for the FreeBSD loader) so most binaries made it through. Reviewed by: imp@ Sponsored by: Netflix Pull Request: https://github.com/freebsd/freebsd-src/pull/445

view details

Warner Losh

commit sha eae2ef5a010366c673ad912cae23b426ebb9a8a2

smartpqi: Remove stray declaration pqisrc_is_firmware_feature_enabled shouldn't be declared inline in a header, and then static inline in the .c function. Remove this stray declartion from the header. gcc6 complains, but clang does not. Sponsored by: Netflix

view details

Konstantin Belousov

commit sha f9b1e711f0d8c27f2d29e7a8e6276947d37a6a22

fdescfs: add an option to return underlying file vnode on lookup The 'nodup' option forces fdescfs to return real vnode behind file descriptor instead of the fdescfs fd vnode, on lookup. The end result is that e.g. stat("/dev/fd/3") returns the stat data for the underlying vnode, if any. Similarly, fchdir(2) works in the expected way. For open(2), if applied over file descriptor opened with O_PATH, it effectively re-open that vnode into normal file descriptor which has the specified access mode, assuming the current vnode permissions allow it. If the file descriptor does not reference vnode, the behavior is unchanged. This is done by a mount option, because permission check on open(2) breaks established fdescfs open semantic of dup(2)-ing the descriptor. So it is not suitable for /dev/fd mount. Tested by: Andrew Walker <awalker@ixsystems.com> Reviewed by: markj Sponsored by: The FreeBSD Foundation MFC after: 1 week Differential revision: https://reviews.freebsd.org/D30140

view details

Rick Macklem

commit sha d224f05fcfc13725c43ea0a02d511b3bf6a8ad14

nfsd: Pre-parse the next NFSv4 operation number for put FH operations RFC5661 Sec. 2.6 specifies when a NFSERR_WRONGSEC error reply can be done. For the four operations PutFH, PutrootFH, PutpublicFH and RestoreFH, NFSERR_WRONGSEC can or cannot be replied, depending upon what operation follows one of these operations in the compound. This patch modifies nfsrvd_compound() so that it parses the next operation number before executing any of the above four operations, storing it in "nextop". A future commit will implement use of "nextop" to decide if NFSERR_WRONGSEC can be replied for the above four operations. This commit should not change the semantics of performing the compound RPC. MFC after: 2 weeks

view details

Cy Schubert

commit sha 681500889424423403ace51f118b3467e09acc00

wpa: Fix GCC 6 build GCC 6 searches serially to resolve external references. MFC after: 2 months X-MFC with: 25ecdc7d52770caf1c9b44b5ec11f468f6b636f3

view details

Ka Ho Ng

commit sha 73570795e7906ec555b37ff7e20e5d5d559ccdad

gitignore: Add compile_commands.json The purpose of this change is to make sure no one would accidentally include their own workspace leftover into a commit. compile_commands.json is a generated file which contains build commands. The file is consumed by Language Servers such as clangd and ccls. Sponsored by: The FreeBSD Foundation Reviewed by: lwhsu Differential Revision: https://reviews.freebsd.org/D26514

view details

Hans Petter Selasky

commit sha d4cf41a99b405c73288aea81e3c4580d1de18435

Add support for RTL8153B, RTL8156 and RTL8156B to if_ure(4). Submitted by: fbbz@synack.eu PR: 253374 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking

view details

Ka Ho Ng

commit sha 9b236631b1ec50e90bef1995aff68fed65b21be5

gitignore: Add .clangd and .ccls-cache Add residues of clangd and ccls to prevent them from being accidentally included in a commit. clangd and ccls are two C/C++ Language Server implementations listed in https://microsoft.github.io/language-server-protocol/implementors/servers/ . Sponsored by: The FreeBSD Foundation MFC after: 3 days Reviewed by: philip Differential Revision: https://reviews.freebsd.org/D26555

view details

Lutz Donnerhacke

commit sha 0345fd891fe13a191fc0fae9463ea9458bfaff5a

netgraph/ng_base: Renaming a node to the same name is a noop Detailed analysis in https://github.com/genneko/freebsd-vimage-jails/issues/2 brought the problem down to a double call of ng_node_name() before and after a vnet move. Because the name of the node is already known (occupied by itself), the second call fails. PR: 241954 Reported by: Paul Armstrong MFC: 1 week Differential Revision: https://reviews.freebsd.org/D30110

view details

Randall Stewart

commit sha 4747500deaaa7765ba1c0413197c23ddba4faf49

tcp: A better fix for the previously attempted fix of the ack-war issue with tcp. So it turns out that my fix before was not correct. It ended with us failing some of the "improved" SYN tests, since we are not in the correct states. With more digging I have figured out the root of the problem is that when we receive a SYN|FIN the reassembly code made it so we create a segq entry to hold the FIN. In the established state where we were not in order this would be correct i.e. a 0 len with a FIN would need to be accepted. But if you are in a front state we need to strip the FIN so we correctly handle the ACK but ignore the FIN. This gets us into the proper states and avoids the previous ack war. I back out some of the previous changes but then add a new change here in tcp_reass() that fixes the root cause of the issue. We still leave the rack panic fixes in place however. Reviewed by: mtuexen Sponsored by: Netflix Inc Differential Revision: https://reviews.freebsd.org/D30627

view details

Lutz Donnerhacke

commit sha c8250c5ada85fec8936e8eb8695d7cb80a3ce8ab

ipfw.8: synopsis misses nat show form Document the existing behavior, which is currently only available by reading third party documentation or the source code itself. PR: 254617 Submitted by: Oliver Kiddle MFC after: 2 weeks Differential Revision: https://reviews.freebsd.org/D30189

view details

Lutz Donnerhacke

commit sha 24ea1dbf257aa6757f469bcd859f90e9ad851e59

tests/netgraph: Inital framework for testing libnetgraph Provide a framework of functions to test various netgraph modules. Tests contain: - creating, renaming, and destroying nodes - connecting and removing hooks - sending and receiving data - sending ASCII messages - errors can be passed for indiviual inspection or fail the test Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30629

view details

Hans Petter Selasky

commit sha dab84426a68d43efaede62ccf86ca3ef852f8ae3

Narrow down the probe range for if_ure(4) compatible devices to only match the first vendor specific interface, if any. PR: 253374 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking

view details

push time in 2 months

push eventDimitryAndric/freebsd-src

Dimitry Andric

commit sha 522c2fa0a4d3f5ad3581f14dc4f34075d4813867

Update OptionalObsoleteFiles again for additional libc++ headers.

view details

push time in 2 months

push eventDimitryAndric/freebsd-src

Andrew Turner

commit sha 0a0d6ce34d6be89cb356c7815648e455fabe3151

Use the arm virtual counter in the arm64 loader It exist on all ARMv8+ CPUs, and other boot loaders rely on it being present. Sponsored by: Innovate UK Differential Revision: https://reviews.freebsd.org/D30410

view details

Andrew Turner

commit sha 2422138952d86dd8b02ff33c55f747ca8e381afe

Fix the KCSAN_ENABLED check when building modules The KCSAN_ENABLED variable is non-empty when the kernel is being built with KCSAN. This allows us to disable modules that are known to be broken. There was a bug where we would check if it was defined. As this is always the case the KCSAN_ENABLED variable would be set when building modules so we would never build such a module. Fix this by checking if the value is empty before passing it on to the module stage. This doesn't affect how modules are built as the CFLAGS passed to modules has the correct check. Reported by: rstone Sponsored by: Innovate UK

view details

Rich Ercolani

commit sha a19ae1b099ad4d43588f15ef19b8506f606b27cb

vfs: fix MNT_SYNCHRONOUS check in vn_write ca1ce50b2b5ef11d ("vfs: add more safety against concurrent forced unmount to vn_write") has a side effect of only checking MNT_SYNCHRONOUS if O_FSYNC is set. Reviewed By: mjg Differential Revision: https://reviews.freebsd.org/D30610

view details

Mateusz Guzik

commit sha c9f8dcda856c50325190326a618dc251311bc43a

kqueue: replace kq_ncallouts loop with atomic_fetchadd

view details

Ceri Davies

commit sha 774bb1c256fbc58a7e8d0d1f7d6427007105b334

periodic: add support for .xz and .zcat compressed logs Also improve temporary file usage in 200.accounting, add an xref to zstd(1) to newsyslog.conf.5, and clarify in periodic.conf that "daily accounting" means process accounting and "monthly accounting" is login accounting. PR: 253868 Reviewed by: allanjude Approved by: blackend (mentor) Differential Revision: https://reviews.freebsd.org/D29267

view details

Warner Losh

commit sha e8dca53aa06ed7a06a83e666c4c303692f8fdbbe

kmod.mk: Allow extra objects to be specified in modules OBJS are automatically added to CLEANFILES. For pre-built objects, this is not desirable since it will delete the object from the source tree. Introduce EXTRA_OBJS which list these object files, but aren't added to clean files. Sponsored by: Netflix Reviewed by: emaste@ Differential Revision: https://reviews.freebsd.org/D30615

view details

Warner Losh

commit sha 455dff72fcc260f758964d61f67dd1ba79e4889d

hpt27xx: Use EXTRA_OBJS instead of OBJS Sponsored by: Netflix Reviewed by: emaste@ Differential Revision: https://reviews.freebsd.org/D30616

view details

Warner Losh

commit sha 22ed04c2039191f80f4a871909fbebf6766da5fd

hptmv: use BLOB_OBJS for pre-built .o's Sponsored by: Netflix

view details

Warner Losh

commit sha adfe4271248cd5ff6f17e6604da354b1c2f0026c

hptnr: use BLOB_OBJS for pre-built .o's Sponsored by: Netflix

view details

John Ko

commit sha 7ef92163ab81b1b14f2a111d17baf2b352338577

Allows user to specify an optional ZFSBOOT_POOL_SIZE for their zroot The default is to create a zroot that consumes the whole disk because if used with geli(8) this makes sense. Without geli(8), I like to keep my data pool separate from my system pool. This is different than ZFSBOOT_BOOT_POOL_SIZE which is named bootpool. Reviewed by: allenjude Pull Request: https://github.com/freebsd/freebsd-src/pull/53 Differential Revision: https://reviews.freebsd.org/D30588

view details

Max Stucchi

commit sha 1976e079544c8ff691f2eec497d68611d8215af5

Add bcm2710-rpi-cm3.dtb to the list of DTBs being added. This allows to boot out of the box on the RPI COmpute Module 3 with 32G of eMMC. Tested by: imp confirmed .dtb is in the rpi-firmware pkg Reviewed by: gjb@, imp@ Pull Request: https://github.com/freebsd/freebsd-src/pull/452 Sponsored by: Netflix

view details

Moritz Buhl

commit sha 4bc2174a1b489c36195ccc8cfc15e0775b817c69

kern: fail getgroup and setgroup with negative int Found using https://github.com/NetBSD/src/blob/trunk/tests/lib/libc/sys/t_getgroups.c getgroups/setgroups want an int and therefore casting it to u_int resulted in `getgroups(-1, ...)` not returning -1 / errno = EINVAL. imp@ updated syscall.master and made changes markj@ suggested PR: 189941 Tested by: imp@ Reviewed by: markj@ Pull Request: https://github.com/freebsd/freebsd-src/pull/407 Differential Revision: https://reviews.freebsd.org/D30617

view details

Warner Losh

commit sha bf26ea77553931c22e72ddf1f9df6fb51fcbadfe

t_getgroups: No longer expected to fail Sponsored by: Netflix

view details

Warner Losh

commit sha 9f3d1a98dd17b9f02912aecab328fd0315d8ef35

regen after tweaks to getgroups and setgroups Sponsored by: Netflix

view details

Leandro Lupori

commit sha 4a66b8083cc61e89ffdddaae876d882950d6aade

powerpc: fix boot on pseries without hugepages Commit 49c894ddced5 introduced an issue that prevented pseries boot, when hugepages were not available to the guest. Now large page info must be available before moea64_install is called, so this change moves the code that scans large page sizes before the call. Reviewed by: jhibbits (IRC) Sponsored by: Instituto de Pesquisas Eldorado (eldorado.org.br)

view details

sebastien.bini

commit sha e5be21d19b41e4d42ffea5c7978d7e64a5cec4fc

sbin/veriexec: fixed parameter parsing of option -x The -x parameter doesn't take any arguments. It says that all further arguments are paths to check. Reviewed by: imp@ Sponsored by: Netflix Pull Request: https://github.com/freebsd/freebsd-src/pull/443/files

view details

Noah Bergbauer

commit sha e61e072f3bdfd2016b87c255c9bdc880bb1aa2f9

gconcat: Switch array to TAILQ to prepare for online append Reviewed by: imp@ Pull Request: https://github.com/freebsd/freebsd-src/pull/447 Sponsored by: Netflix

view details

Noah Bergbauer

commit sha 56fd97660ac44aacd502dff6e2580d0259146e42

gconcat: Add new lock to allow modifications to the disk list in preparation for online append In addition, rename existing sc_lock to sc_append_lock Reviewed by: imp@ Pull Request: https://github.com/freebsd/freebsd-src/pull/447 Sponsored by: Netflix

view details

Rick Macklem

commit sha 984c71f90300906e106b9714af0e7d9b542c50e6

nfsd: Fix the failure return for non-fh NFSv4 operations Without this patch, nfsd_checkrootexp() returns failure and then the NFSv4 operation would reply NFSERR_WRONGSEC. RFC5661 Sec. 2.6 only allows a few NFSv4 operations, none of which call nfsv4_checktootexp(), to return NFSERR_WRONGSEC. This patch modifies nfsd_checkrootexp() to return the error instead of a boolean and sets the returned error to an RPC layer AUTH_ERR, as discussed on nfsv4@ietf.org. The patch also fixes nfsd_errmap() so that the pseudo error NFSERR_AUTHERR is handled correctly such that an RPC layer AUTH_ERR is replied to the NFSv4 client. The two new "enum auth_stat" values have not yet been assigned by IANA, but are the expected next two values. The effect on extant NFSv4 clients of this change appears limited to reporting a different failure error when a mount that does not use adequate security is attempted. MFC after: 2 weeks

view details

Konstantin Belousov

commit sha e3149e0a02d6d09fb4c3acd085da2509dbab7320

rtld: Rename -t option to -u (ignore LD_ vars) Requested by: arichardson Sponsored by: The FreeBSD Foundation MFC after: 3 days

view details

push time in 2 months

push eventDimitryAndric/freebsd-src

Cy Schubert

commit sha 323a4e2c4e285e6f8eee8db3fe2cb7490a734da0

ipfilter: Fix ip_nat memory leak and use-after-free Unfortunately the wrong elemet is freed, also resulting in use-after-free. PR: 255859 Submitted by: lylgood@foxmail.com Reported by: lylgood@foxmail.com MFC after: 3 days

view details

Rick Macklem

commit sha 724072ab1d588677a83a5a5011b5ad9ff5d56538

nfscl: Use hash lists to improve expected search performance for opens A problem was reported via email, where a large (130000+) accumulation of NFSv4 opens on an NFSv4 mount caused significant lock contention on the mutex used to protect the client mount's open/lock state. Although the root cause for the accumulation of opens was not resolved, it is obvious that the NFSv4 client is not designed to handle 100000+ opens efficiently. When searching for an open, usually for a match by file handle, a linear search of all opens is done. Commit 3f7e14ad9345 added a hash table of lists hashed on file handle for the opens. This patch uses the hash lists for searching for a matching open based of file handle instead of an exhaustive linear search of all opens. This change appears to be performance neutral for a small number of opens, but should improve expected performance for a large number of opens. This patch also moves any found match to the front of the hash list, to try and maintain the hash lists in recently used ordering (least recently used at the end of the list). This commit should not affect the high level semantics of open handling. MFC after: 2 weeks

view details

Konstantin Belousov

commit sha a59f0285377aa3d61cccda64e9ade126ecb3d2d9

amd64/linux*: add required header to get the constant value Otherwise asm silently interpret it as the external global symbol. Reported by: bz Sponsored by: The FreeBSD Foundation Fixes: 91aae953cb80

view details

John Baldwin

commit sha 3c7a01d773ac2d128eabb596eed7098f76966cc5

Extend m_apply() to support unmapped mbufs. m_apply() invokes the callback function separately on each segment of an unmapped mbuf: the TLS header, individual pages, and the TLS trailer. Reviewed by: markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D30132

view details

John Baldwin

commit sha 3f9dac85cc8f2963026fdc2d5477acb607176a89

Extend m_copyback() to support unmapped mbufs. Reviewed by: gallatin, markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D30133

view details

John Baldwin

commit sha aa341db39b6373c5e242f376a3cabe6a6b99141e

Rename m_unmappedtouio() to m_unmapped_uiomove(). This function doesn't only copy data into a uio but instead is a variant of uiomove() similar to uiomove_fromphys(). Reviewed by: gallatin, markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D30444

view details

John Baldwin

commit sha 1c8f4b3c9f9e8ca5823d153d3b117246b3d18db4

Support unmapped mbufs in crypto buffers. Reviewed by: markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D30134

view details

John Baldwin

commit sha 6663f8a23e7cb60d798c5ffbd9c716b62b204f2a

sglist: Add sglist_append_single_mbuf(). This function appends the contents of a single mbuf to an sglist rather than an entire mbuf chain. Reviewed by: gallatin, markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D30135

view details

John Baldwin

commit sha 883a0196b629a07e52562b4103cc0f6391083080

crypto: Add a new type of crypto buffer for a single mbuf. This is intended for use in KTLS transmit where each TLS record is described by a single mbuf that is itself queued in the socket buffer. Using the existing CRYPTO_BUF_MBUF would result in bus_dmamap_load_crp() walking additional mbufs in the socket buffer that are not relevant, but generating a S/G list that potentially exceeds the limit of the tag (while also wasting CPU cycles). Reviewed by: markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D30136

view details

John Baldwin

commit sha 4a92afae7fcbb0a8453712dfec5de086aaf5cba4

ktls_ocf: Fix a few places to not hardcode the GMAC hash length. This is not a functional change as the Poly1305 hash is the same length as the GMAC hash length. Reviewed by: gallatin, markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D30137

view details

John Baldwin

commit sha 21e3c1fbe2460f144f6d4dfd61c3346b2de59667

Assume OCF is the only KTLS software backend. This removes support for loadable software backends. The KTLS OCF support is now always included in kernels with KERN_TLS and the ktls_ocf.ko module has been removed. The software encryption routines now take an mbuf directly and use the TLS mbuf as the crypto buffer when possible. Bump __FreeBSD_version for software backends in ports. Reviewed by: gallatin, markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D30138

view details

John Baldwin

commit sha 6b313a3a60453e87f0a224361dad6284550395de

Include the trailer in the original dst_iov. This avoids creating a duplicate copy on the stack just to append the trailer. Reviewed by: gallatin, markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D30139

view details

John Baldwin

commit sha beb817edfe22cdea91e19a60c42caabd9404da48

crypto: Add crypto_cursor_segment() to fetch both base and length. This function combines crypto_cursor_segbase() and crypto_cursor_seglen() into a single function. This is mostly beneficial in the unmapped mbuf case where back to back calls of these two functions have to iterate over the sub-components of unmapped mbufs twice. Bump __FreeBSD_version for crypto drivers in ports. Suggested by: markj Reviewed by: markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D30445

view details

John Baldwin

commit sha 86be314d09bc2857bb63d0a1e34945c63daa0008

cryptosoft: Use crypto_cursor_segment(). Reviewed by: markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D30446

view details

John Baldwin

commit sha 1c09320d5833fef8a4b6cc0091883fd47ea1eb1b

ossl: Use crypto_cursor_segment(). Reviewed by: markj Sponsored by: Netflix Differential Revision: https://reviews.freebsd.org/D30447

view details

Dmitry Chagin

commit sha 962b3a092616c95c68c0b0a844f4660675aa40f6

rtwn_usb(4): add D-Link DWA-121 (N150 Nano) to the rtwn_usb hardware list MFC after: 2 weeks

view details

Dmitry Chagin

commit sha 5184e2da41921dfec5a3668756890b5c073fbad9

linux_common: retire extra module version. The second 'linuxcommon' line was added by c66f5b079d2a259c3a65b1efe0f2143cd030dc52 but Linuxulator's modules dependend on 'linux_common'. To avoid such mistakes in the future rename moduledata name and module name to 'linux_common' and retire 'linuxcommon' line. Reviewed by: emaste Differential Revision: https://reviews.freebsd.org/D30409 MFC after: 2 weeks

view details

Peter Holm

commit sha 79f27053e4e072afaf808c06e59c734b72e82c9b

stress2: Fix cleanup on exit

view details

Peter Holm

commit sha bad9303974fc7e88e34cc6e0f47564ba26517173

stress2: Update the exclude list

view details

Peter Holm

commit sha 0b5d6b8173d91802cd0d765ce2e19d856f4bc401

stress2: Added a new ptrace() test scenario

view details

push time in 2 months

push eventDimitryAndric/freebsd-src

Dmitry Chagin

commit sha 174d8b60324d7e8754709f7155e13ca95220b48c

Vendor import of tcsh-6.22.04

view details

Eugene Grosbein

commit sha f5b5de1a3210234f3a6864c88a2d3e11ac2dbf04

ipfw: reload sysctl.conf variables if needed Currently ipfw has multiple components that are not parts of GENERIC kernel like dummynet etc. They can bring in important sysctls if enabled with rc.conf(5) and loaded with ipfw startup script by means of "required_modules" after initial consult with /etc/sysctl.conf at boot time. Here is an example of one increasing limit for dummynet hold queues that defaults to 100: net.inet.ip.dummynet.pipe_slot_limit=1000 This makes it possible to use ipfw/dummynet rules such as: ipfw pipe 1 config bw 50Mbit/s queue 1000 Such rule is rejected unless above sysctl is applied. Another example is a group of net.inet.ip.alias.* sysctls created after libalias.ko loaded as dependency of ipfw_nat. This is not a problem if corresponding code compiled in custom kernel so sysctls exist when sysctl.conf is read early or kernel modules loaded with a loader. This change makes it work also for GENERIC and modules loaded by means of rc.conf(5) settings. MFC after: 1 month

view details

Kirk McKusick

commit sha efe145a7453e4208f032816ce3f80e9fb6b0e4ee

Correct assert added to dump program. The dump program was exiting with the message: Assertion failed: (spcl.c_count + blks < TP_NINDIR), function appendextdata, file /usr/src/sbin/dump/traverse.c, line 759. The problem arose when dumping external attributes. This assertion was added in this commit with no review by someone with expertise in the dump program: commit 2d518c6518cdb256ff6f2c463e6b115d89c104c3 Author: Warner Losh <imp@FreeBSD.org> AuthorDate: Mon Jun 11 19:32:36 2018 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: Mon Jun 11 19:32:36 2018 +0000 Add asserts to prevent overflows of c_addr. It is clearly wrong as the statement immediately above it in the code which is deciding if the data will fit is: if (spcl.c_count + blks > TP_NINDIR) return (0); As is pointed out in the bug report, the assert should be: (spcl.c_count + blks <= TP_NINDIR) This commit corrects the assert. I am sorry that it took so long to be brought to my attention and get fixed. Reported by: Hampton Finger PR: 244470 MFC after: 3 days Sponsored by: Netflix

view details

John Baldwin

commit sha 8d2b4b2e7c1e0b10c4d49963753db31c4794dbc4

cxgbe: Cast pointer arguments to trunc_page() to vm_offset_t. Reported by: mjg, jenkins, rmacklem Fixes: 46bee8043ee2bd352d420cd573e0364ca45f813e Sponsored by: Chelsio Communications

view details

Colin Percival

commit sha 330f110bf1e420dc8d8ddadc4030e0ae1f1c52bd

Fix 'hostuuid: preload data malformed' warning If the preloaded hostuuid value is invalid and verbose booting is enabled, a warning is printed. This printf had two bugs: 1. It was missing a trailing \n character. 2. The malformed UUID is printed with %s even though it is not known to be NUL-terminated. This commit adds the missing \n and uses %.*s with the (already known) length of the preloaded UUID to ensure that we don't read past the end of the buffer. Reported by: kevans Fixes: c3188289 Preload hostuuid for early-boot use MFC after: 3 days

view details

Colin Percival

commit sha b6be9566d236f83ad1a44170a64b9a34e382eafa

Fix buffer overflow in preloaded hostuuid cleaning When a module of type "hostuuid" is provided by the loader, prison0_init strips any trailing whitespace and ASCII control characters by (a) adjusting the buffer length, and (b) zeroing out the characters in question, before storing it as the system's hostuuid. The buffer length adjustment was correct, but the zeroing overwrote one byte higher in memory than intended -- in the typical case, zeroing one byte past the end of the hostuuid buffer. Due to the layout of buffers passed by the boot loader to the kernel, this will be the first byte of a subsequent buffer. This was *probably* harmless; prison0_init runs after preloaded kernel modules have been linked and after the preloaded /boot/entropy cache has been processed, so in both cases having the first byte overwritten will not cause problems. We cannot however rule out the possibility that other objects which are preloaded by the loader could suffer from having the first byte overwritten. Since the zeroing does not in fact serve any purpose, remove it and trim trailing whitespace and ASCII control characters by adjusting the buffer length alone. Fixes: c3188289 Preload hostuuid for early-boot use Reviewed by: kevans, markj MFC after: 3 days

view details

Goran Mekić

commit sha c232fd4b4191a722f8c3193ef1e7c6efd8385182

sndstat.4: Improve manpage wording Reviewed by: bcr, khng Differential Revision: https://reviews.freebsd.org/D30027

view details

Roger Pau Monné

commit sha 9e14ac116e70722b7fcc803736184535295b165d

x86/xen: further PVHv1 removal cleanup The AP startup extern variable declarations are not longer needed, since PVHv2 uses the native AP startup path using the lapic. Remove the declaration and make the variables static to mp_machdep.c Sponsored by: Citrix Systems R&D

view details

Hans Petter Selasky

commit sha 00e501d720d46386e6c8d0ebb4b3a8e98cb0390e

Update usb_timings_sysctl_handler() to accept any value for timings between 0 milliseconds and 2 seconds inclusivly. Some style fixes while at it. The USB specification has minimum values and maximum values, and not only minimum values. MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking

view details

Hans Petter Selasky

commit sha 70ffaaa69c830d26b59136d0b0447ab2f8683db8

Update USB_PORT_RESET_RECOVERY to comply with the USB 2.0 specification which says it should be max 10 milliseconds. This may fix some USB enumeration issues: > usbd_req_re_enumerate: addr=3, set address failed! (USB_ERR_IOERROR, ignored) > usbd_setup_device_desc: getting device descriptor at addr 3 failed, Found by: Zhichao1.Li@dell.com MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking

view details

Hans Petter Selasky

commit sha e5ff940a81b56cb236795e0059c44981053f8404

Propagate down USB explore error codes, so that failures to enumerate USB HUBs behind USB HUBs are detected and the USB reset counter logic will kick in preventing enumeration of continuously failing ports. Submitted by: phk@ Tested by: bz@ PR: 237666 MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking

view details

Mateusz Guzik

commit sha 715fcc0d342684da5d109a7e4891d30aa38667c9

vfs: change vn_freevnodes_* prefix to idiomatic vfs_freevnodes_*

view details

Mateusz Guzik

commit sha cc6f46ac2fd5d910e632fced3f21d0b0f53030d8

vfs: refactor vdrop In particular move vunlazy into its own routine.

view details

Konstantin Belousov

commit sha 8cf912b017a04a2eec01fbaa1f7b9ef556403ede

ttydev_write: prevent stops while terminal is busied Since busy state is checked by all blocked writes, stopping a process which waits in ttydisc_write() causes cascade. Utilize sigdeferstop() to avoid the issue. Submitted by: Jakub Piecuch <j.piecuch96@gmail.com> PR: 255816 MFC after: 1 week

view details

Mark Johnston

commit sha c4a6258d70f73c27d8f0c6233edbcc609791806b

dummynet: Fix mbuf tag allocation failure handling PR: 255875, 255878, 255879, 255880 Reviewed by: donner, kp MFC after: 1 week Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30318

view details

Lv Yunlong

commit sha b295c5ddcef4744ef7044d2327b4258b6ad055f0

socket: Release cred reference later in sodealloc() We dereference so->so_cred to update the per-uid socket buffer accounting, so the crfree() call must be deferred until after that point. PR: 255869 MFC after: 1 week

view details

Lutz Donnerhacke

commit sha 7fd8baee756efa18b6bbb17cbf3a652eb2058d87

test/libalias: Tests for instantiation In order to modify libalias for performance, the existing functionality must not change. Enforce this. Reviewed by: kp MFC after: 1 week Differential Revision: https://reviews.freebsd.org/D30307

view details

Markus Stoff

commit sha 63b6a08ce2467b8e230e7a4ecb3e1ddf1b48851c

ng_parse: IP address parsing in netgraph eating too many characters Once the final component of the IP address has been parsed, the offset on the input must not be advanced, as this would remove an unparsed character from the input. Submitted by: Markus Stoff Reviewed by: donner MFC after: 3 weeks Differential Revision: https://reviews.freebsd.org/D26489

view details

Zhenlei Huang

commit sha 3d846e48227e2e78c1e7b35145f57353ffda56ba

Do not forward datagrams originated by link-local addresses The current implement of ip_input() reject packets destined for 169.254.0.0/16, but not those original from 169.254.0.0/16 link-local addresses. Fix to fully respect RFC 3927 section 2.7. PR: 255388 Reviewed by: donner, rgrimes, karels MFC after: 1 month Differential Revision: https://reviews.freebsd.org/D29968

view details

Rick Macklem

commit sha b3d4c70dc60f1913f2363751b905b562c39ca126

nfsd: Add support for CLAIM_DELEG_CUR_FH to the NFSv4.1/4.2 Open The Linux NFSv4.1/4.2 client now uses the CLAIM_DELEG_CUR_FH variant of the Open operation when delegations are recalled and the client has a local open of the file. This patch adds support for this variant of Open to the NFSv4.1/4.2 server. This patch only affects mounts from Linux clients when delegations are enabled on the server. MFC after: 2 weeks

view details

push time in 2 months

pull request commentphp/php-src

Fix possible use-after-free in realpath_cache_clean()

I think this looks reasonable for now, though it's rather annoying that you can't use normal global access in globals_dtor, as it may get run from a different thread :/

I guess this is because realpath_cache_clean() is an externally available function? I.e. it is called from ext/opcache/ZendAccelerator.c and ext/standard/filestat.c. These can have any random thread context, so then you'll have to use CWDG(), at least if I understand correctly. But there are probably historical reasons why this function exists. :)

DimitryAndric

comment created time in 2 months

pull request commentphp/php-src

Fix possible use-after-free in realpath_cache_clean()

Alternative approach in 9d38056f935bc8995657d4d07438467e9e00e957, but this required adding a ZEND_TSRMG_FAST_BULK macro to zend.h, and is somewhat more invasive. The end result looks a bit nicer, though.

DimitryAndric

comment created time in 2 months

PR opened php/php-src

Fix possible use-after-free in realpath_cache_clean()

Fix possible use-after-free in realpath_cache_clean()

If ZTS is enabled, this can cause cwd_globals_ctor() to be called multiple times, each with a freshly allocated virtual_cwd_globals instance. At shutdown time however, cwd_globals_dtor() will call realpath_cache_clean(), which then possibly cleans up the same realpath_cache instance more than once. Using AddressSanitzer, this shows up as a heap use-after-free.

To avoid this, add a helper function to do the actual work on one instance of a realpath_cache, and call it both from cwd_globals_dtor() and realpath_cache_clean(). The former uses the virtual_cwd_globals parameter passed in via the destructor, the latter uses the CWDG() macro.

+18 -13

0 comment

1 changed file

pr created time in 2 months

create barnchDimitryAndric/php-src

branch : fix-bug81068-2

created branch time in 2 months

create barnchDimitryAndric/php-src

branch : fix-bug81068-1

created branch time in 2 months

push eventDimitryAndric/freebsd-src

Hans Petter Selasky

commit sha 904390b4787d2e4a0d9d8ca9cb0d6da5a4fb320c

Implement read-only VM_SHARED flag in the LinuxKPI. For use by mmap(2) callbacks. MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking

view details

Hans Petter Selasky

commit sha 67807f5066a012254da9a4535c0f225377afb66d

cdev_del() should only put it's kernel object in the LinuxKPI. The destructor takes care of the rest. MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking

view details

Hans Petter Selasky

commit sha b8f113cab91f288e5d5e29d21184d1601b87cfdd

Implement cdev_device_add() and cdev_device_del() in the LinuxKPI. MFC after: 1 week Sponsored by: Mellanox Technologies // NVIDIA Networking

view details

Mark Johnston

commit sha 1a04f0156c4e6abfc01d5841341a94179f317f31

cryptodev: Fix some input validation bugs - When we do not have a separate IV, make sure that the IV length specified by the session is not larger than the payload size. - Disallow AEAD requests without a separate IV. crp_sanity() asserts that CRYPTO_F_IV_SEPARATE is set for AEAD requests, and some (but not all) drivers require it. - Return EINVAL for AEAD requests if an IV is specified but the transform does not expect one. Reported by: syzbot+c9e8f6ff5cb7fa6a1250@syzkaller.appspotmail.com Reported by: syzbot+007341439ae295cee74f@syzkaller.appspotmail.com Reported by: syzbot+46e0cc42a428b3b0a40d@syzkaller.appspotmail.com Reported by: syzbot+2c4d670173b8bdb947df@syzkaller.appspotmail.com Reported by: syzbot+220faa5eeb4d47b23877@syzkaller.appspotmail.com Reported by: syzbot+e83434b40f05843722f7@syzkaller.appspotmail.com Reviewed by: jhb MFC after: 3 days Sponsored by: The FreeBSD Foundation Differential Revision: https://reviews.freebsd.org/D30154

view details

Kirk McKusick

commit sha a3628327e7b62c955e7bad9e43044cdb01984d80

Ensure that files with no allocated blocks are trimmed to zero length. UFS does not allow files to end with a hole; it requires that the last block of a file be allocated. As fsck_ffs(8) initially scans each allocated inode, it tracks the last allocated block in the inode. It then checks that the inode's size falls in the last allocated block. If the last allocated block falls before the size, a `file size beyond end of allocated file' warning is issued and the file is shortened to reference the last allocated block (to avoid having it reference a hole at its end). If the last allocated block falls after the size, a `partially truncated file' warning is issued and all blocks following the block referenced by the size are freed. Because of an incorrect unsigned comparison, this test was failing to handle files with no allocated blocks but non-zero size (which should have had their size reset to zero). Once that was fixed the test started incorrectly complaining about short symbolic links that place the link path in the inode rather than in a disk block. Because these symbolic links have a non-zero size, but no allocated blocks, fsck_ffs wanted to zero out their size. This patch has to detect and avoid changing the size of such symbolic links. Reported by: Chuck Silvers Tested by: Chuck Silvers MFC after: 1 week Sponsored by: Netflix

view details

John Baldwin

commit sha ed93deba1106da2cd4755a61612c37bb67edc914

Remove a write-only variable. While refactoring an earlier series of changes during review, the 'saved_data' variable stopped being used at the bottom of if_ioctl(). Suggested by: brooks Reviewed by: brooks, imp, kib Fixes: d17e0940f79f Rework compat shims in ifioctl(). Sponsored by: DARPA Differential Revision: https://reviews.freebsd.org/D30197

view details

Poul-Henning Kamp

commit sha 9db7da1f55b3f793c9b0e7d8fca5fbbc26c90691

Polish source to WARNS=6

view details

Poul-Henning Kamp

commit sha b2ae176d914acd63247e24d7e23dbe8f239fbfb0

Sixteen bit I2c addresses are always little endian.

view details

Robert Wing

commit sha a7f81b488df2d4a5dcd785b4112e04ffb6ca0442

libvmm: explicitly save and restore errno in vm_open() In commit 6bb140e3ca895a14, vm_destroy() was replaced with free() to preserve errno. However, it's possible that free() may change the errno as well. Keep the free() call, but explicitly save and restore errno. Noted by: jhb Fixes: 6bb140e3ca895a14

view details

Andrew Fengler

commit sha 30659d1dcbcc92016833f0956461314ed501ac83

Add support for adding default routes for other FIBs Make rc.d/routing read defaultrouter_fibN and ipv6_defaultrouter_fibN, and set it as the default gateway for FIB N, where N is from 1 to (net.fibs - 1) This allows adding gateways for multiple FIBs in the same format as the main gateway. (FIB 0) Reviewed by: olivier, rgrimes, bcr (man page) Sponsored by: ScaleEngine Inc. Differential Revision: https://reviews.freebsd.org/D22706

view details

Stefan Eßer

commit sha e5092308d94ef05d9af0ea4d5edfe8b0ce323ec3

Vendor import of Gavin D. Howard's bc version 4.0.2

view details

Stefan Eßer

commit sha e681dd3e2c1221fcf81cc8bc36a70decc50d9ebb

Revert "Vendor import of Gavin D. Howard's bc version 4.0.2" The update had been performed on a check-out of the vendor branch, but the final push lacked the target designation vendor/bc.

view details

Stefan Eßer

commit sha 2858419a0ee2b8f5827de72c00618bcd69ebc5fc

Vendor import of Gavin D. Howard's bc version 4.0.2

view details

Stefan Eßer

commit sha 8c39e25220bb88cd027d0c3b0fe86e52f6abd150

contrib/bc: update to version 4.0.2 Merge commit '2858419a0ee2b8f5827de72c00618bcd69ebc5fc' This update fixes the initialization of "scale" to 20 if started with -l and the initial statement leads to an error (e.g. contains a syntax error). Scale was initialized to 0 in that case. Another change is the support of job control in interactive mode with line editing enabled. The control characters have been interpreted as editing commands only, prior to this version. MFC after: 3 days

view details

Michael Tuexen

commit sha 12dda000ed32efa16f59909a6294e4d4b5a771ba

sctp: fix locking in case of error handling during a restart Thanks to Taylor Brandstetter for finding the issue and providing a patch for the userland stack. MFC after: 3 days

view details

Glen Barber

commit sha 3f25cfea55922780fe47eb6ebcef49ca15297261

release: update release.sh to use Git for ports tree checkouts MFC after: immediately (pending re approval) Sponsored by: Rubicon Communications, LLC ("Netgate")

view details

Glen Barber

commit sha fb6e261c20ebcd94875d623e167369802721f2dd

release: follow-up to previous commit to use Git for the ports tree MFC after: immediately (pending re approval) Sponsored by: Rubicon Communications, LLC ("Netgate")

view details

Glen Barber

commit sha 69b6abb7b2bb2b07600b27660d864ddcd0b28cec

release: remove logic to locate the svn{,lite} binary Sponsored by: Rubicon Communications, LLC ("Netgate")

view details

Glen Barber

commit sha c0dbc49ab3f7e43a2972c932fcd2b2ed4d06448b

release: fix ports checkout if /usr/ports does not exist Reported by: Yasuhiro Kimura Sponsored by: Rubicon Communications, LLC ("Netgate")

view details

Michael Tuexen

commit sha 251842c63927fc4af63bdc61989bbfbf3823c679

tcp rack: improve initialisation of retransmit timeout When the TCP is in the front states, don't take the slop variable into account. This improves consistency with the base stack. Reviewed by: rrs@ Differential Revision: https://reviews.freebsd.org/D30230 MFC after: 1 week Sponsored by: Netflix, Inc.

view details

push time in 2 months

pull request commentruby/ruby

Fix clang 12 -Wcompound-token-split-by-macro warning in ruby.h

I see, so the PR itself is fine. We need a ticket for backport management anyway.

I submitted https://bugs.ruby-lang.org/issues/17865, but I am not able to edit the backports field. (I assume this is limited to administrators.)

DimitryAndric

comment created time in 2 months

pull request commentruby/ruby

Fix clang 12 -Wcompound-token-split-by-macro warning in ruby.h

Pull-requests must be to master.

Unfortunately this is not possible, because the code in master does not have the issue, it is very different.

E.g. in 6ecf07ab3538bfb74d298121ac0a1b2079b1d3fa (for pull request #2991) the symbol.h header got split off from the main ruby.h, and at the same time the code that emits the warning was removed. Later in 9e6e39c3512f7a962c44dc3729c98a0f8be90341 this got merged into master.

I will close this pull request, and we will solve the problems in FreeBSD ports with custom patches instead.

DimitryAndric

comment created time in 2 months

PR closed ruby/ruby

Fix clang 12 -Wcompound-token-split-by-macro warning in ruby.h

Building certain ruby gem native extensions (such as thrift, see here and here), with clang 12.0.0 or later fails, because they have -Werror in their CFLAGS, resulting in complaints about the expansion of the rb_intern() macro:

current directory: /wrkdirs/usr/ports/devel/rubygem-thrift/work/stage/usr/local/lib/ruby/gems/2.7/gems/thrift-0.14.0/ext
make "DESTDIR="
compiling binary_protocol_accelerated.c
binary_protocol_accelerated.c:404:68: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
  VALUE thrift_binary_protocol_class = rb_const_get(thrift_module, rb_intern("BinaryProtocol"));
                                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/ruby-2.7/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                      ^
binary_protocol_accelerated.c:404:68: note: '{' token is here
  VALUE thrift_binary_protocol_class = rb_const_get(thrift_module, rb_intern("BinaryProtocol"));
                                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/ruby-2.7/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/ruby-2.7/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    {                                                   \
    ^

Part of the rb_intern() macro expands to (RUBY_CONST_ID_CACHE((ID), (str))), and in turn RUBY_CONST_ID_CACHE() expands to a brace enclosed compound statement. The intended effect is to get a gcc statement expression, which is normally delimited by ({ ... }).

However, clang 12.0.0 and later have a warning enabled by default, about pasting together the ( and { tokens via different macros (see https://github.com/llvm/llvm-project/commit/0e00a95b4fad5e72851de012d3a0b2c2d01f8685).

To work around this warning:

  • Add RUBY_CONST_ID_CACHE_NB() (i.e. no-brace) which contains the code itself, without any braces
  • RUBY_CONST_ID_CACHE() which uses RUBY_CONST_ID_CACHE_NB(), but puts braces around it (so no existing code using this macro breaks)
  • Finally, change rb_intern() so the __extension__ directly creates a gcc statement expression, using the RUBY_CONST_ID_CACHE_NB() macro
+6 -4

3 comments

1 changed file

DimitryAndric

pr closed time in 2 months

pull request commentruby/ruby

Fix clang 12 -Wcompound-token-split-by-macro warning in ruby.h

Note, I'm going to submit similar patches for the FreeBSD ruby 2.6 and 2.7 ports. If this approach is OK with you, I will also submit a similar pull request for the ruby_2_6 branch.

Also, this fix does not apply to ruby 3.0, as the main ruby.h header has been split up into parts, and the rb_intern() macro now directly defines a gcc statement expression.

DimitryAndric

comment created time in 2 months

PR opened ruby/ruby

Fix clang 12 -Wcompound-token-split-by-macro warning in ruby.h

Building certain ruby gem native extensions (such as thrift, see here and here), with clang 12.0.0 or later fails, because they have -Werror in their CFLAGS, resulting in complaints about the expansion of the rb_intern() macro:

current directory: /wrkdirs/usr/ports/devel/rubygem-thrift/work/stage/usr/local/lib/ruby/gems/2.7/gems/thrift-0.14.0/ext
make "DESTDIR="
compiling binary_protocol_accelerated.c
binary_protocol_accelerated.c:404:68: error: '(' and '{' tokens introducing statement expression appear in different macro expansion contexts [-Werror,-Wcompound-token-split-by-macro]
  VALUE thrift_binary_protocol_class = rb_const_get(thrift_module, rb_intern("BinaryProtocol"));
                                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/ruby-2.7/ruby/ruby.h:1847:23: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                      ^
binary_protocol_accelerated.c:404:68: note: '{' token is here
  VALUE thrift_binary_protocol_class = rb_const_get(thrift_module, rb_intern("BinaryProtocol"));
                                                                   ^~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/ruby-2.7/ruby/ruby.h:1847:24: note: expanded from macro 'rb_intern'
        __extension__ (RUBY_CONST_ID_CACHE((ID), (str))) : \
                       ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/local/include/ruby-2.7/ruby/ruby.h:1832:5: note: expanded from macro 'RUBY_CONST_ID_CACHE'
    {                                                   \
    ^

Part of the rb_intern() macro expands to (RUBY_CONST_ID_CACHE((ID), (str))), and in turn RUBY_CONST_ID_CACHE() expands to a brace enclosed compound statement. The intended effect is to get a gcc statement expression, which is normally delimited by ({ ... }).

However, clang 12.0.0 and later have a warning enabled by default, about pasting together the ( and { tokens via different macros (see https://github.com/llvm/llvm-project/commit/0e00a95b4fad5e72851de012d3a0b2c2d01f8685).

To work around this warning:

  • Add RUBY_CONST_ID_CACHE_NB() (i.e. no-brace) which contains the code itself, without any braces
  • RUBY_CONST_ID_CACHE() which uses RUBY_CONST_ID_CACHE_NB(), but puts braces around it (so no existing code using this macro breaks)
  • Finally, change rb_intern() so the __extension__ directly creates a gcc statement expression, using the RUBY_CONST_ID_CACHE_NB() macro
+6 -4

0 comment

1 changed file

pr created time in 2 months