[ace-users] JAWS generated error message when switching IO strategy from Synch to Asynch on FreeBSD 6

Douglas C. Schmidt schmidt at dre.vanderbilt.edu
Wed Aug 29 18:59:57 CDT 2007


Hi Fan,

Thanks very much for your email.  Please make sure to send all
questions related to TAO or ACE to the ACE mailing list or ACE+TAO
newsgroup, rather than to me directly since I travel frequently and
often don't have ready access to email.  See

http://www.cs.wustl.edu/~schmidt/ACE-mail.html

for more info on how to access these resources.

> I'm sorry that email you directly. I have stuck on using Proactor on FreeBSD 6 for a while. I posted several questions on
> ACE forum. unfortunately I didn't get much help. Would you please help me through it if you have time. Thank you for your
> time.

Unfortunately, I know nothing about how FreeBSD handles async I/O, so
I'm not much help here.  I recommend you contact Steve Huston
<shuston at riverace.com> for commercial support of ACE.

Thanks,

        Doug

> Enclosed file is the problemed source code. I'm going to explain my problem now.
> 
> ACE VERSION: 5.5.10
> 
> HOST MACHINE and OPERATING SYSTEM: x86, FreeBSD 6
> 
> TARGET MACHINE and OPERATING SYSTEM, if different from HOST:
> 
> THE $ACE_ROOT/ace/config.h FILE:
> #include "ace/config-freebsd.h"
> 
> THE $ACE_ROOT/include/makeinclude/platform_macros.GNU FILE:
> include $(ACE_ROOT)/include/makeinclude/platform_freebsd.GNU
> 
> AREA/CLASS/EXAMPLE AFFECTED:
> 
> DOES THE PROBLEM AFFECT:
>         COMPILATION? NO
>         LINKING? NO
>         On Unix systems, did you run make realclean first? YES
>         EXECUTION? YES
> 
> SYNOPSIS:  AIO handle_write_stream generated "Cannot allocate memeory"
> error during partial write on FreeBSD 6
> 
> DESCRIPTION: I write a test programs - aio_client.cpp based on /examples/C++NPv2/AIO_Client_Logging_Daemon.cpp using
> POSIX_CB_Proactor, it connects a server and echoes server's messages back to the server. The server program repeatly sends
> data to the client.  main functions of aio_client are:
> 
> 1. connect to server using asynch_connector
> 
> 2. initiate reader and writer streams and write to server in open() functon of Output_Handler
> 
> 3. handle_write_stream
> 
> 3.1 delete Output_Handler if unsuccess.
> 
> 3.2 write uncomplete message if there is partial write.
> 
> 3.3 initiate_read if it is full write.
> 
> 4. handle_read_stream
> 
> 4.1 delete Output_Handler if unsuccess.
> 
> 4.2 initiate_write received message
> 
> 3 and 4 steps will be repeated as long as the connection between client and server is maitained.
> 
> Everything seems fine if I set send buffer size to smaller value such as 2048. but I set it to larger number, for example,
> 131072. Result .success() will return negtive value in the handle_write_stream. result.error() is -1 (Unknown error 0). it
> didn't give me enough information to trace where is problem. I'm new to ACE, would you please tell how to figure out the
> problem, such as how to debug using aio and proactor. Thanks again.
> 
> Fan
> 
> /***********************  code snippet, detail please see the attached file  ********************************************/
> void Output_Handler::handle_write_stream(const
> ACE_Asynch_Write_Stream::Result &result)
> {
>   if (!result.success()) {
>     ACE_ERROR ((LM_DEBUG, "(%t) %p\n", "Output::handle_write_stream
> fail"));
>     delete this;
>     return;
>   }
> 
>   // Write stream successful.
>   // Partial write to socket.
>   size_t unsent_data = result.bytes_to_write () -
> result.bytes_transferred ();
>   if (unsent_data != 0){
>     int iReturn = 0;
>     if (iReturn = this-
> 
> >writer_.write(*result.message_block().duplicate(), unsent_data) == -1)
> 
> {
>       ACE_ERROR ((LM_ERROR, "Output::handle_write_stream failed\n"));
>       return;
>     }
> 
>     return;
>   }
> 
>   // read data again
>   initiate_read();
> 
> }
> 
> Would you please tell me how to deal with this problem? thank you in
> advance.
> Fan
> 



More information about the Ace-users mailing list