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

Failed test '$! is ENOENT for a readlink(undef)' (freebsd 13 + 14 only?) #63

Closed
eserte opened this issue Jan 1, 2022 · 3 comments
Closed
Labels
bug Something isn't working os-deviance

Comments

@eserte
Copy link

eserte commented Jan 1, 2022

On some of my smokers (freebsd 13 + 14 with zfs) t/readlink.t fails like this:

# Failed test '$! is ENOENT for a readlink(undef)'
# at t/readlink.t line 52.
# +-----+----+-------+
# | GOT | OP | CHECK |
# +-----+----+-------+
# | 22  | eq | 2     |
# +-----+----+-------+

# Failed test '$! is ENOENT for a readlink(undef)'
# at t/readlink.t line 58.
# +-----+----+-------+
# | GOT | OP | CHECK |
# +-----+----+-------+
# | 22  | eq | 2     |
# +-----+----+-------+
# Seeded srand with seed '20211227' from local date.
t/readlink.t ............ 
Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/32 subtests 

The problem can be reproduced with a oneliner:

$ perl -e 'readlink(undef); warn "$!"'
Invalid argument at -e line 1.

On freebsd 12 and older (and linux systems) it looks differently:

$ perl -e 'readlink(undef); warn "$!"'
No such file or directory at -e line 1.
@xsawyerx xsawyerx added the bug Something isn't working label Jan 9, 2022
xsawyerx added a commit to xsawyerx/Test-MockFile that referenced this issue Feb 9, 2022
xsawyerx added a commit to xsawyerx/Test-MockFile that referenced this issue Feb 10, 2022
toddr pushed a commit that referenced this issue Feb 10, 2022
toddr pushed a commit that referenced this issue Feb 10, 2022
@toddr
Copy link
Member

toddr commented Feb 10, 2022

We think this is fixed on 0.027

@toddr toddr closed this as completed Feb 10, 2022
@eserte
Copy link
Author

eserte commented Feb 19, 2022

Well, now it fails for my non-zfs freebsd smokers the other way around:

# Failed test '$! is EINVAL for a readlink(undef)'
# at t/readlink.t line 52.
# +-----+----+-------+
# | GOT | OP | CHECK |
# +-----+----+-------+
# | 2   | eq | 22    |
# +-----+----+-------+

# Failed test '$! is EINVAL for a readlink(undef)'
# at t/readlink.t line 63.
# +-----+----+-------+
# | GOT | OP | CHECK |
# +-----+----+-------+
# | 2   | eq | 22    |
# +-----+----+-------+
# Seeded srand with seed '20220217' from local date.
t/readlink.t ...................... 
Dubious, test returned 2 (wstat 512, 0x200)
Failed 2/32 subtests 

So the difference is zfs, not freebsd in general.

@eserte
Copy link
Author

eserte commented Mar 19, 2022

Well, actually it's not zfs that makes the difference, but different FreeBSD versions. Following truss log snippets while running readlink.t:

  • FreeBSD 12:
38819: 0.984243129 0.000011053 readlink("",0x7fffffffe2c0,1023) ERR#2 'No such file or directory'
  • FreeBSD 14:
23719: 0.355629434 0.000008947 readlink("",0x820e3bef0,1023) ERR#22 'Invalid argument'

Probably it's easiest to accept both, EINVAL and ENOENT here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working os-deviance
Development

No branches or pull requests

3 participants