Open AMDmi3 opened 10 years ago
How much memory did you specify?
8G. You're right, 3 works fine. 7 also works fine (I guess it's trimmed to 32 bits). Poudriere should probably just ignore the limit >=4 for 32bit jails. /usr/bin/limits should also be fixed likely. that's more likely /bin/sh problem see #229
I don't understand this. I don't see any overflow. From an i386 system:
# sh -c 'MAX_MEMORY=100; x=$((${MAX_MEMORY} * 1024 * 1024 * 1024)); ulimit -v $x; ulimit -v' 107374182400
Even using limits(1):
# sh -c 'MAX_MEMORY=100; x=$((${MAX_MEMORY} * 1024 * 1024 * 1024)); limits -v $x sh -c "ulimit -v"' 104857600
Ah! Yes, I misread the 2nd, limits(1) is broken.
Actually I see ulimit(1) returns KB. So all is fine.
I see no issue here.
Your proposed patch does the same thing as the original, plus does not work on FreeBSD 8.4.
Hmm, you are right. I somehow mistested it. However it still aborts with MAX_MEMORY=4, 8 (but not 7), so there definitely is an overflow somewhere. In arm jail:
# /usr/bin/limits -v 4294967295 /bin/sh -c '/usr/bin/limits -v'
Resource limits (current):
vmemoryuse 4194304 kB
# /usr/bin/limits -v 4294967296 /bin/sh -c '/usr/bin/limits -v'
Abort trap
# /usr/bin/limits -v 5294967296 /bin/sh -c '/usr/bin/limits -v'
Resource limits (current):
vmemoryuse 976563 kB
That's not ARM problem, doesn't show up on native ARM. Probably emulation thing.
When MAX_MEMORY is enabled in poudriere config, any build which uses cross compilation with qemu user mode would fail with abort trap.