Conversation
Minimal reproducer for the memory leak:
$ arch/*/bin/ksh true
true: true: cannot execute [Exec format error]
=================================================================
==458768==ERROR: LeakSanitizer: detected memory leaks
Direct leak of 40 byte(s) in 1 object(s) allocated from:
#0 0x7f7bd5360181 in malloc (/usr/lib/libasan.so.8+0x160181) (BuildId: 5f5511943a2d1bbff3f628464c43ad8c6ed91d5b)
ksh93#1 0x562dc27e013d in sh_malloc /home/johno/GitRepos/KornShell/ksh/src/cmd/ksh93/sh/init.c:234
ksh93#2 0x562dc2a08033 in path_fullname /home/johno/GitRepos/KornShell/ksh/src/cmd/ksh93/sh/path.c:526
ksh93#3 0x562dc273ae45 in sh_main /home/johno/GitRepos/KornShell/ksh/src/cmd/ksh93/sh/main.c:246
ksh93#4 0x562dc27385a2 in main /home/johno/GitRepos/KornShell/ksh/src/cmd/ksh93/sh/pmain.c:41
ksh93#5 0x7f7bd4627d0d (/usr/lib/libc.so.6+0x27d0d) (BuildId: 5e3b85a3eaa72d02eaae3882b22410ebda6b5555)
ksh93#6 0x7ffc5d4ab4e1 (<unknown module>)
src/cmd/ksh93/sh/init.c:
- Free sh.st.filename if memory was already allocated to it
during shell initialization.
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Minimal reproducer for the memory leak:
src/cmd/ksh93/sh/init.c:
sh.st.filenamebefore allocation if memory was already allocated to it during shell initialization.