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

Default initialize all pointers in Astroid class to avoid segfault in dtor #753

Merged
merged 2 commits into from
Jun 18, 2024

Conversation

ibuclaw
Copy link
Contributor

@ibuclaw ibuclaw commented Jun 5, 2024

Under certain circumstances - both deterministic and non-deterministic - astroid can segfault on exit.

For example, when there's another window already running:

$ astroid & bg
[2024-06-05 16:18:20.526090] [0x0000706fccadcec0] [info]    welcome to astroid! - v0.16-20-g41808e88
...
[16:18:20] [0x0000706fccadcec0] [M] [debug] log: stdout: yes

$ astroid 
[2024-06-05 16:20:26.487138] [0x00007f11b1bbaec0] [info]    welcome to astroid! - v0.16-20-g41808e88
Segmentation fault (core dumped)

In all cases the cause is at least one of these pointers pointing at garbage due to being uninitialised.

@ibuclaw
Copy link
Contributor Author

ibuclaw commented Jun 6, 2024

Added fix for the uncaught exception reported in issue 727.

It turns out that libnotmuch 5.4 has a new API for reading configuration values so there's no need for Astroid to roll its own anymore - alas Debian bullseye has libnotmuch 5.3, otherwise I would have rewritten all this code.

@gauteh
Copy link
Member

gauteh commented Jun 6, 2024 via email

@ibuclaw
Copy link
Contributor Author

ibuclaw commented Jun 6, 2024

Hi, I would recommend not to accommodate old debians. Don't have time to support so many different versions.

Sure, have nothing to disagree about that, my thinking is that fixing the issue and setting a new minimum version requirement for libnotmuch (5.4 - or notmuch 0.32) are two separate things.

There is a new function in libnotmuch 5.4 - however migrating to using it would mean a rewrite away from using ptree to using libnotmuch API directly for reading the notmuch ini file (i.e: to read a boolean value)

Adding in a new catch handler in the meantime is a trivial fix.

@jorsn
Copy link
Member

jorsn commented Jun 18, 2024

my thinking is that fixing the issue and setting a new minimum version requirement for libnotmuch (5.4 - or notmuch 0.32) are two separate things.
-- @ibuclaw

I agree, since my first priority is to release a version that works. Then, one can still modernize and clean up.

@gauteh Any objections against merging this ?

@gauteh
Copy link
Member

gauteh commented Jun 18, 2024

Sounds good. Note that there has been a bunch of issues in lieer regarding the new config system, where some values are in the db, some in the config file. Doesn't appear to work perfectly always. But probably not something astroid should worry about.

@jorsn jorsn merged commit 4b483ff into astroidmail:master Jun 18, 2024
3 of 6 checks passed
@ibuclaw ibuclaw deleted the astroid_dtor_segv branch June 18, 2024 17:11
@jorsn jorsn mentioned this pull request Jun 29, 2024
6 tasks
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.

None yet

3 participants