From: Tanaka Akira Date: 2011-01-18T16:48:11+09:00 Subject: [ruby-dev:43062] sprintf("%f", 1e-7): Conditional jump or move depends on uninitialised value(s) 以下のように、sprintf("%f", 1e-7) に対し、valgrind が Conditional jump or move depends on uninitialised value(s) と出力します。 % valgrind ./ruby -ve 'sprintf("%f", 1e-7)' ==21019== Memcheck, a memory error detector. ==21019== Copyright (C) 2002-2007, and GNU GPL'd, by Julian Seward et al. ==21019== Using LibVEX rev 1854, a library for dynamic binary translation. ==21019== Copyright (C) 2004-2007, and GNU GPL'd, by OpenWorks LLP. ==21019== Using valgrind-3.3.1-Debian, a dynamic binary instrumentation framework. ==21019== Copyright (C) 2000-2007, and GNU GPL'd, by Julian Seward et al. ==21019== For more details, rerun with: -v ==21019== ruby 1.9.3dev (2011-01-18 trunk 30590) [i686-linux] ==21019== Conditional jump or move depends on uninitialised value(s) ==21019== at 0x80F5809: cvt (vsnprintf.c:1207) ==21019== by 0x80F3CF7: BSD_vfprintf (vsnprintf.c:848) ==21019== by 0x80F5AB0: ruby_snprintf (vsnprintf.c:1282) ==21019== by 0x80F2FC9: rb_str_format (sprintf.c:1062) ==21019== by 0x80EF60A: rb_f_sprintf (sprintf.c:437) ==21019== by 0x814E29F: call_cfunc (vm_insnhelper.c:316) ==21019== by 0x814E177: vm_call_cfunc (vm_insnhelper.c:403) ==21019== by 0x814D736: vm_call_method (vm_insnhelper.c:525) ==21019== by 0x81492AC: vm_exec_core (insns.def:1010) ==21019== by 0x8156606: vm_exec (vm.c:1150) ==21019== by 0x8156DDE: rb_iseq_eval_main (vm.c:1391) ==21019== by 0x805C258: ruby_exec_internal (eval.c:225) ==21019== ==21019== ERROR SUMMARY: 1 errors from 1 contexts (suppressed: 34 from 1) ==21019== malloc/free: in use at exit: 196,977 bytes in 7,215 blocks. ==21019== malloc/free: 62,425 allocs, 55,210 frees, 8,538,279 bytes allocated. ==21019== For counts of detected errors, rerun with: -v ==21019== searching for pointers to 7,215 not-freed blocks. ==21019== checked 532,380 bytes. ==21019== ==21019== LEAK SUMMARY: ==21019== definitely lost: 312 bytes in 6 blocks. ==21019== possibly lost: 0 bytes in 0 blocks. ==21019== still reachable: 196,665 bytes in 7,209 blocks. ==21019== suppressed: 0 bytes in 0 blocks. ==21019== Rerun with --leak-check=full to see details of leaked memory. -- [田中 哲][たなか あきら][Tanaka Akira]