# Optional return function

**URL:** <https://root-forum.cern.ch/t/optional-return-function/28100>\
**Category:** ROOT\
**Created:** [February 27, 2018, 12:27pm UTC](https://root-forum.cern.ch/t/optional-return-function/28100 "2018-02-27T12:27:24Z")\
**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:** [February 27, 2018, 1:28pm UTC](https://root-forum.cern.ch/t/optional-return-function/28100/2 "2018-02-27T13:28:01Z")

</div>

> [@Random crash when using root6 and ublas](https://root-forum.cern.ch/t/random-crash-when-using-root6-and-ublas/28088/2):
>
> 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): 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 'covariance\_linear\_interpolation.C++g("ENDF\_B-VII\_1\_reduced.dat", -3, 0, 1000, 0)' valgrind --tool=exp-sgcheck [--num-callers=50] [--vgdb=…

In your “covariance\_lib.cc”, at least:

```auto
  for(int i = 0; i < size_USER; i++) {
    boo = true;
    for (int j = 0; j < size_EVAL; j++) {

```

BTW. “Invalid read of size 4/8”, when related to a “float” or “int” or “double” or “long int” array, usually means that you are trying to access array’s element with an improper index (e.g. beyond the end of the array).

---

_[View the full topic](https://root-forum.cern.ch/t/optional-return-function/28100)._
