Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #6845

Digest::SHA256.hexdigest failing with the digest/sha1

Newsgroups comp.lang.ruby
Date 2013-06-25 00:53 -0700
Message-ID <c2f0085d-848b-4ed7-a711-f1c8013fa424@googlegroups.com> (permalink)
Subject Digest::SHA256.hexdigest failing with the digest/sha1
From a.grushin@gmail.com

Show all headers | View raw


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!

Back to comp.lang.ruby | Previous | NextNext in thread | Find similar


Thread

Digest::SHA256.hexdigest failing with the digest/sha1 a.grushin@gmail.com - 2013-06-25 00:53 -0700
  Re: Digest::SHA256.hexdigest failing with the digest/sha1 Robert Klemme <shortcutter@googlemail.com> - 2013-06-25 02:47 -0700
    Re: Digest::SHA256.hexdigest failing with the digest/sha1 Julian Cromarty <julian.cromarty@gmail.com> - 2013-06-26 04:12 +0100

csiph-web