# Filling a 3 dimensional array of histograms

**URL:** <https://root-forum.cern.ch/t/filling-a-3-dimensional-array-of-histograms/28089>\
**Category:** ROOT\
**Created:** [February 26, 2018, 6:02pm UTC](https://root-forum.cern.ch/t/filling-a-3-dimensional-array-of-histograms/28089 "2018-02-26T18:02:48Z")\
**Posts on this page:** 1\
**Showing post:** 4

<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 26, 2018, 6:19pm UTC](https://root-forum.cern.ch/t/filling-a-3-dimensional-array-of-histograms/28089/4 "2018-02-26T18:19:18Z")

</div>

The easiest thing could be to add (right before the line which fails):

```auto
std::cout << a << " " << p << " " << m << std::endl;

```

Try also:

> [@Segmentation Fault depending on linux distribution](https://root-forum.cern.ch/t/segmentation-fault-depending-on-linux-distribution/18020/6):
>
> 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 'YourMacro.cxx[++g][(Any, Parameters, You, Need)]' valgrind --tool=exp-sgcheck [--num-callers=50] [--vgdb=full] --suppressions=`root-config…

and:

> [@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/filling-a-3-dimensional-array-of-histograms/28089)._
