Opened 3 years ago

Closed 3 years ago

#17612 closed bug (fixed)

Evaluate maximum process argument limits

Reported by: kallisti5 Owned by: nobody
Priority: normal Milestone: R1/beta4
Component: System/runtime_loader Version: R1/beta3
Keywords: MAX_ARG Cc:
Blocked By: Blocking:
Platform: All

Description (last modified by kallisti5)

The maximum length of arguments under Linux is 2,097,152:

getconf ARG_MAX

The maximum length under FreeBSD is 262,144:

/usr/include/sys/syslimits.h:#define    ARG_MAX                 262144  /* max bytes for an exec function */

The maximum length of arguments under Haiku is 131,072:

headers/private/system/user_runtime.h:#define MAX_PROCESS_ARGS_SIZE	(128 * 1024)

While abuse of arguments is a bad thing, it cropped up while building ICU70: https://unicode-org.atlassian.net/browse/ICU-21920

There is seemingly a large difference between the maximum argument length on Haiku vs Linux vs FreeBSD. We should evaluate if we want to raise it.

Change History (8)

comment:1 by kallisti5, 3 years ago

Description: modified (diff)

A good middle ground may be migrating to (256 * 1024) to meet the same value as FreeBSD.

comment:2 by kallisti5, 3 years ago

Another data point. FreeBSD's discussion of moving to a larger value (aka matching Linux's HUGE ARG_MAX.

https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=208154

comment:3 by korli, 3 years ago

Did you try to build ICU70 with this change?

comment:4 by kallisti5, 3 years ago

I can test with (256 * 1024). Will report back.

comment:5 by jmairboeck, 3 years ago

I have also hit this when trying to build the documentation for LilyPond (I still haven't written the recipe for it yet, but it needs a working TeXLive anyway). They use a few perl one-liners in the Makefile. I had to change this one so that perl does the globbing itself instead of the shell.

comment:6 by kallisti5, 3 years ago

I've confirmed updating to 256 * 1024 resolves the icu build issues.

I think jumping to the huge Linux MAX_ARGS is overkill, however keeping up with FreeBSD's is likely a more prudent step.

comment:7 by kallisti5, 3 years ago

https://review.haiku-os.org/c/haiku/+/4991 has been submitted.

This isn't technically a bug, however having the shortest max arg length means a lot of random things with huge numbers of args won't work on Haiku but will work on FreeBSD, Linux, etc.

Matching FreeBSD should make the situation better and fixes in ports more likely. (To be real for a moment, "Doesn't work on FreeBSD and Haiku" is a lot easier to digest and get upstream patches accepted over "Doesn't work on Haiku")

comment:8 by kallisti5, 3 years ago

Milestone: UnscheduledR1/beta4
Resolution: fixed
Status: newclosed

fixed in master via hrev55899. After some testing in nightly images, lets also merge https://review.haiku-os.org/c/haiku/+/4996 into r1beta3.

Note: See TracTickets for help on using tickets.