Hi Bram, On Tue, Nov 3, 2020 at 8:51 AM Bram Moolenaar <[email protected]> wrote:
> 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. > > > This is a regression caused by the changes made to support channels (7.4.1182: Still socket code intertwined with netbeans). Before this change, NETBEANS_OPEN used to return TRUE as long as the netbeans socket handle was valid (nb_sock != -1). When nb_sock is set to -1, all the buffer references are also cleared. In the latest code, NETBEANS_OPEN returns channel_can_write_to(nb_channel). So if the channel is not writable then this will return FALSE. So when a buffer is wiped out, if the netbeans channel is not writable, then the reference to the buffer is not cleared (resulting in a dangling pointer). Later when the netbeans connection is closed using the nbclose command, the buffers are cleared. But as the buffer pointer is no longer valid, this results in the ASAN error. For now, the added check for the sane buffer pointer addresses this problem. But I am wondering whether we should change NETBEANS_OPEN to check for nb_channel != NULL. Regards, Yegappan -- -- You received this message from the "vim_dev" maillist. Do not top-post! Type your reply below the text you are replying to. For more information, visit http://www.vim.org/maillist.php --- You received this message because you are subscribed to the Google Groups "vim_dev" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/vim_dev/CAAW7x7k%2Bcw9UR5kGRDsJmQuPJDfFXk7p4-Ac0a5%2B0sSx2TazCA%40mail.gmail.com.
