# Random memory conflict when smart pointer is assigned to smart pointer

**URL:** https://discourse.vtk.org/t/random-memory-conflict-when-smart-pointer-is-assigned-to-smart-pointer/10749
**Category:** Support
**Tags:** code
**Created:** [February 22, 2023, 2:49am UTC](https://discourse.vtk.org/t/random-memory-conflict-when-smart-pointer-is-assigned-to-smart-pointer/10749 "2023-02-22T02:49:03Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![marlon.ma](https://discourse.vtk.org/user_avatar/discourse.vtk.org/marlon.ma/32/6091_2.png) [@marlon.ma](https://discourse.vtk.org/u/marlon.ma)
#### Post date: [February 22, 2023, 2:49am UTC](https://discourse.vtk.org/t/random-memory-conflict-when-smart-pointer-is-assigned-to-smart-pointer/10749/1 "2023-02-22T02:49:03Z")

</div>

I use smart pointers when transferring data between different classes, but there is a memory conflict when assigning values, and this error is random.

---

<div class="post-metadata">

### Author: ![danlipsa](https://discourse.vtk.org/user_avatar/discourse.vtk.org/danlipsa/32/390_2.png) [@danlipsa](https://discourse.vtk.org/u/danlipsa)
#### Post date: [February 22, 2023, 2:00pm UTC](https://discourse.vtk.org/t/random-memory-conflict-when-smart-pointer-is-assigned-to-smart-pointer/10749/2 "2023-02-22T14:00:33Z")

</div>

I suspect there is a buffer override somewhere in the code. Try using valgrind to track that down.

---

<div class="post-metadata">

### Author: ![marlon.ma](https://discourse.vtk.org/user_avatar/discourse.vtk.org/marlon.ma/32/6091_2.png) [@marlon.ma](https://discourse.vtk.org/u/marlon.ma)
#### Post date: [February 23, 2023, 1:11am UTC](https://discourse.vtk.org/t/random-memory-conflict-when-smart-pointer-is-assigned-to-smart-pointer/10749/3 "2023-02-23T01:11:48Z")

</div>

thank you ，Because I generated a dangling pointer by mistake

---

<div class="post-metadata">

### Author: ![ben.boeckel](https://discourse.vtk.org/letter_avatar_proxy/v4/letter/b/ea5d25/32.png) [@ben.boeckel](https://discourse.vtk.org/u/ben.boeckel)
#### Post date: [February 24, 2023, 1:05am UTC](https://discourse.vtk.org/t/random-memory-conflict-when-smart-pointer-is-assigned-to-smart-pointer/10749/4 "2023-02-24T01:05:46Z")

</div>

@Yohann_Bearzi
