keystats read failed: invalid arguments

20 views
Skip to first unread message

zen...@gmail.com

unread,
Apr 10, 2018, 7:22:30 PM4/10/18
to uthash
I ran make in the tests directory after setting CC=gcc (using MinGW) and everything was successful. However, "perl keystats -v file.keys" on the file generated by HASH_EMIT_KEYS=2 is giving me "read failed: invalid arguments" errors, and the resulting table is all zeroes. I changed the printf's to determine it came from the read following the readmore2 label. Any ideas for a resolution?

Thanks,
-Erin

Arthur O'Dwyer

unread,
Apr 10, 2018, 7:39:15 PM4/10/18
to uth...@googlegroups.com
On Tue, Apr 10, 2018 at 3:38 PM, <zen...@gmail.com> wrote:
I ran make in the tests directory after setting CC=gcc (using MinGW) and everything was successful.  However, "perl keystats -v file.keys" on the file generated by HASH_EMIT_KEYS=2 is giving me "read failed: invalid arguments" errors, and the resulting table is all zeroes.  I changed the printf's to determine it came from the read following the readmore2 label.  Any ideas for a resolution?

Can you post a complete, runnable example of how you got to the error message?  Start with "CC=gcc make"... and then what did you do next? ...and after that?
I should be able to cut and paste your answer into my terminal window.

–Arthur

zen...@gmail.com

unread,
Apr 11, 2018, 12:34:19 PM4/11/18
to uthash
cd tests (from uthash-master)
vim Makefile (to uncomment CC line and make it equal to gcc)
make (which is successful and runs tests automatically)
perl keystats file.keys

read failed: Invalid argument
read failed: Invalid argument
read failed: Invalid argument
read failed: Invalid argument
read failed: Invalid argument
read failed: Invalid argument
read failed: Invalid argument
fcn ideal% #items #buckets dup% fl add_usec find_usec del-all usec
--- ------ ---------- ---------- ----- -- ---------- ---------- ------------
JEN 0.0% 0 0 0% 0 0 0
BER 0.0% 0 0 0% 0 0 0
SFH 0.0% 0 0 0% 0 0 0
SAX 0.0% 0 0 0% 0 0 0
OAT 0.0% 0 0 0% 0 0 0
MUR 0.0% 0 0 0% 0 0 0
FNV 0.0% 0 0 0% 0 0 0

With verbose on, following each Invalid argument, it does seem to find something and prints out:

max key length: 4054253568
number unique keys: 141
keystats memory: 419120768
Buckets with 0 items: 0.0%
Buckets with < 5 items: 59.4%
Buckets with < 10 items: 40.6%
Buckets with < 20 items: 0.0%
Buckets with < 100 items: 0.0%
Buckets with > 100 items: 0.0%

Of course, with different percentages for each hash function type. That said, 141 seems very low. My key is a uint64_t.

Arthur O'Dwyer

unread,
Apr 11, 2018, 12:36:28 PM4/11/18
to uth...@googlegroups.com
Strange. I get this output:

open failed file.keys: No such file or directory

open failed file.keys: No such file or directory

open failed file.keys: No such file or directory

open failed file.keys: No such file or directory

open failed file.keys: No such file or directory

open failed file.keys: No such file or directory

open failed file.keys: No such file or directory

fcn  ideal%     #items   #buckets  dup%  fl   add_usec  find_usec  del-all usec

---  ------ ---------- ---------- -----  -- ---------- ----------  ------------


The file "file.keys" doesn't seem to exist, not even after running "make".

–Arthur



--
You received this message because you are subscribed to the Google Groups "uthash" group.
To unsubscribe from this group and stop receiving emails from it, send an email to uthash+unsubscribe@googlegroups.com.
To post to this group, send email to uth...@googlegroups.com.
Visit this group at https://groups.google.com/group/uthash.
For more options, visit https://groups.google.com/d/optout.

zen...@gmail.com

unread,
Apr 11, 2018, 4:16:56 PM4/11/18
to uthash
Hehe. That's because you don't have my file.keys. That's a step I won't be able to give you. You would have to create a program that used a uint64_t key, compile it with -DHASH_EMIT_KEYS=2 and redirect its stderr via 2> to file.key.

That's a lot to ask. Was mostly just hoping someone would have experienced this error before and be able to say "Ah yes, that's because...". For example, maybe a uint64_t key is too big?

Thank you,
-Erin

Arthur O'Dwyer

unread,
Apr 11, 2018, 4:19:50 PM4/11/18
to uth...@googlegroups.com
On Wed, Apr 11, 2018 at 1:16 PM, <zen...@gmail.com> wrote:
Hehe.  That's because you don't have my file.keys.  That's a step I won't be able to give you.  You would have to create a program that used a uint64_t key, compile it with -DHASH_EMIT_KEYS=2 and redirect its stderr via 2> to file.key.

Ah, well, if you can provide a complete, runnable example that I can paste into a terminal window, I'll look into it. Otherwise indeed you're pretty much dependent on someone piping up here. :)
Reply all
Reply to author
Forward
0 new messages