Skip to content

Segfault from calling PythonSlashCommand in init.csh #20

Description

@kivkiv12345

Using PyCSH as an APM with an init.csh file containing the following:

apm load -f libcsh_pycsh.cpython-310-x86_64-linux-gnu.so
py run pyapm  # <-- Any APM with a slash command
slash_typehints2 --bol=true  # <-- Any PythonSlashCommand command, from the APM above

Will in a segfault:

csh: ../src/slash_command/python_slash_command.c:393: SlashCommand_func: Assertion `command != NULL' failed.
Aborted (core dumped)

(Line number (395) may not be exact, I've been debugging)

My immediate thought was that this is a race condition. But so far all relevant initialization has shown itself to be synchronous. Calling Py_IsInitialized() before the assertion returns 1. I also believe Py_Initialize() to be synchronous, so this makes sense.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions