A
a.grushin
Hello, all
a have a program which is used Digest::SHA256.hexdigest, but it is failing on a few machines with 'Illegal instruction' error:
$ ruby -v
ruby 1.8.7 (2012-10-12 patchlevel 371) [x86_64-linux]
$ irb
irb(main):001:0> require 'digest/sha1'
=> true
irb(main):002:0> puts Digest::SHA256.hexdigest("123")
Illegal instruction
Perhaps something wrong with packages, but I'm not sure how to find the root cause.
brokenbox # strace ruby 1.rb
[...]
stat("/usr/lib64/site_ruby/digest.so", 0x7fff5e3bc9b0) = -1 ENOENT (No such file or directory)
stat("/usr/lib/ruby/1.8/digest.rb", {st_mode=S_IFREG|0644, st_size=1145, ...}) = 0
open("/usr/lib/ruby/1.8/digest.rb", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=1145, ...}) = 0
close(3) = 0
--- SIGILL (Illegal instruction) @ 0 (0) ---
+++ killed by SIGILL +++
strace on the good box show following:
goodbox # strace ruby 1.rb
[...]
stat("/usr/lib64/site_ruby/digest.so", 0x7fffa8dc2860) = -1 ENOENT (No such file or directory)
stat("/usr/lib/ruby/1.8/digest.rb", {st_mode=S_IFREG|0644, st_size=1145, ...}) = 0
open("/usr/lib/ruby/1.8/digest.rb", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=1145, ...}) = 0
close(3) = 0
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fe9a0d8f000
write(1, "a665a45920422f9d417e4867efdc4fb8"..., 65a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3
) = 65
rt_sigaction(SIGINT, {SIG_DFL, [INT], SA_RESTORER|SA_RESTART, 0x7fe99fa2c900}, {0x7fe9a0902910, [], SA_RESTORER, 0x7fe9a06604a0}, 8) = 0
exit_group(0) = ?
Could anybody help me with advice how to investigate this issue?
This can be solved with a simple recreating those hosts, but this is interesting to find the reason.
Thanks!
a have a program which is used Digest::SHA256.hexdigest, but it is failing on a few machines with 'Illegal instruction' error:
$ ruby -v
ruby 1.8.7 (2012-10-12 patchlevel 371) [x86_64-linux]
$ irb
irb(main):001:0> require 'digest/sha1'
=> true
irb(main):002:0> puts Digest::SHA256.hexdigest("123")
Illegal instruction
Perhaps something wrong with packages, but I'm not sure how to find the root cause.
brokenbox # strace ruby 1.rb
[...]
stat("/usr/lib64/site_ruby/digest.so", 0x7fff5e3bc9b0) = -1 ENOENT (No such file or directory)
stat("/usr/lib/ruby/1.8/digest.rb", {st_mode=S_IFREG|0644, st_size=1145, ...}) = 0
open("/usr/lib/ruby/1.8/digest.rb", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=1145, ...}) = 0
close(3) = 0
--- SIGILL (Illegal instruction) @ 0 (0) ---
+++ killed by SIGILL +++
strace on the good box show following:
goodbox # strace ruby 1.rb
[...]
stat("/usr/lib64/site_ruby/digest.so", 0x7fffa8dc2860) = -1 ENOENT (No such file or directory)
stat("/usr/lib/ruby/1.8/digest.rb", {st_mode=S_IFREG|0644, st_size=1145, ...}) = 0
open("/usr/lib/ruby/1.8/digest.rb", O_RDONLY) = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=1145, ...}) = 0
close(3) = 0
fstat(1, {st_mode=S_IFCHR|0620, st_rdev=makedev(136, 0), ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7fe9a0d8f000
write(1, "a665a45920422f9d417e4867efdc4fb8"..., 65a665a45920422f9d417e4867efdc4fb8a04a1f3fff1fa07e998e86f7f7a27ae3
) = 65
rt_sigaction(SIGINT, {SIG_DFL, [INT], SA_RESTORER|SA_RESTART, 0x7fe99fa2c900}, {0x7fe9a0902910, [], SA_RESTORER, 0x7fe9a06604a0}, 8) = 0
exit_group(0) = ?
Could anybody help me with advice how to investigate this issue?
This can be solved with a simple recreating those hosts, but this is interesting to find the reason.
Thanks!