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

NameError: uninitialized constant Errno::ENOMEDIUM #5257

Closed
junaruga opened this issue Jul 20, 2018 · 7 comments
Closed

NameError: uninitialized constant Errno::ENOMEDIUM #5257

junaruga opened this issue Jul 20, 2018 · 7 comments

Comments

@junaruga
Copy link

junaruga commented Jul 20, 2018

Environment

Provide at least:

  • JRuby version (jruby -v) and command line (flags, JRUBY_OPTS, etc)
version: jruby 9.1.16.0
JRUBY_OPTS="--server -J-Xms512m -J-Xmx1024m"
  • Operating system and platform (e.g. uname -a)
Distributor ID:	Ubuntu
Description:	Ubuntu 14.04.5 LTS
Release:	14.04
Codename:	trusty

Other relevant info you may wish to add:

  • Installed or activated gems: mongo
  • Application/framework version (e.g. Rails, Sinatra): Nothing.
  • Environment variables

Expected Behavior

  • Describe your expectation of how JRuby should behave, perhaps by showing how CRuby/MRI behaves.
  • Provide an executable Ruby script or a link to an example repository.

Errno::ENOMEDIUM::Errno object exists.

Actual Behavior

raise SystemCallError.new('Test error', Errno::ENOMEDIUM::Errno)

I got NameError: uninitialized constant Errno::ENOMEDIUM
https://api.travis-ci.org/v3/job/406430973/log.txt

I did grep on HEAD of master branch. Then I could not find the implementation.

$ grep -r 'Errno::ENOMEDIUM' *
@junaruga
Copy link
Author

I compared the result of Errno.constants between Ruby 2.5.1 and JRuby 9.1.16.0 on my local environment (Fedora 28).

Ruby 2.5.1: https://gist.github.com/junaruga/9f455234c81cff7580b0ffd65085fb8d
JRuby 9.1.16.0: https://gist.github.com/junaruga/cbd781907d7c7b282f90d36b5cdd0ce7

Some of the Errno codes are not included in the JRuby.

@junaruga
Copy link
Author

$ diff ruby_2.5.1_errno_constants_sort.txt jruby_9.1.16_errno_constants_sort.txt 
5d4
< :EADV
9,10d7
< :EAUTH
< :EBADE
12d8
< :EBADFD
14,18d9
< :EBADR
< :EBADRPC
< :EBADRQC
< :EBADSLT
< :EBFONT
20,21d10
< :ECANCELED
< :ECAPMODE
23,24d11
< :ECHRNG
< :ECOMM
29d15
< :EDEADLOCK
32,33d17
< :EDOOFUS
< :EDOTDOT
38d21
< :EFTYPE
41d23
< :EHWPOISON
48d29
< :EIPSEC
51,64d31
< :EISNAM
< :EKEYEXPIRED
< :EKEYREJECTED
< :EKEYREVOKED
< :EL2HLT
< :EL2NSYNC
< :EL3HLT
< :EL3RST
< :ELIBACC
< :ELIBBAD
< :ELIBEXEC
< :ELIBMAX
< :ELIBSCN
< :ELNRNG
66d32
< :EMEDIUMTYPE
72,73d37
< :ENAVAIL
< :ENEEDAUTH
78,79d41
< :ENOANO
< :ENOATTR
81d42
< :ENOCSI
86d46
< :ENOKEY
89d48
< :ENOMEDIUM
92,93d50
< :ENONET
< :ENOPKG
100d56
< :ENOTCAPABLE
104,105d59
< :ENOTNAM
< :ENOTRECOVERABLE
107d60
< :ENOTSUP
109d61
< :ENOTUNIQ
113d64
< :EOWNERDEAD
117,120d67
< :EPROCLIM
< :EPROCUNAVAIL
< :EPROGMISMATCH
< :EPROGUNAVAIL
125d71
< :EREMCHG
127,129d72
< :EREMOTEIO
< :ERESTART
< :ERFKILL
131d73
< :ERPCMISMATCH
136d77
< :ESRMNT
138d78
< :ESTRPIPE
143,144d82
< :EUCLEAN
< :EUNATCH
148,149d85
< :EXFULL
< :NOERROR

@headius
Copy link
Member

headius commented Aug 16, 2018

The constants for Errno come from the https://github.com/jnr/jnr-constants project, and JRuby just generates from there. These additional constants should be added there with reasonable defaults and the files regenerated on supported platforms. Maybe you can help us there?

@junaruga
Copy link
Author

@headius Thanks for the information! As I usually do not use Java now, I would like to delegate someone for the help.

@ahorek
Copy link
Contributor

ahorek commented Aug 27, 2018

@headius I fixed this and some other missing parts https://github.com/jnr/jnr-constants/pulls

should I regenerate them too? If so, let me know.

@junaruga
Copy link
Author

@ahorek thank you for the working! 😃

@headius
Copy link
Member

headius commented Jul 23, 2020

I believe this was fixed by jnr/jnr-constants#46 which seems to be the last time we regenerated the Linux constants. That would have been included in JRuby 9.1.14.0 at least.

@headius headius closed this as completed Jul 23, 2020
@headius headius added this to the JRuby 9.1.14.0 milestone Jul 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants