Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Memory leak #70

Closed
posguy99 opened this issue Jul 10, 2020 · 5 comments
Closed

Memory leak #70

posguy99 opened this issue Jul 10, 2020 · 5 comments
Labels
regressfail Regression test failure

Comments

@posguy99
Copy link

posguy99 commented Jul 10, 2020

[32] iMac $ git pull
Updating f9d2893..c4236cc
Fast-forward
 NEWS                            | 5 +++++
 src/cmd/ksh93/include/version.h | 2 +-
 src/cmd/ksh93/sh/parse.c        | 2 +-
 src/cmd/ksh93/tests/types.sh    | 3 +++
 4 files changed, 10 insertions(+), 2 deletions(-)
[ 9:59 AM][ttys000][~/src/ksh]

but...

[10:07 AM][ttys000][~/src/ksh]
[36] iMac $ bin/shtests leaks  
#### Regression-testing /Users/mwilson/src/ksh/arch/darwin.i386-64/bin/ksh ####
test leaks begins at 2020-07-10+10:08:09
test leaks passed at 2020-07-10+10:08:09 [ 6 tests 0 errors ]
test leaks(C.UTF-8) begins at 2020-07-10+10:08:09
test leaks(C.UTF-8) passed at 2020-07-10+10:08:10 [ 6 tests 0 errors ]
test leaks(shcomp) begins at 2020-07-10+10:08:10
	shcomp-leaks.ksh[102]: memory leak with read -C when using <<< (leaked 80 bytes)
test leaks(shcomp) failed at 2020-07-10+10:08:10 with exit code 1 [ 6 tests 1 error ]
Total errors: 1
CPU time       user:      system:
main:       0m00.00s     0m00.01s
tests:      0m00.27s     0m00.55s
[10:08 AM][ttys000][~/src/ksh]
[37] iMac $ git status
On branch master
Your branch is up to date with 'origin/master'.

nothing to commit, working tree clean
@posguy99 posguy99 changed the title Memory leak with Memory leak with 93u+m 2020-07-10 Jul 10, 2020
@posguy99
Copy link
Author

posguy99 commented Jul 10, 2020

I'm lost. My 10.15.5 Mac is currently at 588a1ff, and it passes all the regression tests. I backed up the 10.14.6 machine to that same commit, and it fails.

I completely deleted my clone on the 10.14 machine and started over, it still fails.

I honestly can't tell you when the 10.14 machine last passed the tests, if it built on the 10.15 machine and passed, I have been just building it and installing it and not running the regression tests. My bad.

The 10.14 machine is using ksh93u+m as the shell, the 10.15 machine is not, it's using 93u+. But that should not make any difference, right?

Edit: No, reverting to 93u+ as $SHELL on the 10.14 machine didn't change anything.

@posguy99
Copy link
Author

posguy99 commented Jul 10, 2020

Ok, someone smarter than me is going to have to explain this one.

On the 10.15 machine...

[11:58 AM][ttys000][~/src/ksh]
[102] mbp13 $ bin/shtests leaks
#### Regression-testing /Users/mwilson/src/ksh/arch/darwin.i386-64/bin/ksh ####
test leaks begins at 2020-07-10+11:58:44
test leaks passed at 2020-07-10+11:58:45 [ 6 tests 0 errors ]
test leaks(C.UTF-8) begins at 2020-07-10+11:58:45
test leaks(C.UTF-8) passed at 2020-07-10+11:58:45 [ 6 tests 0 errors ]
test leaks(shcomp) begins at 2020-07-10+11:58:45
test leaks(shcomp) passed at 2020-07-10+11:58:45 [ 6 tests 0 errors ]
Total errors: 0
CPU time       user:      system:
main:       0m00.00s     0m00.01s
tests:      0m00.30s     0m00.68s

ssh'd to the 10.15 machine from the 10.14 machine...

[12:00 PM][ttys002][~]
[12] iMac $ ssh mbp13.local
Last login: Fri Jul 10 11:58:04 2020 from 192.168.0.60
[Jul 10 12:01:01 PM][ttys001][~]
[4] mbp13 $ cd src/ksh
[Jul 10 12:01:01 PM][ttys001][~/src/ksh]
[5] mbp13 $ bin/shtests leaks
#### Regression-testing /Users/mwilson/src/ksh/arch/darwin.i386-64/bin/ksh ####
test leaks begins at 2020-07-10+12:01:22
test leaks passed at 2020-07-10+12:01:23 [ 6 tests 0 errors ]
test leaks(C.UTF-8) begins at 2020-07-10+12:01:23
test leaks(C.UTF-8) passed at 2020-07-10+12:01:23 [ 6 tests 0 errors ]
test leaks(shcomp) begins at 2020-07-10+12:01:23
	shcomp-leaks.ksh[102]: memory leak with read -C when using <<< (leaked 48 bytes)
test leaks(shcomp) failed at 2020-07-10+12:01:23 with exit code 1 [ 6 tests 1 error ]
Total errors: 1
CPU time       user:      system:
main:       0m00.00s     0m00.01s
tests:      0m00.32s     0m00.72s

Same git repo (physically!), commit 588a1ff.

EDIT: I just tried copying the repository from the 10.15 machine to the 10.14 machine. The same compiled binary fails the test on the 10.14 machine.

@posguy99
Copy link
Author

More ridiculousness... I deleted the repo on the 10.14 machine, and re-cloned from HEAD. Built it. Got the memory leak.

Then I ssh'd to the 10.14 machine from the 10.15 machine, ran the test again, and it PASSED.

/me very confused.

@McDutchie
Copy link

Hrm. I can't reproduce any failure on my end.

We can be pretty confident it's not a leak in read -C when using <<< though, because that test is repeated 500 times, so if the leak was in there it would leak a lot more than 80 bytes.

I've no idea why these random minor variations occur, but all the leak tests are repeated in loops to make the leak significantly large if there is one, so I'll just have to program in some tolerance, I guess – maybe 128 bytes?

Thanks for the report in any case.

@posguy99
Copy link
Author

The problem is back, built from HEAD on 10.15.6.

[ 9:03 AM][ttys000][~/src/ksh][master]
[359] mbp13 $ bin/shtests leaks
#### Regression-testing /Users/mwilson/src/ksh/arch/darwin.i386-64/bin/ksh ####
test leaks begins at 2020-07-29+09:04:11
test leaks passed at 2020-07-29+09:04:11 [ 6 tests 0 errors ]
test leaks(C.UTF-8) begins at 2020-07-29+09:04:11
	leaks.sh[72]: variable value reset memory leak -- 48 bytes after 1000 iterations
test leaks(C.UTF-8) failed at 2020-07-29+09:04:11 with exit code 1 [ 6 tests 1 error ]
test leaks(shcomp) begins at 2020-07-29+09:04:11
test leaks(shcomp) passed at 2020-07-29+09:04:11 [ 6 tests 0 errors ]
Total errors: 1
CPU time       user:      system:
main:      0m00.007s    0m00.014s
tests:     0m00.153s    0m00.220s
[ 9:04 AM][ttys000][~/src/ksh][master]
[360] mbp13 $ git log | tee
commit 05081dfc1c6ef18eee06d2a31c3f1cb4bb68d9d7
Author: Johnothan King <johnothanking@protonmail.com>
Date:   Mon Jul 27 05:27:20 2020 -0700

@posguy99 posguy99 changed the title Memory leak with 93u+m 2020-07-10 Memory leak Jul 29, 2020
@McDutchie McDutchie added the regressfail Regression test failure label Jan 22, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
regressfail Regression test failure
Projects
None yet
Development

No branches or pull requests

2 participants