Hi On Wed, Apr 15, 2020 at 5:31 AM Li Feng <fen...@smartx.com> wrote: > > double call tcp_chr_free_connection generates a crash. > > Signed-off-by: Li Feng <fen...@smartx.com>
Could you describe how you reach the "double call". Even better would be to write a test for it in tests/test-char.c thanks > --- > chardev/char-socket.c | 5 +++++ > 1 file changed, 5 insertions(+) > > diff --git a/chardev/char-socket.c b/chardev/char-socket.c > index 185fe38dda..43aab8f24b 100644 > --- a/chardev/char-socket.c > +++ b/chardev/char-socket.c > @@ -476,6 +476,11 @@ static void tcp_chr_disconnect_locked(Chardev *chr) > SocketChardev *s = SOCKET_CHARDEV(chr); > bool emit_close = s->state == TCP_CHARDEV_STATE_CONNECTED; > > + /* avoid re-enter when socket read/write error and disconnect event. */ > + if (s->state == TCP_CHARDEV_STATE_DISCONNECTED) { > + return; > + } > + > tcp_chr_free_connection(chr); > > if (s->listener) { > -- > 2.11.0 > > > -- > The SmartX email address is only for business purpose. Any sent message > that is not related to the business is not authorized or permitted by > SmartX. > 本邮箱为北京志凌海纳科技有限公司(SmartX)工作邮箱. 如本邮箱发出的邮件与工作无关,该邮件未得到本公司任何的明示或默示的授权. > > > -- Marc-André Lureau