Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 03 Apr 2018 15:50:16 +0000
From:      bugzilla-noreply@freebsd.org
To:        freebsd-bugs@FreeBSD.org
Subject:   [Bug 227259] accept() does not wakeup on shutdown()/close()
Message-ID:  <bug-227259-8@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D227259

            Bug ID: 227259
           Summary: accept() does not wakeup on shutdown()/close()
           Product: Base System
           Version: 11.0-STABLE
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: kern
          Assignee: freebsd-bugs@FreeBSD.org
          Reporter: rozhuk.im@gmail.com
 Attachment #192171 text/plain
         mime type:

Created attachment 192171
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D192171&action=
=3Dedit
acc_test.c

We have some legacy app that create socket, create thread and in new thread
call accept() with this socket.
Main thread wait for signals and do shutdown() + close() for socket, then w=
ait
until accept thread wakeup and exit, then app exit/create new socket+thread.

On FreeBSD 9, 10 - OK.
On FreeBSD 11 - thread does not wakeup on shutdown() and close().

FreeBSD 10:
cc acc_test.c -O0 -DDEBUG -DACCT_CLOSE -pthread -o acc_test - HANG
cc acc_test.c -O0 -DDEBUG -DACCT_CLOSE -DACCT_SELECT -pthread -o acc_test -
HANG
cc acc_test.c -O0 -DDEBUG -DACCT_CLOSE -DACCT_SELECT -DACCT_NONBLOCK -pthre=
ad
-o acc_test - HANG
cc acc_test.c -O0 -DDEBUG -DACCT_CLOSE -DACCT_POLL -pthread -o acc_test - OK
cc acc_test.c -O0 -DDEBUG -DACCT_CLOSE -DACCT_POLL -DACCT_NONBLOCK -pthread=
 -o
acc_test - OK
cc acc_test.c -O0 -DDEBUG -DACCT_SHUTDOWN -pthread -o acc_test - OK
cc acc_test.c -O0 -DDEBUG -DACCT_SHUTDOWN -DACCT_SELECT -pthread -o acc_tes=
t -
HANG
cc acc_test.c -O0 -DDEBUG -DACCT_SHUTDOWN -DACCT_SELECT -DACCT_NONBLOCK
-pthread -o acc_test - HANG
cc acc_test.c -O0 -DDEBUG -DACCT_SHUTDOWN -DACCT_POLL -pthread -o acc_test =
- OK
cc acc_test.c -O0 -DDEBUG -DACCT_SHUTDOWN -DACCT_POLL -DACCT_NONBLOCK -pthr=
ead
-o acc_test - OK

FreeBSD 11:
cc acc_test.c -O0 -DDEBUG -DACCT_CLOSE -pthread -o acc_test - HANG
cc acc_test.c -O0 -DDEBUG -DACCT_CLOSE -DACCT_SELECT -pthread -o acc_test -
HANG
cc acc_test.c -O0 -DDEBUG -DACCT_CLOSE -DACCT_SELECT -DACCT_NONBLOCK -pthre=
ad
-o acc_test - HANG
cc acc_test.c -O0 -DDEBUG -DACCT_CLOSE -DACCT_POLL -pthread -o acc_test - OK
cc acc_test.c -O0 -DDEBUG -DACCT_CLOSE -DACCT_POLL -DACCT_NONBLOCK -pthread=
 -o
acc_test - OK
cc acc_test.c -O0 -DDEBUG -DACCT_SHUTDOWN -pthread -o acc_test - HANG
cc acc_test.c -O0 -DDEBUG -DACCT_SHUTDOWN -DACCT_SELECT -pthread -o acc_tes=
t -
HANG
cc acc_test.c -O0 -DDEBUG -DACCT_SHUTDOWN -DACCT_SELECT -DACCT_NONBLOCK
-pthread -o acc_test - HANG
cc acc_test.c -O0 -DDEBUG -DACCT_SHUTDOWN -DACCT_POLL -pthread -o acc_test -
HANG
cc acc_test.c -O0 -DDEBUG -DACCT_SHUTDOWN -DACCT_POLL -DACCT_NONBLOCK -pthr=
ead
-o acc_test - HANG


Summary
FreeBSD 10:
poll() + close()
poll() + shutdown()
accept() + shutdown()

FreeBSD 11:
poll() + close()

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-227259-8>