|
From: Wilfried G. <dot...@ci...> - 2015-12-07 11:56:31
|
Hi Everyone, Duplicating the discussion from the V8 user group: > > >https://groups.google.com/forum/#!topic/v8-users/qRorKvYNq24 On Fri, Dec >4, 2015 at 3:26 PM, Wilfried Gösgens <doth...@gmailcom> wrote: >> Hi everyone >> Using the regular d8 shell: >> >> # ./d8 >> V8 version 4.8.271.5 >> d8> Math.pow(0, 0.1); >> 0 >> d8> >> >> gives proper results. >> But using d8 in valgrind gives: >> >> /usr/bin/valgrind.bin --log-file=/tmp/valgrindlog.%p >> --show-reachable=yes --leak-check=full ./d8 >> Math.pow(0, 0.1); >> V8 version 4.8.271.5 >> d8> NaN >> d8> >> >> Is this a bug in V8 or in Valgrind? > > > > > >I can reproduce what you describe and it doesn't go away when you pass >--smc-check=all to Valgrind or --nofast_math to V8. > >I'm inclined to suspect Valgrind but I'm honestly not sure. `pow(0, >0.1)` from C code or a Perl script doesn't exhibit the same behavior. >Those may not be issuing the same instructions, of course. d8 is the sample shell provided by the V8 project for testing the V8 javascript engine. It will be built alongside the V8 engine: https://developers.google.com/v8/build?hl=en Does valgrind replace mathematical functions? Cheers, Willi |