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

xpp::connection segfaults when there is a problem connecting to X #32

Open
zybreak opened this issue Jan 4, 2022 · 2 comments
Open

Comments

@zybreak
Copy link

zybreak commented Jan 4, 2022

I have identified 2 possible scenarios so far. #1 is when we create a connection and specify extensions, then the segfault seems to happen in the extension.

dispatcher(const xpp::shape::extension & extension)
      : dispatcher(extension->first_error)  <--- this line
    {}

If no extensions are specified, the segfault happens because the connection objects tries to fetch the root screen, without checking for a successful connection first.

The second segfault is pretty simple to fix, but the first one requires more c++ skills than I currently have :)

@zybreak
Copy link
Author

zybreak commented Jan 4, 2022

To reproduce, instansiate a connection like so and set the DISPLAY environment variable to point at some non-running X address. expected result is the graceful shutdown with a error message, instead it segfaults

    xpp::connection<xpp::xkb::extension, xpp::shape::extension, xpp::big_requests::extension, xpp::randr::extension> a;
    if (a.connection_has_error())
        errx(EXIT_FAILURE, "Cannot open display");

@patrick96
Copy link
Member

Thanks for letting me know.

I don't see an immediate fix for the first segfault, I'm not even sure what exactly causes it.

We're not really maintaining this library for general use, we don't have the capacity for that. We only keep it because we need it for polybar.

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