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

SMem fixes #374

Merged
merged 2 commits into from
Aug 24, 2023
Merged

SMem fixes #374

merged 2 commits into from
Aug 24, 2023

Conversation

garfieldnate
Copy link
Collaborator

@garfieldnate garfieldnate commented Aug 23, 2023

2 fixes related to connecting the smem DB:

  • Refuse to try to export the smem DB if it's not currently connected. Fixes a segfault (load Soar and do smem -x foo.log to replicate).
  • Connect the DB when a user does smem --init. This allows users to put smem --init and smem --clear first thing in their project sources without any errors.

Fixes #370.

Harden the logic for exporting smem to prevent segfaults. Previously we had a
segfault with just `smem -x file.soar` because the smem DB is not connected.
Adding an LTI option, however, would connect to the DB first. Change it so that
export (as with backup) requires connecting to the DB first, and gracefully
returns false if not connected.
Previously a simple

smem --init
smem --clear

at the beginning of a source file would fail and prevent the rest of the file
from sourcing. Connect to the DB in the init CLI command so that any following
actions can access the DB. I believe this is the intuitive behavior, and I don't
see anything in the manual that would indicate that this incorrect.
@garfieldnate garfieldnate merged commit 29fc5ce into development Aug 24, 2023
6 checks passed
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

Successfully merging this pull request may close these issues.

smem --clear throws error if run first thing
1 participant