# Malloc, and corrupted size errors

**URL:** <https://discuss.pytorch.org/t/malloc-and-corrupted-size-errors/37080>\
**Category:** C++\
**Created:** [February 13, 2019, 10:40am UTC](https://discuss.pytorch.org/t/malloc-and-corrupted-size-errors/37080 "2019-02-13T10:40:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Felix\_Lessange](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/felix_lessange/32/8959_2.png) [@Felix\_Lessange](https://discuss.pytorch.org/u/Felix_Lessange)\
**Post date:** [February 13, 2019, 10:40am UTC](https://discuss.pytorch.org/t/malloc-and-corrupted-size-errors/37080/1 "2019-02-13T10:40:31Z")

</div>

Hi.  
I’m using pytorch in multi gpu setting, and also with some multiprocessing for loading and preprocessing and quite often encountering these errors, which I can’t manage to solve.

`malloc.c:4023: _int_malloc: Assertion (unsigned long) (size) >= (unsigned long) (nb)`  
`corrupted size vs. prev_size`

Theses appear very randomly too. I thought this was related to [https://github.com/pytorch/pytorch/issues/2507](https://github.com/pytorch/pytorch/issues/2507), but their solution didn’t work for me :

```auto
sudo apt-get install libtcmalloc-minimal4 
export LD_PRELOAD="/usr/lib/x86_64-linux-gnu/libtcmalloc_minimal.so.4" 

```

It seems that this error pops up really often when working with GroupNormalization. I can’t even do a whole epoch actually. I thought it might be due to the multiprocessed nature of my pipeline (I use torch.multiprocessing.Array to comunicate batches between processes), but the fact that the frequency depends on the architecture used is pretty weird to me.

Have you got any idea what might cause this ?

python 3.7  
torch 1.0.0

---

<div class="post-metadata">

**Author:** ![saransh\_karira](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/saransh_karira/32/6566_2.png) [@saransh\_karira](https://discuss.pytorch.org/u/saransh_karira)\
**Post date:** [August 11, 2020, 5:41am UTC](https://discuss.pytorch.org/t/malloc-and-corrupted-size-errors/37080/2 "2020-08-11T05:41:44Z")

</div>

Hey @Felix_Lessange ! Did you resolve it? If yes, then how??

---

<div class="post-metadata">

**Author:** ![Felix\_Lessange](https://discuss.pytorch.org/user_avatar/discuss.pytorch.org/felix_lessange/32/8959_2.png) [@Felix\_Lessange](https://discuss.pytorch.org/u/Felix_Lessange)\
**Post date:** [December 23, 2020, 9:47pm UTC](https://discuss.pytorch.org/t/malloc-and-corrupted-size-errors/37080/3 "2020-12-23T21:47:47Z")

</div>

Hey. Sorry for late reply. I never saw this in 2020. I’m guessing some silent driver / pytorch / kernel update ?
