# Crash when deleting atoms from pdb file

**URL:** <https://discuss.avogadro.cc/t/crash-when-deleting-atoms-from-pdb-file/7270>\
**Category:** Support\
**Created:** [January 6, 2026, 11:18pm UTC](https://discuss.avogadro.cc/t/crash-when-deleting-atoms-from-pdb-file/7270 "2026-01-06T23:18:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![myoung](https://discuss.avogadro.cc/letter_avatar_proxy/v4/letter/m/ad7895/32.png) [@myoung](https://discuss.avogadro.cc/u/myoung)\
**Post date:** [January 6, 2026, 11:18pm UTC](https://discuss.avogadro.cc/t/crash-when-deleting-atoms-from-pdb-file/7270/1 "2026-01-06T23:18:55Z")

</div>

Avogadro2 locks up when I use the selection tool or the drawing tool to delete some atoms in a pdb file. I see that this was an (old) issue in Avogadro1 that was addressed. Indeed when I try this in Avogadro1 there is no problem using either tool to delete atoms from the same file.

Bug?

---

<div class="post-metadata">

**Author:** ![ghutchis](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/ghutchis/32/456_2.png) [@ghutchis](https://discuss.avogadro.cc/u/ghutchis)\
**Post date:** [January 7, 2026, 12:21am UTC](https://discuss.avogadro.cc/t/crash-when-deleting-atoms-from-pdb-file/7270/2 "2026-01-07T00:21:37Z")

</div>

It should never “lock up” - can you be a bit clearer? A screenshot or screencast? Thanks

Having an example file would also help.

---

<div class="post-metadata">

**Author:** ![myoung](https://discuss.avogadro.cc/letter_avatar_proxy/v4/letter/m/ad7895/32.png) [@myoung](https://discuss.avogadro.cc/u/myoung)\
**Post date:** [January 7, 2026, 12:56am UTC](https://discuss.avogadro.cc/t/crash-when-deleting-atoms-from-pdb-file/7270/3 "2026-01-07T00:56:52Z")

</div>

Sorry I wasn’t more clear. Avogadro2 simply stopped responding as evidenced by the spinning cursor and the status in Activity Monitor. This was with either the current version or the nightly build (from a week or two ago). This is on MacOS Sequoia fully up to date. Example pdb file attached.

Thanks for your time.

[example.pdb](https://discuss.avogadro.cc/uploads/short-url/g9idwsqAky9a6r5EamP5QAOyIq7.pdb) (8.8 KB)

---

<div class="post-metadata">

**Author:** ![ghutchis](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/ghutchis/32/456_2.png) [@ghutchis](https://discuss.avogadro.cc/u/ghutchis)\
**Post date:** [January 7, 2026, 1:09am UTC](https://discuss.avogadro.cc/t/crash-when-deleting-atoms-from-pdb-file/7270/4 "2026-01-07T01:09:49Z")

</div>

Okay, I’ll give it a look. If it stopped responding on the Mac, that’s pretty easy for me to debug if I can reproduce it

---

<div class="post-metadata">

**Author:** ![ghutchis](https://discuss.avogadro.cc/user_avatar/discuss.avogadro.cc/ghutchis/32/456_2.png) [@ghutchis](https://discuss.avogadro.cc/u/ghutchis)\
**Post date:** [January 16, 2026, 2:50pm UTC](https://discuss.avogadro.cc/t/crash-when-deleting-atoms-from-pdb-file/7270/5 "2026-01-16T14:50:30Z")

</div>

This set of patches should do it. I fixed the PDB example, then found another bug when trying to delete atoms from ORCA files. (Seems unlikely, but finally found the underlying bug.)

> <https://github.com/OpenChemistry/avogadrolibs/pull/2513>
>
> Bonds were added but with the same unique id
> 
> Developer Certificate of Origin
> …
> Version 1.1
> 
> Copyright (C) 2004, 2006 The Linux Foundation and its contributors.
> 1 Letterman Drive
> Suite D4700
> San Francisco, CA, 94129
> 
> Everyone is permitted to copy and distribute verbatim copies of this
> license document, but changing it is not allowed.
> 
> 
> Developer's Certificate of Origin 1.1
> 
> By making a contribution to this project, I certify that:
> 
> (a) The contribution was created in whole or in part by me and I
> have the right to submit it under the open source license
> indicated in the file; or
> 
> (b) The contribution is based upon previous work that, to the best
> of my knowledge, is covered under an appropriate open source
> license and I have the right under that license to submit that
> work with modifications, whether created in whole or in part
> by me, under the same open source license (unless I am
> permitted to submit under a different license), as indicated
> in the file; or
> 
> (c) The contribution was provided directly to me by some other
> person who certified (a), (b) or (c) and I have not modified
> it.
> 
> (d) I understand and agree that this project and the contribution
> are public and that a record of the contribution (including all
> personal information I submit with it, including my sign-off) is
> maintained indefinitely and may be redistributed consistent with
> this project or the open source license(s) involved.
> 
> 
> 
> \## Summary by CodeRabbit
> 
> \* \*\*Refactor\*\*
> \* Improved internal atom and bond identifier management systems for enhanced consistency.
> \* Optimized method dispatch mechanisms for atom operations.
> 
> \<sub\>✏️ Tip: You can customize this high-level summary in your review settings.\</sub\>

---

<div class="post-metadata">

**Author:** ![myoung](https://discuss.avogadro.cc/letter_avatar_proxy/v4/letter/m/ad7895/32.png) [@myoung](https://discuss.avogadro.cc/u/myoung)\
**Post date:** [January 17, 2026, 5:35am UTC](https://discuss.avogadro.cc/t/crash-when-deleting-atoms-from-pdb-file/7270/6 "2026-01-17T05:35:49Z")

</div>

Awesome. Thanks for addressing this.
