Skip to content

Not compatible with Proton's fsync (wrong futex opcode) #152

Closed

Description

@imaami

Weird that no one's noticed this yet, but the current zen-kernel uses a branch of futex-wait-multiple with a different FUTEX_WAIT_MULTIPLE opcode definition than what Proton's Wine expects. In practice this means that when running a zen or liquorix kernel, Proton's runtime fsync check will fail, and the fsync feature will never be used.

The offending definition is on line 24 in include/uapi/linux/futex.h. Based on the commit message it seems to have been lifted from the futex-wait-multiple-RFC branch of krisman/linux.

The problem is that there are several branches, and Valve's Wine patches rely on the value of FUTEX_WAIT_MULTIPLE being 31 instead of 13, as is the case in futex-wait-multiple-master thanks to this commit. See the crucial difference:

Here are the instances where Proton's Wine uses fsync opcode 31 specifically in its futex_wait_multiple() wrappers:

Sorry for dragging my feet with this bug report. I noticed this a few weeks ago, but work and family have kept me passive and hoping that someone else would notice this, too.

TL;DR

Cherry pick commit 368eb7d8c from krisman/linux onto all of the things.

Activity

  1. self-assigned this
    on Sep 22, 2019
  2. damentz commented on Sep 22, 2019

    @damentz
    Member

    I cherry-picked the commit you referenced to 5.2/futex-backports and 5.3/futex-backports:

    56c847c
    414768d

    To be honest, it looks to me like Valve typo'd in opcode 31, since you can see from the original patch that the next consecutive number is 13. But you know how it is, you can easily immortalize a typo that requires cooperation between two major code bases when one of them is out of your control.

    If that's the case, I'm sure the person who introduced 31 instead of 13 as the opcode face palmed for quite a while.

  3. imaami commented on Sep 23, 2019

    @imaami
    Author

    I cherry-picked the commit you referenced to 5.2/futex-backports and 5.3/futex-backports:

    56c847c
    414768d

    To be honest, it looks to me like Valve typo'd in opcode 31, since you can see from the original patch that the next consecutive number is 13. But you know how it is, you can easily immortalize a typo that requires cooperation between two major code bases when one of them is out of your control.

    If that's the case, I'm sure the person who introduced 31 instead of 13 as the opcode face palmed for quite a while.

    Yeah, it's of course possible. :) It could also have been a "temporary" choice for testing before hopefully getting merged upstream at some point. Either way we're stuck with it now for the time being.

  4. nottux commented on Dec 11, 2019

    @nottux

    So from my testing fsync still doesn't work in 5.3.0-15.1-liquorix-amd64. From a game i have tested it says: esync: up and running. and there is no mention of fsync

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions