It should return an actual file offset or 0 if that is not applicable.
I've got a suspicion, based on https://forums.freebsd.org/threads/steamuxulation-redux.72140/page-4#post-448999, this might be relevant for Valve Anti-Cheat used by several popular Steam games.
Created attachment 210472 [details] proposed patch Indeed, this column is supposed to be the mapping offset and linprocfs is just returning the object size. The attached patch should fix it. It also fixes a secondary bug which causes us to potentially print the previous entry's "offset" for an entry with no backing object.
I guess this is not quite right when the mapping is COW, the entry's offset will give the offset into the top-level anonymous shadow object. We need to sum the offsets along the object chain, assuming that Linux provides the same info.
https://reviews.freebsd.org/D23062
A commit references this bug: Author: markj Date: Wed Jan 8 16:57:08 UTC 2020 New revision: 356494 URL: https://svnweb.freebsd.org/changeset/base/356494 Log: linprocfs: Fix some bugs in the maps file implementation. - Export the offset into the backing object, not the object size. - Fix a bug where we would print the previous entry's "offset" when a map_entry has no object. - Try to identify shared mappings. Linux prints "s" when the mapping "may be shared". This attempt is not perfect, for example, we print "p" for anonymous memory that may be shared via minherit(INHERIT_SHARE). PR: 240992 Reviewed by: kib MFC after: 1 week MFC note: no OBJ_ANON in stable/12 Differential Revision: https://reviews.freebsd.org/D23062 Changes: head/sys/compat/linprocfs/linprocfs.c
(In reply to Alex S from comment #1) > I've got a suspicion, > based on https://forums.freebsd.org/threads/steamuxulation-redux.72140/page-4#post-448999, > this might be relevant for Valve Anti-Cheat > used by several popular Steam games. On a further look, this issue is probably not directly related. steamservice.so calls pread64 libc function, which is supposed to use 64-bit offsets. That doesn't seem to work properly.
(In reply to Alex S from comment #6) Are you using 32-bit binaries? I wonder if it is related to the other PR.
(In reply to Mark Johnston from comment #7) > Are you using 32-bit binaries? Yes, the Steam client (the program that produced the backtrace referenced above) is a 32-bit application.
A commit references this bug: Author: markj Date: Thu Jan 16 16:00:28 UTC 2020 New revision: 356794 URL: https://svnweb.freebsd.org/changeset/base/356794 Log: MFC r356494: PR: 240992 Changes: _U stable/12/ stable/12/sys/compat/linprocfs/linprocfs.c
Thank you for the report.