Validate the buffer pointer before dereferencing it. Free the sign type name.
https://github.com/vim/vim/pull/7248
—
You are receiving this because you are subscribed to this thread.
Reply to this email directly, view it on GitHub, or unsubscribe.![]()
Thanks. Without the code changes I can't reproduce the error in valgrind. It did happen without the added sleep commands, it's not obvious why. Did the test failure cause the buffer to be wiped out? Perhaps we can have a test that gets us in this situation, so we test what the code change fixes.
Merging #7248 into master will increase coverage by
0.02%.
The diff coverage is100.00%.
@@ Coverage Diff @@ ## master #7248 +/- ## ========================================== + Coverage 88.84% 88.87% +0.02% ========================================== Files 148 148 Lines 162494 162561 +67 ========================================== + Hits 144367 144473 +106 + Misses 18127 18088 -39
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/netbeans.c | 84.26% <100.00%> (+0.51%) |
⬆️ |
| src/if_xcmdsrv.c | 88.55% <0.00%> (-0.36%) |
⬇️ |
| src/fold.c | 87.29% <0.00%> (-0.26%) |
⬇️ |
| src/eval.c | 96.44% <0.00%> (-0.23%) |
⬇️ |
| src/dict.c | 91.96% <0.00%> (-0.20%) |
⬇️ |
| src/vim9compile.c | 93.14% <0.00%> (-0.06%) |
⬇️ |
| src/message.c | 88.81% <0.00%> (-0.05%) |
⬇️ |
| src/time.c | 94.71% <0.00%> (ø) |
|
| src/getchar.c | 86.12% <0.00%> (ø) |
|
| src/version.c | 92.13% <0.00%> (ø) |
|
| ... and 23 more |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact),ø = not affected,? = missing data
Powered by Codecov. Last update 6fd3a4b...ad69d43. Read the comment docs.
Thanks. Without the code changes I can't reproduce the error in valgrind. It did happen without the added sleep commands, it's not obvious why. Did the test failure cause the buffer to be wiped out? Perhaps we can have a test that gets us in this situation, so we test what the code change fixes.
Thanks for looking into this. Obviously avoiding memory access errors is important. That some memory is release only later (perhaps much later) is less important.
if you know how to fix it that is welcome, but only if there is no risk of breaking something else.
Hmm, perhaps it should be:
#define NETBEANS_OPEN ((nb_channel) != NULL && channel_can_write_to(nb_channel))
No, channel_can_write_to() checks for the NULL pointer, thus that's not needed.
Or were you referring to what happens in netbeans_file_killed() ?
—
You are receiving this because you commented.
Thanks for looking into this. Obviously avoiding memory access errors is important. That some memory is release only later (perhaps much later) is less important.
if you know how to fix it that is welcome, but only if there is no risk of breaking something else.Hmm, perhaps it should be:
#define NETBEANS_OPEN ((nb_channel) != NULL && channel_can_write_to(nb_channel))
No, channel_can_write_to() checks for the NULL pointer, thus that's not needed.Or were you referring to what happens in netbeans_file_killed() ?