f



[ace-users] ACE VERSION: 5.6.8 HOST MACHINE and OPERATING SYSTEM: Linux Debian on x86 COMPILER NAME AND VERSION (AND PATCHLEVEL): g++-4.1.2 THE $ACE_ROOT/ace/config.h: config-linux.h THE $ACE_ROOT/inc

This is a multipart message in MIME format.
--=_alternative 004800E0C1257577_=
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable

ACE VERSION: 5.6.8

HOST MACHINE and OPERATING SYSTEM:
Linux Debian on x86

COMPILER NAME AND VERSION (AND PATCHLEVEL):=20
 g++-4.1.2

THE $ACE=5FROOT/ace/config.h:
 config-linux.h

THE $ACE=5FROOT/include/makeinclude/platform=5Fmacros.GNU FILE:
 platform=5Flinux.GNU

CONTENTS OF $ACE=5FROOT/bin/MakeProjectCreator/config/default.features
 (unmodified):

AREA/CLASS/EXAMPLE AFFECTED:
   Signal

DOES THE PROBLEM AFFECT:
    EXECUTION? YES=20


I've a client/server application, and sometime when a client is=20
disconnected i get a SIGPIPE signal,
this is the following stack trace.



Program received signal SIGPIPE, Broken pipe.
[Switching to Thread 182915886656 (LWP 4637)]
0x0000003f0e50b10f in =5F=5Fwrite=5Fnocancel () from /lib64/tls/libpthread.=
so.0
(gdb) bt
#0  0x0000003f0e50b10f in =5F=5Fwrite=5Fnocancel () from=20
/lib64/tls/libpthread.so.0
#1  0x0000002a95a7d54d in ACE::send (handle=3D24, buf=3D0x2ad3b30010, n=3D8=
5,=20
timeout=3DVariable "timeout" is not available.
) at ../../ace/OS=5FNS=5Funistd.inl:1163
#2  0x000000000043db02 in ACE=5FSOCK=5FIO::send (this=3D0x7352cd4,=20
buf=3D0x2ad3b30010, len=3D85, timeout=3D0x7fbfffe6f0)
    at /home/jvennin/projects/libraries/ace/include/ace/SOCK=5FIO.inl:96
#3  0x000000000043fb19 in Cfm::Cruise::Fh::ClientHandler::handle=5Foutput=20
(this=3D0x7352ca0, fd=3D24)
    at=20
/home/jvennin/projects/libraries/cruise/providers/cruise=5Fremote/remote=5F=
cruise=5Fserver/client=5Fhandler.cpp:122
#4  0x0000002a95a8f49e in=20
ACE=5FSelect=5FReactor=5FT<ACE=5FReactor=5FToken=5FT<ACE=5FToken> >::notify=
=5Fhandle=20
(this=3D0x674a70, handle=3D24, mask=3D2, ready=5Fmask=3D@0x675048,=20
    event=5Fhandler=3D0x7352ca0, ptmf=3D{=5F=5Fpfn =3D 0x39, =5F=5Fdelta =
=3D 0}) at=20
.../../ace/Select=5FReactor=5FT.cpp:814
#5  0x0000002a95a8f2c6 in=20
ACE=5FSelect=5FReactor=5FT<ACE=5FReactor=5FToken=5FT<ACE=5FToken> >::dispat=
ch=5Fio=5Fset=20
(this=3D0x674a70, number=5Fof=5Factive=5Fhandles=3D4,=20
    number=5Fof=5Fhandlers=5Fdispatched=3D@0x7fbfffe894, mask=3D2,=20
dispatch=5Fmask=3DVariable "dispatch=5Fmask" is not available.
) at ../../ace/Select=5FReactor=5FBase.inl:45
#6  0x0000002a95a8f10d in ACE=5FSelect=5FReactor





However, at the begin of my application I though  catched this signal=20
using this code:
#if !defined (ACE=5FWIN32)
         // Handle the SIGPIPE signal through the <ACE=5FReactor>.
        if (ACE=5FReactor::instance ()->register=5Fhandler(SIGPIPE, &server=
=5F)=20
=3D=3D -1) {
                ACE=5FDEBUG((MY=5FERROR "[application] Impossible to regist=
er=20
SIGPIPE event\n"));=20
                return -1;
        }
#endif

server=5F is an ACE=5FTask.

The problem arrives when I write on the socket:

ACE=5FMessage=5FBlock* msg;
        ACE=5FTime=5FValue nowait(ACE=5FOS::gettimeofday());
        ACE=5FTime=5FValue to(0,100);
        if(outputMessage=5F.dequeue=5Fhead(msg, &nowait) >=3D 0) {
=20
                ssize=5Ft send=5Fcnt =3D sock=5F.send(msg->rd=5Fptr(),=20
msg->length(), &to);


Any idea to resolve this issue ?

Jo=EBl=20
--=_alternative 004800E0C1257577_=
Content-Type: text/html; charset="ISO-8859-1"
Content-Transfer-Encoding: quoted-printable


<br><tt><font size=3D2>ACE VERSION: 5.6.8</font></tt><font size=3D3><br>
</font><tt><font size=3D2><br>
HOST MACHINE and OPERATING SYSTEM:<br>
Linux Debian on x86<br>
<br>
COMPILER NAME AND VERSION (AND PATCHLEVEL):</font></tt><font size=3D3> </fo=
nt><tt><font size=3D2><br>
 g++-4.1.2<br>
<br>
THE $ACE=5FROOT/ace/config.h:<br>
 config-linux.h<br>
<br>
THE $ACE=5FROOT/include/makeinclude/platform=5Fmacros.GNU FILE:<br>
 platform=5Flinux.GNU<br>
<br>
CONTENTS OF $ACE=5FROOT/bin/MakeProjectCreator/config/default.features<br>
 (unmodified):<br>
<br>
AREA/CLASS/EXAMPLE AFFECTED:<br>
 &nbsp; Signal<br>
<br>
DOES THE PROBLEM AFFECT:<br>
 &nbsp; &nbsp;EXECUTION? YES</font></tt><font size=3D3> <br>
</font>
<br>
<br><font size=3D3>I've a client/server application, and sometime when a
client is disconnected i get a SIGPIPE signal,</font>
<br><font size=3D3>this is the following stack trace.</font>
<br>
<br>
<br>
<br><font size=3D3>Program received signal SIGPIPE, Broken pipe.</font>
<br><font size=3D3>[Switching to Thread 182915886656 (LWP 4637)]</font>
<br><font size=3D3>0x0000003f0e50b10f in =5F=5Fwrite=5Fnocancel () from /li=
b64/tls/libpthread.so.0</font>
<br><font size=3D3>(gdb) bt</font>
<br><font size=3D3>#0 &nbsp;0x0000003f0e50b10f in =5F=5Fwrite=5Fnocancel ()=
 from
/lib64/tls/libpthread.so.0</font>
<br><font size=3D3>#1 &nbsp;0x0000002a95a7d54d in ACE::send (handle=3D24, b=
uf=3D0x2ad3b30010,
n=3D85, timeout=3DVariable &quot;timeout&quot; is not available.</font>
<br><font size=3D3>) at ../../ace/OS=5FNS=5Funistd.inl:1163</font>
<br><font size=3D3>#2 &nbsp;0x000000000043db02 in ACE=5FSOCK=5FIO::send (th=
is=3D0x7352cd4,
buf=3D0x2ad3b30010, len=3D85, timeout=3D0x7fbfffe6f0)</font>
<br><font size=3D3>&nbsp; &nbsp; at /home/jvennin/projects/libraries/ace/in=
clude/ace/SOCK=5FIO.inl:96</font>
<br><font size=3D3>#3 &nbsp;0x000000000043fb19 in Cfm::Cruise::Fh::ClientHa=
ndler::handle=5Foutput
(this=3D0x7352ca0, fd=3D24)</font>
<br><font size=3D3>&nbsp; &nbsp; at /home/jvennin/projects/libraries/cruise=
/providers/cruise=5Fremote/remote=5Fcruise=5Fserver/client=5Fhandler.cpp:12=
2</font>
<br><font size=3D3>#4 &nbsp;0x0000002a95a8f49e in ACE=5FSelect=5FReactor=5F=
T&lt;ACE=5FReactor=5FToken=5FT&lt;ACE=5FToken&gt;
&gt;::notify=5Fhandle (this=3D0x674a70, handle=3D24, mask=3D2, ready=5Fmask=
=3D@0x675048,
</font>
<br><font size=3D3>&nbsp; &nbsp; event=5Fhandler=3D0x7352ca0, ptmf=3D{=5F=
=5Fpfn =3D 0x39,
=5F=5Fdelta =3D 0}) at ../../ace/Select=5FReactor=5FT.cpp:814</font>
<br><font size=3D3>#5 &nbsp;0x0000002a95a8f2c6 in ACE=5FSelect=5FReactor=5F=
T&lt;ACE=5FReactor=5FToken=5FT&lt;ACE=5FToken&gt;
&gt;::dispatch=5Fio=5Fset (this=3D0x674a70, number=5Fof=5Factive=5Fhandles=
=3D4, </font>
<br><font size=3D3>&nbsp; &nbsp; number=5Fof=5Fhandlers=5Fdispatched=3D@0x7=
fbfffe894,
mask=3D2, dispatch=5Fmask=3DVariable &quot;dispatch=5Fmask&quot; is not ava=
ilable.</font>
<br><font size=3D3>) at ../../ace/Select=5FReactor=5FBase.inl:45</font>
<br><font size=3D3>#6 &nbsp;0x0000002a95a8f10d in ACE=5FSelect=5FReactor</f=
ont>
<br>
<br>
<br>
<br>
<br>
<br><font size=3D3>However, at the begin of my application I though &nbsp;c=
atched
this signal using this code:</font>
<br><font size=3D3>#if !defined (ACE=5FWIN32)</font>
<br><font size=3D3>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;// Handle the
SIGPIPE signal through the &lt;ACE=5FReactor&gt;.</font>
<br><font size=3D3>&nbsp; &nbsp; &nbsp; &nbsp; if (ACE=5FReactor::instance
()-&gt;register=5Fhandler(SIGPIPE, &amp;server=5F) =3D=3D -1) {</font>
<br><font size=3D3>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; ACE=5FDEBUG((MY=5FERROR &quot;[application] Impossible to register
SIGPIPE event\n&quot;)); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; &nbsp;</font>
<br><font size=3D3>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; return -1;</font>
<br><font size=3D3>&nbsp; &nbsp; &nbsp; &nbsp; }</font>
<br><font size=3D3>#endif</font>
<br>
<br><font size=3D3>server=5F is an ACE=5FTask.</font>
<br>
<br><font size=3D3>The problem arrives when I write on the socket:</font>
<br>
<br><font size=3D3>ACE=5FMessage=5FBlock* msg;</font>
<br><font size=3D3>&nbsp; &nbsp; &nbsp; &nbsp; ACE=5FTime=5FValue nowait(AC=
E=5FOS::gettimeofday());</font>
<br><font size=3D3>&nbsp; &nbsp; &nbsp; &nbsp; ACE=5FTime=5FValue to(0,100)=
;</font>
<br><font size=3D3>&nbsp; &nbsp; &nbsp; &nbsp; if(outputMessage=5F.dequeue=
=5Fhead(msg,
&amp;nowait) &gt;=3D 0) {</font>
<br><font size=3D3>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; </font>
<br><font size=3D3>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;
&nbsp; ssize=5Ft send=5Fcnt =3D sock=5F.send(msg-&gt;rd=5Fptr(), msg-&gt;le=
ngth(),
&amp;to);</font>
<br>
<br>
<br><font size=3D2 face=3D"sans-serif">Any idea to resolve this issue ?</fo=
nt>
<br>
<br><font size=3D2 face=3D"sans-serif">Jo=EBl </font>
--=_alternative 004800E0C1257577_=--
0
Joel
3/12/2009 1:06:45 PM
comp.soft-sys.ace 20326 articles. 1 followers. marlow.andrew (167) is leader. Post Follow

1 Replies
3579 Views

Similar Articles

[PageSpeed] 39

Thanks for using the PRF Joel.

>ACE VERSION: 5.6.8
>
>HOST MACHINE and OPERATING SYSTEM:
>Linux Debian on x86
>
>COMPILER NAME AND VERSION (AND PATCHLEVEL):=20
> g++-4.1.2
>
>THE $ACE=5FROOT/ace/config.h:
> config-linux.h
>
>THE $ACE=5FROOT/include/makeinclude/platform=5Fmacros.GNU FILE:
> platform=5Flinux.GNU
>
>CONTENTS OF $ACE=5FROOT/bin/MakeProjectCreator/config/default.features
> (unmodified):
>
>AREA/CLASS/EXAMPLE AFFECTED:
>   Signal
>
>DOES THE PROBLEM AFFECT:
>    EXECUTION? YES=20
>
>
>I've a client/server application, and sometime when a client is=20
>disconnected i get a SIGPIPE signal,
>this is the following stack trace.
>
>
>
>Program received signal SIGPIPE, Broken pipe.
>[Switching to Thread 182915886656 (LWP 4637)]
>0x0000003f0e50b10f in =5F=5Fwrite=5Fnocancel () from /lib64/tls/libpthread.=
>so.0
>(gdb) bt
>#0  0x0000003f0e50b10f in =5F=5Fwrite=5Fnocancel () from=20
>/lib64/tls/libpthread.so.0
>#1  0x0000002a95a7d54d in ACE::send (handle=3D24, buf=3D0x2ad3b30010, n=3D8=
>5,=20
>timeout=3DVariable "timeout" is not available.
>) at ../../ace/OS=5FNS=5Funistd.inl:1163
>#2  0x000000000043db02 in ACE=5FSOCK=5FIO::send (this=3D0x7352cd4,=20
>buf=3D0x2ad3b30010, len=3D85, timeout=3D0x7fbfffe6f0)
>    at /home/jvennin/projects/libraries/ace/include/ace/SOCK=5FIO.inl:96
>#3  0x000000000043fb19 in Cfm::Cruise::Fh::ClientHandler::handle=5Foutput=20
>(this=3D0x7352ca0, fd=3D24)
>    at=20
>/home/jvennin/projects/libraries/cruise/providers/cruise=5Fremote/remote=5F=
>cruise=5Fserver/client=5Fhandler.cpp:122
>#4  0x0000002a95a8f49e in=20
>ACE=5FSelect=5FReactor=5FT<ACE=5FReactor=5FToken=5FT<ACE=5FToken> >::notify=
>=5Fhandle=20
>(this=3D0x674a70, handle=3D24, mask=3D2, ready=5Fmask=3D@0x675048,=20
>    event=5Fhandler=3D0x7352ca0, ptmf=3D{=5F=5Fpfn =3D 0x39, =5F=5Fdelta =
>=3D 0}) at=20
>../../ace/Select=5FReactor=5FT.cpp:814
>#5  0x0000002a95a8f2c6 in=20
>ACE=5FSelect=5FReactor=5FT<ACE=5FReactor=5FToken=5FT<ACE=5FToken> >::dispat=
>ch=5Fio=5Fset=20
>(this=3D0x674a70, number=5Fof=5Factive=5Fhandles=3D4,=20
>    number=5Fof=5Fhandlers=5Fdispatched=3D@0x7fbfffe894, mask=3D2,=20
>dispatch=5Fmask=3DVariable "dispatch=5Fmask" is not available.
>) at ../../ace/Select=5FReactor=5FBase.inl:45
>#6  0x0000002a95a8f10d in ACE=5FSelect=5FReactor
>
>
>
>
>
>However, at the begin of my application I though  catched this signal=20
>using this code:
>#if !defined (ACE=5FWIN32)
>         // Handle the SIGPIPE signal through the <ACE=5FReactor>.
>        if (ACE=5FReactor::instance ()->register=5Fhandler(SIGPIPE, &server=
>=5F)=20
>=3D=3D -1) {
>                ACE=5FDEBUG((MY=5FERROR "[application] Impossible to regist=
>er=20
>SIGPIPE event\n"));=20
>                return -1;
>        }
>#endif
>
>server=5F is an ACE=5FTask.
>
>The problem arrives when I write on the socket:
>
>ACE=5FMessage=5FBlock* msg;
>        ACE=5FTime=5FValue nowait(ACE=5FOS::gettimeofday());
>        ACE=5FTime=5FValue to(0,100);
>        if(outputMessage=5F.dequeue=5Fhead(msg, &nowait) >=3D 0) {
>=20
>                ssize=5Ft send=5Fcnt =3D sock=5F.send(msg->rd=5Fptr(),=20
>msg->length(), &to);
>
>
>Any idea to resolve this issue ?

There are examples of how to catch signals with the Reactor in

ACE_ROOT/examples/Reactor/Misc/test_signals_1.cpp
ACE_ROOT/examples/Reactor/Misc/test_signals_2.cpp

I recommend you check out how these examples work and see if you can
apply them to your solution.

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@vanderbilt.edu
0
schmidt
3/12/2009 2:47:10 PM
Reply: