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

Weston sample clients don't run #5

Closed
9 tasks done
abooij opened this issue Apr 3, 2016 · 6 comments
Closed
9 tasks done

Weston sample clients don't run #5

abooij opened this issue Apr 3, 2016 · 6 comments
Assignees
Labels
Milestone

Comments

@abooij
Copy link
Owner

abooij commented Apr 3, 2016

A number of sample clients included with the weston reference compositor do not run correctly when using sudbury client-side.

  • weston-simple-egl
has EGL_EXT_buffer_age and EGL_EXT_swap_buffers_with_damage
[1]    6970 segmentation fault (core dumped)

This might be caused by lack of dealing with null pointers in cArgToWireArg in Crap.Client.

  • weston-simple-dmabuf-intel
buffer allocated w 250, h 250, stride 1024, size 262144
buffer allocated w 250, h 250, stride 1024, size 262144
sudbury: IntMap.!: key 4278190080 is not an element of the map

We probably made a mistake in handling new_ids that are part of an event (ie a message from the server), in other words we can't deal with the case where the server decides to create an object.

  • weston-flower
sudbury: <<loop>>

I'm not sure where this originates, but I previously encountered such a loop via an STM deadlock. A number of clients have this error, and they all successfully open a window and then exit in this way. So they show a black rectangle on the screen for a split second.

  • weston-info
weston-info: symbol lookup error: weston-info: undefined symbol: wl_list_init

This is because we did not bake in support for wl_list. Should be an easy fix by just including some C code. (We are not planning to support wl_list on the Haskell side of things because it's not really necessary to do so: we can get away with just providing this C interface.)

  • weston-flower again

On mouseover:

sudbury: Message parse failed: not enough input
  • weston-subsurfaces
Chosen EGL config details:
        RGBA bits: 8 8 8 8
        swap interval range: 0 - 1
[1]    13663 segmentation fault (core dumped)
  • weston-dnd

When actually starting a drag:

[1]    5569 segmentation fault (core dumped)
  • weston-dnd again

When finishing the drag:

sudbury: IntMap.!: key 44 is not an element of the map

(we have to think about object lifetime, and do event handling accordingly)

  • others?
@abooij
Copy link
Owner Author

abooij commented Apr 6, 2016

The weston-simple-dmabuf-intel issue is caused by us not actually creating Proxy objects when we receive a message with a new_id argument.

I think I'll leave the (new) weston-flower issue for now, and hopefully fix it by implementing #6.

@abooij
Copy link
Owner Author

abooij commented Apr 6, 2016

I re-generated cbits/wayland-protocol.c (from the libwayland code) and added it. This resolves the weston-flower issue. But it really is a workaround since we should have had version checks or something. Something ran that shouldn't.

The underlying issue was that weston-flower used some kind of message that was only in this newer version. But since we were using an older version without that message, it grabbed a random piece of memory, that eventually resulted in this error.

If we check protocol versions between the library and the user, this might be a problem we can catch earlier. See issue #10.

@abooij
Copy link
Owner Author

abooij commented Apr 6, 2016

I suspect the remaining two bugs (segfaults) are actually a GHC bug. See e.g. this (solved) GHC STM bug.

@abooij
Copy link
Owner Author

abooij commented Apr 6, 2016

Ah. They are not, in fact!

One source was a potential null pointer (which we now deal with). Another is caused by the fact that we do not deal with object destruction. This will be fixed as well.

@abooij
Copy link
Owner Author

abooij commented Sep 24, 2016

The remaining issue with weston-dnd is caused by us completely forgetting about objects that we destroy. When the server subsequently sends us a message on that object, we don't know how to handle the incoming data.
To fix this, we need to remember protocol data of objects that are destroyed on our end, and only discard it after the server has sent a delete_id event to confirm destruction.

In fact, it seems that libwayland has a bug here: if the server sends an event containing an fd on an object that the client has deleted, the fd stream gets out of sync because fds are read in wl_connection_demarshal, which is not called on objects that are already destroyed by the client.

abooij added a commit that referenced this issue Sep 24, 2016
@abooij abooij closed this as completed Sep 24, 2016
@abooij
Copy link
Owner Author

abooij commented Sep 24, 2016

All clients now run correctly, as far as I can see. Please open a new bug report if you spot any broken clients (weston demo clients or otherwise).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant