Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Feb 2021 18:23:53 +0000
From:      bugzilla-noreply@freebsd.org
To:        emulation@FreeBSD.org
Subject:   [Bug 253337] Linuxulator: glibc's pthread_getattr_np reports stack size as 124K
Message-ID:  <bug-253337-4077-a4IEErlgoj@https.bugs.freebsd.org/bugzilla/>
In-Reply-To: <bug-253337-4077@https.bugs.freebsd.org/bugzilla/>
References:  <bug-253337-4077@https.bugs.freebsd.org/bugzilla/>

next in thread | previous in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D253337

--- Comment #10 from Alex S <iwtcex@gmail.com> ---
(In reply to Conrad Meyer from comment #8)

I noticed neither Linux nor FreeBSD actually bothers with accurate
stack mappings in /proc/self/map. About multiple threads Linux's
documentation plainly states "[stack:<tid>] (from Linux 3.4 to 4.4) =E2=80=
=A6
This field was removed in Linux 4.5, since providing this information
for a process with large numbers of threads is expensive."

However, this looks a bit fishy even with a basic single-threaded test:

xubuntu@xubuntu:~$ cat address.c=20
#define _GNU_SOURCE

#include <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>

int main() {
  int i =3D 1;
  fprintf(stderr, "[[%p]]\n", &i);
  system("cat /proc/self/maps | tail -n 5");
  return 0;
}
xubuntu@xubuntu:~$ gcc address.c -o test
xubuntu@xubuntu:~$ ./test
[[0x7ffe7a0cbca4]]
7f4f3c7af000-7f4f3c7b0000 rw-p 00000000 00:00 0=20
7ffe37e2e000-7ffe37e4f000 rw-p 00000000 00:00 0=20=20=20=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20=20
[stack]
7ffe37fd0000-7ffe37fd3000 r--p 00000000 00:00 0                          [v=
var]
7ffe37fd3000-7ffe37fd4000 r-xp 00000000 00:00 0                          [v=
dso]
ffffffffff600000-ffffffffff601000 --xp 00000000 00:00 0=20=20=20=20=20=20=
=20=20=20=20=20=20=20=20=20=20=20
[vsyscall]

I mean, 0x7ffe7a0cbca4 is right between [vdso] and [vsyscall].

Since apparently we are already in the pure fantasy land,
it's probably not a big deal to mess this a bit more.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-253337-4077-a4IEErlgoj>