Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
patch 8.1.0130: ":profdel func" does not work if func was called already
Problem: ":profdel func" does not work if func was called already. (Dominique Pelle) Solution: Reset uf_profiling and add a flag to indicate initialization was done.
- Loading branch information
Showing
3 changed files
with
33 additions
and
22 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
ad64809
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brammool
This commit causes a segfault with tests where I am using
:profile start
and:profile! pattern/to/file
with an indent plugin.I am not using
:profdel
.The tests are using vimrunner, and therefor interact with a server using
--servername
etc.I've noticed that the server vanished inside the Docker container, but could also reproduce it outside now.
The setup is not that easy, so hopefully I can provide enough information here:
The whole code is this:
Where this gets used to skip it, but it is not true in this case:
#define FUNCLINE(fp, j) ((char_u **)(fp->uf_lines.ga_data))[j]
/cc @dpelle
ad64809
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ad64809
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@brammool
Thanks for looking into this!
Yes, I've git-bisected it to this commit.
Yes, that fixes it.
Two of the 3 profile files say "Sourced 2 times", so the function get redefined - this is due to how the tests are setup, and I am using
getpid()
in the profile filename already, to handle the multiple processes.I've tried an ASAN build, and one of the logs (after this one-line-patch) shows:
Without the one-line patch it looked like only the "20000 bytes" leak was there, but hard to say for me.
I've used
make SANITIZER_CFLAGS="-g -O1 -DABORT_ON_INTERNAL_ERROR -DEXITFREE -fsanitize=address -fno-omit-frame-pointer"
with Vim, and thenexport ASAN_OPTIONS="print_stacktrace=1 log_path=/tmp/asan"
when running it - both based on what I've found in.travis.yml
.ad64809
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Your asan log is not usable because symbols were stripped.
Try again after commenting this line and re-building:
ad64809
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, using STRIP=/bin/true shows:
ad64809
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently on ad64809, with the one-line patch (for the line numbers).
ad64809
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On master (without the one-line patch) I get this:
ad64809
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Did you also uncomment out this line in src/Makefile, so that vim frees all data structures before exiting? This is only useful to avoid spurious leak reports:
ad64809
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@dpelle
Still getting this leak with the following:
ad64809
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For reference: should be fixed in 79c2ad5.