Segmentation fault after removing and adding thousands of Linesets
- Dominant language
- C++
- Stars
- 14k
- Forks
- 2.6k
- Avg merge
- 5d 18h
- Merged PRs (30d)
- 6
Description
### Checklist
- [X] I have searched for [similar issues](https://github.com/isl-org/Open3D/issues).
- [X] For Python issues, I have tested with the [latest development wheel](http://www.open3d.org/docs/latest/getting_started.html#development-version-pip).
- [X] I have checked the [release documentation](http://www.open3d.org/docs/release/) and the [latest documentation](http://www.open3d.org/docs/latest/) (for `master` branch).
### Describe the issue
I adapted the C++ GUI visualizer [example](https://github.com/isl-org/Open3D/blob/master/examples/cpp/DenseSLAMGUI.cpp) to display objects within a large environment from a sequence of RGB-D images. For each image, my algorithm:
1. Identifies 100-300 new objects. Each object is represented by ```geometry::LineSet```.
2. Removes 100-300 objects (```LineSet```) from the GUI with ```this->widget3d_->GetScene()->RemoveGeometry()```.
3. Add these new objects (```LineSet```) with ```this->widget3d_->GetScene()->AddGeometry()``` into the GUI for display.
### Steps to reproduce the bug
```python
# See the outline of the algorithm above.
```
### Error message
After 100-200 images, "rainbow strips" appears in the GUI before it crashes with the message ```Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)```. Sometimes, I also received a Open3D warning ```Resource [VertexBuffer, 7, hash: 786439] not found``` before the crash. I noticed that the GUI will crash at the same image frame index on different machines for both CUDA and non-CUDA builds. The GUI always crashes sooner if the number of objects increases.
I noticed that the issue #4634 similar to mine was discovered recently. Please let me know how I can resolve this issue. Thanks!
### Expected behavior
_No response_
### Open3D, Python and System information
```markdown
- Operating system: Ubuntu 20.04
- Open3D version: 0.15.1
- System architecture: x86
- Is this a remote workstation?: no
- How did you install Open3D?: build from source
- Compiler version (if built from source): gcc 8
```
### Additional information
_No response_
Contributor guide
No contributing guide indexed for this repository
Assessment
This issue has not been assessed yet.