Bug 252106 - [linuxlator] statx() not implemented
Summary: [linuxlator] statx() not implemented
Status: Closed FIXED
Alias: None
Product: Base System
Classification: Unclassified
Component: kern (show other bugs)
Version: 12.1-RELEASE
Hardware: amd64 Any
: --- Affects Only Me
Assignee: Edward Tomasz Napierala
URL:
Keywords:
Depends on:
Blocks: 247219
  Show dependency treegraph
 
Reported: 2020-12-24 13:48 UTC by Martin Filla
Modified: 2022-02-17 16:36 UTC (History)
5 users (show)

See Also:


Attachments
patch statx (4.10 KB, patch)
2021-05-11 05:33 UTC, pitwuu
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Filla 2020-12-24 13:48:03 UTC
Hi,
i have issue with based electron application 
with syscall:
linux_statx(0xffffff9c,0x7fffffffc188,0x0,0xfff,0x7fffffff9c30) ERR#-38 'Function not implemented'
Comment 1 Alex S 2020-12-24 20:47:08 UTC
(In reply to Martin Filla from comment #0)

What application is that?
Comment 2 Martin Filla 2020-12-25 09:32:24 UTC
(In reply to Alex S from comment #1)

I tried application exodus for linux.
Comment 3 Alex S 2020-12-25 09:51:20 UTC
(In reply to Martin Filla from comment #2)

That statx call looks inconsequential. There is, however, an explicit check for passed arguments:

% ./Exodus --no-sandbox --no-zygote
ENV: production
wallet-controller initialized, process.type = browser, timestamp: 1608889643286
Can only pass whitelisted args; exiting
[object Object]

You won't be running this in anything other than a full VM.
Comment 4 Alex S 2020-12-25 10:02:39 UTC
(In reply to Alex S from comment #3)

On the positive side, executables match the official Electron 11.1.0 binaries. So, no modifications here at least.
Comment 5 Alex S 2020-12-25 10:11:56 UTC
(In reply to Alex S from comment #3)

> That statx call looks inconsequential.

Most likely comes from node.js: https://github.com/nodejs/node/blob/606df7c4e79324b9725bfcfe019a8b75bfa04c3f/deps/uv/src/unix/fs.c#L1465.
Comment 6 Alex S 2020-12-25 10:16:40 UTC
(In reply to Alex S from comment #5)

Forgot to include strace output:

statx(AT_FDCWD, "/usr/home/boxy/exodus-linux-x64/electron/js2c/browser_init", AT_STATX_SYNC_AS_STAT, STATX_ALL, 0x7fffffff9e58) = -1 ENOSYS (Function not implemented)
stat("/usr/home/boxy/exodus-linux-x64/electron/js2c/browser_init", 0x7fffffffa180) = -1 ENOENT (No such file or directory)
Comment 7 Edward Tomasz Napierala freebsd_committer freebsd_triage 2021-01-12 17:17:31 UTC
FWIW, this also breaks a number of applications from Ubuntu Focal, eg konsole(1).  It (or rather - Qt5 applications) can fall back to fstatat(2), however:

statx(3, "", AT_STATX_SYNC_AS_STAT|AT_EMPTY_PATH, STATX_ALL, 0x7fffffffe1b0) = -1 ENOSYS (Function not implemented)
newfstatat(3, "", 0x7fffffffe000, AT_EMPTY_PATH) = -1 EINVAL (Invalid argument)
Comment 8 pitwuu 2021-05-04 10:58:21 UTC
I have implemented statx.
Give me some time to clean up the patches, please.
Comment 9 pitwuu 2021-05-11 05:33:45 UTC
Created attachment 224829 [details]
patch statx

Proposed patch for support for statx in the linuxulator.
It does not support extended attributes now but that might be added at a later date.
Comment 10 Edward Tomasz Napierala freebsd_committer freebsd_triage 2021-05-11 14:11:05 UTC
Nice!  Could you push it to https://reviews.FreeBSD.org?
Comment 11 Edward Tomasz Napierala freebsd_committer freebsd_triage 2021-05-26 12:12:36 UTC
https://reviews.freebsd.org/D30466
Comment 12 commit-hook freebsd_committer freebsd_triage 2021-06-08 09:10:01 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=2362ad457a01d56d87e74823599578ab37bdbfb9

commit 2362ad457a01d56d87e74823599578ab37bdbfb9
Author:     Philippe Michaud-Boudreault <pitwuu@gmail.com>
AuthorDate: 2021-06-08 08:24:10 +0000
Commit:     Edward Tomasz Napierala <trasz@FreeBSD.org>
CommitDate: 2021-06-08 09:08:56 +0000

    linux: implement statx(2)

    PR:             252106
    Reviewed By:    dchagin
    Differential Revision:  https://reviews.freebsd.org/D30466

 sys/compat/linux/linux.h       | 42 ++++++++++++++++++++++++++
 sys/compat/linux/linux_dummy.c |  2 --
 sys/compat/linux/linux_stats.c | 67 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 109 insertions(+), 2 deletions(-)
Comment 13 commit-hook freebsd_committer freebsd_triage 2022-02-17 15:54:52 UTC
A commit in branch stable/13 references this bug:

URL: https://cgit.FreeBSD.org/src/commit/?id=b630d64c3da1f669859ae61300191be09a744577

commit b630d64c3da1f669859ae61300191be09a744577
Author:     Philippe Michaud-Boudreault <pitwuu@gmail.com>
AuthorDate: 2021-06-08 08:24:10 +0000
Commit:     Edward Tomasz Napierala <trasz@FreeBSD.org>
CommitDate: 2022-02-14 00:07:33 +0000

    linux: implement statx(2)

    PR:             252106
    Reviewed By:    dchagin
    Differential Revision:  https://reviews.freebsd.org/D30466

    (cherry picked from commit 2362ad457a01d56d87e74823599578ab37bdbfb9)

 sys/compat/linux/linux.h       | 42 ++++++++++++++++++++++++++
 sys/compat/linux/linux_dummy.c |  2 --
 sys/compat/linux/linux_stats.c | 67 ++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 109 insertions(+), 2 deletions(-)