[ace-users] Acceptor pattern w/ select reactor notification
crash...
Douglas C. Schmidt
schmidt at dre.vanderbilt.edu
Fri Sep 28 11:11:40 CDT 2007
Hi Mark,
Thanks for using the PRF.
>ACE 5.5.8
>Fedora core 5 linux
>Acceptor pattern
>Selector reactor
>Notification strategy
>
>I am getting quite a few segmentation faults that appear in the
>following manner.
>
>A client connects to the acceptor and begins sending and receiving messages.
>After some point the client disconnects - either expected (logoff) or
>unexpected (dropped network).
>I catch the SIGPIPE signal and enqueue a HANGUP message as follows:
> a) Note the current notification strategy
> b) NULL the notification strategy
> c) Construct an ACE_Message_Block with length 0 and message type set
>to MB_HANGUP
> d) Put above message on message queue.
> e) If cached notification strategy from step a is not NULL then call
>notify on it.
> f) Return 0
>
>I run the app and see that someone is putting a message on my message
>queue and triggering
>my notification strategy to push my object back on the reactors
>notification pipe. Then when
>I'm reading my message_queue in handle_output I find the message with
>the message type of
>MB_HANGUP and return -1 (which is my understanding will call
>handle_close which in turn
>deletes the object). Then the reactor notification pipe attempts to call
>this object to handle_output
>again and crashes since the object has been freed inside the
>handle_close method.
>
>So, the question is what is the correct way to close an ACE_Svc_Handler
>when a SIGPIPE occurs?
There are some examples of this sort of thing in Chapters 6 and 7 of
C++NPv2 <www.cs.wustl.edu/~schmidt/ACE/book2/>. I recommend you take
a look there and see if they shed any light on what you're doing.
Thanks,
Doug
--
Dr. Douglas C. Schmidt Professor and Associate Chair
Electrical Engineering and Computer Science TEL: (615) 343-8197
Vanderbilt University WEB: www.dre.vanderbilt.edu/~schmidt
Nashville, TN 37203 NET: d.schmidt at vanderbilt.edu
More information about the Ace-users
mailing list