Skip to content

Singular interface (and possibly others) can lose synchronization due to GC #955

@sagetrac-cwitty

Description

@sagetrac-cwitty

I'm going to describe the problem in terms of the Singular interface, but I think probably at least some other interfaces are similarly vulnerable.

The bad sequence of events is:

  1. Some Singular computation is requested, by calling Singular.eval().

  2. Singular.eval() calls Expect.eval().

  3. Expect.eval() sends a command to Singular, to perform the requested computation.

  4. A Python garbage collection is triggered.

  5. One of the collected objects is a Singular wrapper object (of type SingularElement).

  6. Singular.clear() is called on this object.

  7. Singular.clear() calls Singular.eval() to kill the Singular variable corresponding to this object.

  8. Singular.eval() calls Expect.eval().

  9. Expect.eval() sends the kill command to Singular.

  10. Expect.eval() waits for a response from Singular. Unfortunately, the next response it sees from Singular is the response to the command sent in step 3), from the mathematical computation.

  11. Expect.eval() returns this response to Singular.eval().

  12. Singular.eval() returns this response to Singular.clear().

  13. Singular.clear() discards the response.

  14. Garbage collection completes.

  15. Expect.eval() waits for a response from Singular. Unfortunately, the next response it sees from Singular is the null response from the kill command.

  16. Expect.eval() returns this response to Singular.eval().

  17. Singular.eval() returns this null response as the result of the requested computation.

I'll attach two log files to this ticket; log7027 shows the interface working, and log7028 shows the interface failing because the print(sage10); command is interrupted by the command to kill sage7.

Component: interfaces

Issue created by migration from https://trac.sagemath.org/ticket/955

Metadata

Metadata

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    pFad - Phonifier reborn

    Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

    Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


    Alternative Proxies:

    Alternative Proxy

    pFad Proxy

    pFad v3 Proxy

    pFad v4 Proxy