# Minuit2 gives -nan results

**URL:** <https://root-forum.cern.ch/t/minuit2-gives-nan-results/28367>\
**Category:** ROOT\
**Created:** [March 20, 2018, 7:28am UTC](https://root-forum.cern.ch/t/minuit2-gives-nan-results/28367 "2018-03-20T07:28:49Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![Wile\_E\_Coyote](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/wile_e_coyote/32/12417_2.png) [@Wile\_E\_Coyote](https://root-forum.cern.ch/u/Wile_E_Coyote)\
**Post date:** [March 20, 2018, 7:46am UTC](https://root-forum.cern.ch/t/minuit2-gives-nan-results/28367/2 "2018-03-20T07:46:02Z")

</div>

Try something like (note: some [Valgrind](http://valgrind.org/) functionality requires that the source code, that you want to analyse, is compiled with debug symbols):

```auto
valgrind --tool=memcheck --leak-check=full [--show-reachable=yes] [--track-origins=yes] [--num-callers=50] [--vgdb=full] --suppressions=`root-config --etcdir`/valgrind-root.supp `root-config --bindir`/root.exe -l -q 'MLEM.cc++g'
valgrind --tool=exp-sgcheck [--num-callers=50] [--vgdb=full] --suppressions=`root-config --etcdir`/valgrind-root.supp `root-config --bindir`/root.exe -l -q 'MLEM.cc++g'

```

and especially carefully study messages that appear in the beginning of the output.  
(Note: the `--show-reachable=yes` option will give you too many warnings, I believe.)

BTW. The above [Valgrind](http://valgrind.org) commands include some `[something_optional]` options (if you want to use any of these options, REMOVE the “square brackets”).

See also:

> [@AddressSanitizer memory error detector](https://root-forum.cern.ch/t/addresssanitizer-memory-error-detector/21046):
>
> The default [valgrind’s “memcheck” memory error detector](http://valgrind.org/docs/manual/mc-manual.html) will not find various {stack,global}-buffer overflow bugs. [Valgrind](http://valgrind.org/) does provide a dedicated complementary [“exp-sgcheck” experimental stack and global array overrun detector](http://valgrind.org/docs/manual/sg-manual.html) but, for the time being, [it does not work, as soon as ROOT related libraries are used](https://root-forum.cern.ch/t/valgrind-tool-exp-sgcheck/21044) [and it seems that it is possible to use it](https://root-forum.cern.ch/t/valgrind-tool-exp-sgcheck/21044/2). On the other hand, gcc 4.8 and newer compilers provide their own [AddressSanitizer (a.k.a. ASan) fast memory error detector](https://github.com/google/sanitizers/wiki/AddressSanitizer) (note: you may n…

---

_[View the full topic](https://root-forum.cern.ch/t/minuit2-gives-nan-results/28367)._
