Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bizarre invalid selection / selection just gives up #336

Open
bcov77 opened this issue Feb 10, 2024 · 5 comments
Open

Bizarre invalid selection / selection just gives up #336

bcov77 opened this issue Feb 10, 2024 · 5 comments

Comments

@bcov77
Copy link

bcov77 commented Feb 10, 2024

Hi,

I'm been using pymol for a long time, using original PyMOL 1 and PyMOL 2 on El Capitan. I recently had to update my mac to Monterey, and now, pymol crashes in bizarre ways.

Here's a minimal test snippet that will crash for me (regardless of what protein is displayed (even none)):

for i in range(100):
    print(i)
    cmd.select("test", "name h") # note, it doesn't matter what you select here
    cmd.select("test", "test")  # I think this is the main line that causes the issue
    cmd.delete("test")

pymol.CmdException:  Error: Invalid selection name "test"

Notably, this doesn't crash on i == 0. It crashes on i == 11.

This snippet crashes in the gui (whether you 1-line it for the command prompt or put it in a script and call run) in both open source and closed source versions. I've tried both 2.5.7 and 2.5.8.

Once you get into this state. There's a broken selection called "test" that displays in the gui (and displays in cmd.get_names()), but clearly is broken because pymol throws an error when you click on the "A" button.
Screen Shot 2024-02-10 at 3 10 22 PM

I do not get this crash or the glitchy selection when running these snippets from the commandline (using ipython and import pymol). It also does not crash when running in my .pymolrc and launching the gui.

Debugging

This snippet does not crash:

for i in range(100):
    print(i)
    cmd.select("test", "name h")
    cmd.select("test", "test")
    cmd.delete("test")

    cmd.select("asdf", "name o")
    cmd.select("asdf")

Then, it gets weirder. If you run that bad line multiple times, you have to fix it multiple times.

A = 1
B = 1
for i in range(100):
    print(i)
    cmd.select("test", "name h")
    for j in range(A):
        cmd.select("test", "test")
    cmd.delete("test")

    cmd.select("asdf", "name o")
    for j in range(B):
        cmd.select("asdf")

Here's a table with the minimum values of B I could get this to NOT crash at for a given value of A. These values are the same in both the closed and open source versions.

   A   B
   1   1
   2   1
   3   3
   4   3
   5   5
   6   4
   7   4
   8   3
   9   2
  10   9
  11   8
  12   8
  13   7
  14   7
  15   0 # It just works?!?!?! Original snippet doesn't crash
# And from here on, it just works

But once you call that command 15 times, it just works. (i.e. if A is >= 15, B can be 0)

Anyways, I'm happy to help get this bug fixed. Or, please just tell me how to remove all traces of pymol from my computer so I can reinstall. I've tested with some other people and these bugs don't exist. I don't know what's wrong with my install.

@EvanKomp
Copy link

EvanKomp commented Jan 6, 2025

I am observing this too.

@bcov77
Copy link
Author

bcov77 commented Jan 6, 2025

It's not just me!

For reference this issue has never gone away, it just comes and goes sometimes.

@JarrettSJohnson
Copy link
Member

JarrettSJohnson commented Jan 6, 2025

@EvanKomp Are you also observing this only on Mac?

@pslacerda
Copy link
Contributor

In my case, I have an object named prot and another named lig. On some cases I can't select prot lig because it raises pymol.CmdException: Error: Invalid selection name "lig". The only workaround is to select * instead of prot lig what otherwise should be the same as they are the only objects as tell cmd.get_object_list.

@pslacerda
Copy link
Contributor

I'm using Fedora 39 with Python 3.10.16 and PyMOL 3.1.3.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants