[haiku-bugs] Re: [Haiku] #12497: Web+ window just closes

  • From: "pulkomandy" <trac@xxxxxxxxxxxx>
  • Date: Mon, 22 Feb 2016 20:50:20 -0000

#12497: Web+ window just closes
----------------------------------------+----------------------------
   Reporter:  humdinger                 |      Owner:  pulkomandy
       Type:  bug                       |     Status:  new
   Priority:  normal                    |  Milestone:  Unscheduled
  Component:  Applications/WebPositive  |    Version:  R1/Development
 Resolution:                            |   Keywords:
 Blocked By:                            |   Blocking:
Has a Patch:  0                         |   Platform:  All
----------------------------------------+----------------------------

Comment (by pulkomandy):

 The use of "user defined signal 1" is there as a workaround, because of
 threading issues with Haiku's socket code.
 The problem is as follows:

 * running the http request spawns a new thread, where the socket
 operations are done
 * when deleting the request, its socket is shutdown(), then close()'d
 * this is supposed to unblock the thread, if it was inside a write() or
 read(), but, in Haiku, it doesn't unlock if the thread was stuck in
 connect() (maybe the server is busy and does not accept a new connection).
 * to make sure the thread terminates, the signal is used to interrupt the
 read/write system calls.

 The signal is currently configured from inside the thread, which means
 there is a race condition if the request is deleted before the thread has
 run far enough.

 It is a bad idea to use the signal in this way anyway, and a better
 solution would be to actually fix connect() to unblock if the socket is
 closed.

 I don't know if that is related to the reported crash, however. Running
 Web+ in Debugger, with a breakpoint in abort(), would help, if the problem
 is still reproductible.

--
Ticket URL: <https://dev.haiku-os.org/ticket/12497#comment:4>
Haiku <https://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: