-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a crash in the shbench fibonacci benchmark
If the fibslow function in the shbench[*] fibonacci benchmark is run with an argument greater than 20, ksh will crash with a memory fault. This was caused by subshell numbers only being 16-bits long, which isn't enough when running a large number of subshells. Extending the subshell number length to 64-bit fixes this issue, but with vmalloc only to a certain extent. The fibonacci benchmark no longer crashes when run, but the regression test this commit adds only works with standard malloc. With ksh93u+ vmalloc the regression test will crash. src/cmd/ksh93/include/defs.h, src/cmd/ksh93/include/jobs.h, src/cmd/ksh93/sh/jobs.c, src/cmd/ksh93/sh/subshell.c, - Extend curenv, jobenv, subenv and p_env from short to long. This bugfix was backported from ksh93v- with a patch from OpenSUSE: https://build.opensuse.org/package/view_file/shells/ksh/ksh93-longenv.dif?expand=1 src/cmd/ksh93/tests/subshell.sh: - Add a regression test for running a large number of subshells, but disable it if vmstate is a builtin (since it doesn't work with vmalloc). [*]: https://github.com/ksh-community/shbench
- Loading branch information
Showing
6 changed files
with
32 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters