Apache OpenOffice (AOO) Bugzilla – Issue 126586
automation deadlock: osl_closeSocket() doesn't wake up thread stuck in accept()
Last modified: 2016-08-30 21:34:53 UTC
On FreeBSD (and I presume other *BSDs), when running the graphical tests (ie. run "ant" in the aoo/tests directory), there are many test errors and after the tests several instances of AOO are running in the background and need to be killed. I ran AOO exactly how the tests run it on Linux and on FreeBSD and compared the difference: "/AOO/main/instsetoo_native/unxfbsdx/Apache_OpenOffice/installed/install/en-US/openoffice4/program/soffice" "-automationport=12479" "-enableautomation" "-86fe1abe16f242ccb73ee2bad8cbcffa" "-nofirststartwizard" "-norestore" "-quickstart=no" On Linux exiting by clicking the "X" in the top-right corner of the window causes it to immediately exit and control to return to the command prompt. On FreeBSD that doesn't happen: control doesn't return to the command prompt, AOO is **DEADLOCKED**. Running "thread apply all bt" in gdb shows why: in the main/automation module, one thread closes a socket and is trying to join another, but that other is still stuck in accept() on that closed socket, hopelessly waiting for clients to connect. Digging deeper, I saw why: when one thread closes a socket, and another thread is in accept() on that socket, that other thread doesn't return from accept(). The socket code in main/sal/osl/unx has a workaround for this, but it's "#if defined(LINUX)".
I've committed a patch that generalizes the #if defined(LINUX) to FreeBSD and (by extrapolation only) NetBSD, and not only gets AOO to exit when run with automation enabled as described, but also gets all tests to run, and even gets as many tests to pass on FreeBSD as pass on Linux (though different ones fail and for different reasons lol). I am thus proposing this fix as a 4.1.2 release blocker.
@damjan: Do you have the revision number? SVN robot is apparently broken these days. And, reading your description, the scope of this fix is limited to BSD, right? Meaning that nothing changes for other platforms. This is for properly evaluating impact of this bug and deciding whther to include the fix if we go for a RC3. Thanks.
Hi Andrea, it's revisions 1708477 and 1708483, and yes only FreeBSD and NetBSD.
This is merged to AOO410 for OpenOffice 4.1.2-RC3.
For reference, trunk revision 1708477 and trunk revision 1708483 were merged as revision 1709400 on AOO410.
Closing.