[ 
https://issues.apache.org/jira/browse/PROTON-372?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bozo Dragojevic updated PROTON-372:
-----------------------------------

    Attachment: confuse-driver.py

running against

PN_TRACE_RAW=1 PN_TRACE_FRM=1 PN_TRACE_DRV=1 tests/tools/apps/c/msgr-recv  -a 
amqp://~0.0.0.0:55555/rcv -R -N msgr-recv -V -w100 -W100


running confuse-driver.py once kicks messenger into a busy loop.

If I run it once more it usually ends up in a segfault:

[0x100878000:1] <- @begin [remote-channel=1, next-outgoing-id=0, 
incoming-window=2147483647, outgoing-window=0]

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000aa0
0x0000000100021273 in pn_do_begin (disp=0x100878000) at 
/Users/bozzo/XLII/blpapi-reference/qpid-proton/proton-c/src/engine/engine.c:1684
1684      ssn->state.incoming_transfer_count = next;
(gdb) where
#0  0x0000000100021273 in pn_do_begin (disp=0x100878000) at 
/Users/bozzo/XLII/blpapi-reference/qpid-proton/proton-c/src/engine/engine.c:1684
#1  0x000000010001cf92 in pn_dispatch_frame (disp=0x100878000, frame={type = 0 
'\0', channel = 1, ex_size = 0, extended = 0x100874008 "", size = 24, payload = 
0x100874008 ""}) at 
/Users/bozzo/XLII/blpapi-reference/qpid-proton/proton-c/src/dispatcher/dispatcher.c:151
#2  0x000000010001d2b6 in pn_dispatcher_input (disp=0x100878000, 
bytes=0x100874000 "", available=87) at 
/Users/bozzo/XLII/blpapi-reference/qpid-proton/proton-c/src/dispatcher/dispatcher.c:174
#3  0x000000010002a77d in pn_input_read_amqp (io_layer=0x10086f9e0, 
bytes=0x100874000 "", available=119) at 
/Users/bozzo/XLII/blpapi-reference/qpid-proton/proton-c/src/engine/engine.c:2233
#4  0x0000000100020df4 in pn_io_layer_input_passthru (io_layer=0x10086f9a8, 
data=0x100874000 "", available=119) at 
/Users/bozzo/XLII/blpapi-reference/qpid-proton/proton-c/src/engine/engine.c:3273
#5  0x0000000100020df4 in pn_io_layer_input_passthru (io_layer=0x10086f970, 
data=0x100874000 "", available=119) at 
/Users/bozzo/XLII/blpapi-reference/qpid-proton/proton-c/src/engine/engine.c:3273
#6  0x0000000100022a05 in transport_consume (transport=0x10086f400) at 
/Users/bozzo/XLII/blpapi-reference/qpid-proton/proton-c/src/engine/engine.c:2154
#7  0x0000000100026b77 in pn_transport_push (transport=0x10086f400, size=119) 
at 
/Users/bozzo/XLII/blpapi-reference/qpid-proton/proton-c/src/engine/engine.c:3342
#8  0x0000000100037167 in pn_connector_process (c=0x10011d500) at 
/Users/bozzo/XLII/blpapi-reference/qpid-proton/proton-c/src/posix/driver.c:578
#9  0x0000000100030f66 in pn_messenger_tsync (messenger=0x100101430, 
predicate=0x100032d40 <pn_messenger_rcvd>, timeout=-1) at 
/Users/bozzo/XLII/blpapi-reference/qpid-proton/proton-c/src/messenger/messenger.c:679
#10 0x0000000100031122 in pn_messenger_sync (messenger=0x100101430, 
predicate=0x100032d40 <pn_messenger_rcvd>) at 
/Users/bozzo/XLII/blpapi-reference/qpid-proton/proton-c/src/messenger/messenger.c:710
#11 0x00000001000330b4 in pn_messenger_recv (messenger=0x100101430, n=-1) at 
/Users/bozzo/XLII/blpapi-reference/qpid-proton/proton-c/src/messenger/messenger.c:1286
#12 0x0000000100001d23 in main (argc=9, argv=0x7fff5fbff978) at 
/Users/bozzo/XLII/blpapi-reference/qpid-proton/tests/tools/apps/c/msgr-recv.c:215
Current language:  auto; currently minimal
(gdb)
                
> driver does not handle POLLHUP
> ------------------------------
>
>                 Key: PROTON-372
>                 URL: https://issues.apache.org/jira/browse/PROTON-372
>             Project: Qpid Proton
>          Issue Type: Bug
>          Components: proton-c
>    Affects Versions: 0.5
>         Environment: osx
>            Reporter: Bozo Dragojevic
>         Attachments: confuse-driver.py
>
>
> If a peer closes the socket at an inopportune time poll() will start 
> returning POLLHUP but not POLLERR. this drives messenger into a busyloop as 
> the driver does not check this flag.
> The messenger instance is still able to service other connections but it's 
> doing so at 100% cpu load as every poll() call returns immediately.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to