Conversation
Notices
-
Embed this notice
[SUYA] ひみつ :blabcatverified: (ivesen@miniwa.moe)'s status on Sunday, 08-Dec-2024 07:36:37 JST [SUYA] ひみつ :blabcatverified: @quad echo is a builtin so it doesn't count towards the 2M limit
ls might also be a builtin
the 2M limit is the linux kernel default iirc-
Embed this notice
Haelwenn /элвэн/ :triskell: (lanodan@queer.hacktivis.me)'s status on Sunday, 08-Dec-2024 07:36:36 JST Haelwenn /элвэн/ :triskell: @ivesen @quad 2MB sounds kind of weird, at least ARG_MAX here is 131072 bytes so 128 KiB.
/usr/include/linux/limits.h:#define ARG_MAX 131072 /* # bytes of args + environ for exec() */
-
Embed this notice
Haelwenn /элвэн/ :triskell: (lanodan@queer.hacktivis.me)'s status on Sunday, 08-Dec-2024 07:44:13 JST Haelwenn /элвэн/ :triskell: @ivesen @quad And doesn't seems to be some weird runtime thing (which POSIX allows for ARG_MAX):
$ cat arg_max.c #include <unistd.h> #include <stdio.h> #include <limits.h> int main() { printf("ARG_MAX = %d\n", ARG_MAX); long r = sysconf(_SC_ARG_MAX); printf("_SC_ARG_MAX = %ld\n", r); } $ $CC arg_max.c -o arg_max $ ./arg_max ARG_MAX = 131072 _SC_ARG_MAX = 131072 -
Embed this notice
Haelwenn /элвэн/ :triskell: (lanodan@queer.hacktivis.me)'s status on Sunday, 08-Dec-2024 07:47:38 JST Haelwenn /элвэн/ :triskell: @ivesen @quad getconf uses sysconf() underneath but most implementations of getconf are scuffed.
-
Embed this notice
[SUYA] ひみつ :blabcatverified: (ivesen@miniwa.moe)'s status on Sunday, 08-Dec-2024 07:47:39 JST [SUYA] ひみつ :blabcatverified: @lanodan @quad what about `getconf ARG_MAX` ? -
Embed this notice
Haelwenn /элвэн/ :triskell: (lanodan@queer.hacktivis.me)'s status on Sunday, 08-Dec-2024 08:04:23 JST Haelwenn /элвэн/ :triskell: @ivesen @quad Gentoo for this one so maybe some weird kernel config somewhere.
libc doesn't matters here btw, ARG_MAX has to match kernel definition and sysconf(_SC_ARG_MAX) is literally asking the kernel for the value.
-
Embed this notice
[SUYA] ひみつ :blabcatverified: (ivesen@miniwa.moe)'s status on Sunday, 08-Dec-2024 08:04:24 JST [SUYA] ひみつ :blabcatverified: @lanodan @quad strange, the systems I have on hand atm all have 2M as the limit
are you running alpine? -
Embed this notice
Haelwenn /элвэн/ :triskell: (lanodan@queer.hacktivis.me)'s status on Sunday, 08-Dec-2024 08:19:11 JST Haelwenn /элвэн/ :triskell: @ivesen @quad Aaah, looking around you can apparently get it bigger with transparent hugepages, which here defaults to only via madvise instead of always being active (which sounds quite like a recipe for memory-management problems).
-
Embed this notice
Haelwenn /элвэн/ :triskell: (lanodan@queer.hacktivis.me)'s status on Sunday, 08-Dec-2024 08:39:38 JST Haelwenn /элвэн/ :triskell: @ivesen @quad Ah yeah right, gnu libc just doesn't defines ARG_MAX in <limits.h> even though it's part of POSIX, I guess I'll hit this problem over and over.
-
Embed this notice
[SUYA] ひみつ :blabcatverified: (ivesen@miniwa.moe)'s status on Sunday, 08-Dec-2024 08:39:39 JST [SUYA] ひみつ :blabcatverified: @lanodan @quad I mean, the c program you wrote won't even compile on my machine, since it can't find ARG_MAX
but removing that bit I still get 2M from the second bit
-
Embed this notice