Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Stray debug printf on FreeBSD #14286

Closed
dfr opened this issue Dec 13, 2022 · 0 comments · Fixed by #14287
Closed

Stray debug printf on FreeBSD #14286

dfr opened this issue Dec 13, 2022 · 0 comments · Fixed by #14287
Labels
Type: Defect Incorrect behavior (e.g. crash, hang)

Comments

@dfr
Copy link
Contributor

dfr commented Dec 13, 2022

System information

Type Version/Name
Distribution Name FreeBSD
Distribution Version 13.1-RELEASE-p5
Kernel Version 13.1-RELEASE-p3
Architecture amd64
OpenZFS Version zfs-2.1.4-FreeBSD_g52bad4f23

Describe the problem you're observing

While working on porting podman and buildah to FreeBSD, I have noticed many messages logged on the console that look like this:

len 4 vecnum: 126 sizeof (zfs_cmd_t) 4528

After debugging this, I discovered that this happens when something tries to set non-blocking i/o on a /dev/zfs filedescriptor which translates to a FIONBIO ioctl.

The zfs storage layer in for buildah and podman tries to detect whether zfs is available by opening /dev/zfs. The golang runtime libraries unconditionally try to set the descriptor into non-blocking mode causing the error message.

I can work around this in containers/storage but it seems to me that the FreeBSD ZFS port should not print this message to console but instead return a suitable error. Currently it returns EINVAL after the printf which seems reasonable.

Describe how to reproduce the problem

On FreeBSD-13.1 or later, install the buildah package and run:

# buildah from quay.io/dougrabson/freebsd-minimal:13

On the system console, the len 4 vecnum... message quoted above appears.

Include any warning/errors/backtraces from the system logs

len 4 vecnum: 126 sizeof (zfs_cmd_t) 4528
@dfr dfr added the Type: Defect Incorrect behavior (e.g. crash, hang) label Dec 13, 2022
dfr added a commit to dfr/zfs that referenced this issue Dec 13, 2022
Fixes openzfs#14286.

Signed-off-by: Doug Rabson <dfr@rabson.org>
dfr added a commit to dfr/storage that referenced this issue Dec 13, 2022
The alternative os.OpenFile internally tries to enable non-blocking i/o
on the descriptor which on FreeBSD has the side effect of printing a
cryptic error message on the console
(openzfs/zfs#14286).

Signed-off-by: Doug Rabson <dfr@rabson.org>
dfr added a commit to dfr/zfs that referenced this issue Dec 13, 2022
Fixes openzfs#14286.

Signed-off-by: Doug Rabson <dfr@rabson.org>
behlendorf pushed a commit that referenced this issue Dec 14, 2022
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Signed-off-by: Doug Rabson <dfr@rabson.org>
Closes #14286 
Closes #14287
andrewc12 pushed a commit to andrewc12/openzfs that referenced this issue Dec 18, 2022
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Signed-off-by: Doug Rabson <dfr@rabson.org>
Closes openzfs#14286 
Closes openzfs#14287
tonyhutter pushed a commit to tonyhutter/zfs that referenced this issue Jan 13, 2023
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Signed-off-by: Doug Rabson <dfr@rabson.org>
Closes openzfs#14286
Closes openzfs#14287
tonyhutter pushed a commit to tonyhutter/zfs that referenced this issue Jan 18, 2023
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Signed-off-by: Doug Rabson <dfr@rabson.org>
Closes openzfs#14286
Closes openzfs#14287
tonyhutter pushed a commit to tonyhutter/zfs that referenced this issue Jan 19, 2023
Reviewed-by: Ryan Moeller <ryan@iXsystems.com>
Reviewed-by: Alexander Motin <mav@FreeBSD.org>
Reviewed-by: Richard Yao <richard.yao@alumni.stonybrook.edu>
Signed-off-by: Doug Rabson <dfr@rabson.org>
Closes openzfs#14286
Closes openzfs#14287
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Defect Incorrect behavior (e.g. crash, hang)
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant