DynamoRIO/drmemory

Floating point result differs after throwing an exception

Open

#2,117 创建于 2018年8月31日

在 GitHub 查看
 (2 评论) (0 反应) (0 负责人)C (289 fork)auto 404
Bug-AppFailOpSys-Windowshelp wanted

仓库指标

Star
 (2,727 star)
PR 合并指标
 (PR 指标待抓取)

描述

The following little program (compiled with VS2008) shows, that the result of floating point calculation differs after throwing an exception running under drmemory version 1.11.*, with version 1.8.0 the result is ok:

#include <iostream>

int main()
{
   short sRc    = 2;
   double dTest = 0.0175;
   printf("result before exception: %19.17f\n",1./(1.+dTest));
   try
   {
      if (sRc!=0)
         throw std::invalid_argument("Test");
   }
   catch (std::invalid_argument &)
   {
      printf("result after  exception: %19.17f\n",1./(1.+dTest));
      return 0;
   }
}
>C:\old\DrMemory\bin\drmemory.exe   -batch -- buctr
~~Dr.M~~ Dr. Memory version 1.11.17622
~~Dr.M~~ Running "buctr"
result before exception: 0.98280098280098271
result after  exception: 0.98280098280098283
~~Dr.M~~
~~Dr.M~~ NO ERRORS FOUND:
~~Dr.M~~       0 unique,     0 total unaddressable access(es)
~~Dr.M~~       0 unique,     0 total uninitialized access(es)
~~Dr.M~~       0 unique,     0 total invalid heap argument(s)
~~Dr.M~~       0 unique,     0 total GDI usage error(s)
~~Dr.M~~       0 unique,     0 total handle leak(s)
~~Dr.M~~       0 unique,     0 total warning(s)
~~Dr.M~~       0 unique,     0 total,      0 byte(s) of leak(s)
~~Dr.M~~       0 unique,     0 total,      0 byte(s) of possible leak(s)
~~Dr.M~~ ERRORS IGNORED:
~~Dr.M~~       2 unique,     2 total,   4110 byte(s) of still-reachable allocation(s)
~~Dr.M~~          (re-run with "-show_reachable" for details)
~~Dr.M~~ Details: C:\old\DrMemory\drmemory\logs\DrMemory-buctr.exe.16964.000\results.txt

>C:\old\DrMemory\bin\drmemory.exe   -batch -- buctr.exe
~~Dr.M~~ Dr. Memory version 1.8.0
~~Dr.M~~ Running "h:\nix\buctr.exe"
result before exception: 0.98280098280098271
result after  exception: 0.98280098280098271
~~Dr.M~~
~~Dr.M~~ NO ERRORS FOUND:
~~Dr.M~~       0 unique,     0 total unaddressable access(es)
~~Dr.M~~       0 unique,     0 total uninitialized access(es)
~~Dr.M~~       0 unique,     0 total invalid heap argument(s)
~~Dr.M~~       0 unique,     0 total GDI usage error(s)
~~Dr.M~~       0 unique,     0 total handle leak(s)
~~Dr.M~~       0 unique,     0 total warning(s)
~~Dr.M~~       0 unique,     0 total,      0 byte(s) of leak(s)
~~Dr.M~~       0 unique,     0 total,      0 byte(s) of possible leak(s)
~~Dr.M~~ ERRORS IGNORED:
~~Dr.M~~       0 unique,     0 total,      0 byte(s) of still-reachable allocation(s)
~~Dr.M~~          (re-run with "-show_reachable" for details)
~~Dr.M~~ Details: C:\old\DrMemory\drmemory\logs\DrMemory-buctr.exe.7032.015\results.txt

贡献者指南