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

Segfault on macOS #75

Open
HanyzPAPU opened this issue Oct 27, 2024 · 3 comments
Open

Segfault on macOS #75

HanyzPAPU opened this issue Oct 27, 2024 · 3 comments

Comments

@HanyzPAPU
Copy link
Collaborator

HanyzPAPU commented Oct 27, 2024

The clear_history() call in input.c:188 segfaults when msim is compiled on mac.

I found out that this is caused because instead of GNU Readline, macOS is distributed with BSD editline, which provides a mock implementation if the readline API.
There is one crucial difference: the editline mock does not call the using_history() (link) function and thus does not initialize the history state.

Adding the using_history() call to the initializer solves the issue.
An alternative solution would be to manually link msim with readline instead of relying on the system library.

@HanyzPAPU
Copy link
Collaborator Author

Would it be safe to call using_history() even with GNU Readline? The history would technically get initialized twice.

@vhotspur
Copy link
Member

Looking at the documentation and into the official examples I think we should call using_history ourselves and it is a bug to not call it.

Generally I would prefer if we would be able to work with the editline to simplify the building process a bit.

Perhaps we should add building on Mac to our GitHub Actions too?

@HanyzPAPU
Copy link
Collaborator Author

From what I've seen, there were one or two students using Mac each year. I think it would be a good idea to have MSIM prebuilt for them.

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

2 participants