You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@qpid.apache.org by GitBox <gi...@apache.org> on 2021/01/25 15:19:38 UTC

[GitHub] [qpid-dispatch] ChugR opened a new pull request #997: DISPATCH-1927: Don't operate on empty undelivered list

ChugR opened a new pull request #997:
URL: https://github.com/apache/qpid-dispatch/pull/997


   Depending on timing the work may have been done the adaptor
   deliver handler.


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[GitHub] [qpid-dispatch] ChugR closed pull request #997: DISPATCH-1927: Don't operate on empty undelivered list

Posted by GitBox <gi...@apache.org>.
ChugR closed pull request #997:
URL: https://github.com/apache/qpid-dispatch/pull/997


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[GitHub] [qpid-dispatch] kgiusti commented on a change in pull request #997: DISPATCH-1927: Don't operate on empty undelivered list

Posted by GitBox <gi...@apache.org>.
kgiusti commented on a change in pull request #997:
URL: https://github.com/apache/qpid-dispatch/pull/997#discussion_r563821097



##########
File path: src/router_core/transfer.c
##########
@@ -222,10 +222,12 @@ int qdr_link_process_deliveries(qdr_core_t *core, qdr_link_t *link, int credit)
                     }
                 }
                 else if (new_disp == QD_DELIVERY_MOVED_TO_NEW_LINK) {
-                    DEQ_REMOVE_HEAD(link->undelivered);
-                    dlv->link_work = 0;
-                    dlv->where = QDR_DELIVERY_NOWHERE;
-                    qdr_delivery_decref(core, dlv, "qdr_link_process_deliveries - moved from undelivered list to some other link");
+                    if (DEQ_HEAD(link->undelivered) != 0) {

Review comment:
       IIUC this check is necessary since the call into the delivery_handler may have already removed the head delivery, correct?
   
   If the delivery_handler has modified the list can we be sure that - if DEQ_HEAD(link->undelivered) !=0 - the head delivery is the same delivery as "dlv"?  This may be a good place for an assert(DEQ_HEAD(link->undelivered) == dlv) to ensure that this expectation doesn't silently break at some point.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[GitHub] [qpid-dispatch] ChugR commented on pull request #997: DISPATCH-1927: Don't operate on empty undelivered list

Posted by GitBox <gi...@apache.org>.
ChugR commented on pull request #997:
URL: https://github.com/apache/qpid-dispatch/pull/997#issuecomment-766902938


   This patch reveals other problems. Letting the test run longer leads to a nasty crash:
   
   ` Core was generated by qdrouterd -c A.conf`
   `Program terminated with signal SIGSEGV, Segmentation fault.`
   
   `warning: Unexpected size of section `.reg-xstate/800006' in core file.`
   `#0  0x00007f4ed2f7db8d in qd_alloc_init (desc=0x9999999999999999) at /home/chug/git/qpid-dispatch/src/alloc_pool.c:269`
   `269	    sys_mutex_lock(init_lock);`
   `[Current thread is 1 (Thread 0x7f4ec4863700 (LWP 800006))]`
   `(gdb) bt`
   
   `#0  0x00007f4ed2f7db8d in qd_alloc_init (desc=0x9999999999999999) at /home/chug/git/qpid-dispatch/src/alloc_pool.c:269`
   
   `#1  0x00007f4ed2fccd67 in deactivate_route_connection (core=0x9999999999999999, conn=0x9999999999999999, cid=0x7f4ed2fccd67 <deactivate_route_connection+101>) at /home/chug/git/qpid-dispatch/src/router_core/route_control.c:626`
   
   `#2  0x00007f4ed2fbecaa in _receiver_second_attach_CT (context=0x7f4ed2fbecaa <_receiver_second_attach_CT+155>, remote_source=0x7f4ec4862140, remote_target=0x7f4ed2fd2a53 <qdr_global_stats_request_CT+532>)
       at /home/chug/git/qpid-dispatch/src/router_core/core_client_api.c:423`
   
   `#3  0x00007f4ed2fbf77d in _receiver_detached_CT (client_context=0x7f4eb40cb8d0, error=0x7f4eb40cb8d0) at /home/chug/git/qpid-dispatch/src/router_core/core_client_api.c:620`
   
   `#4  0x00007f4ed2fb6e97 in qdr_link_first_attach (conn=0x136b4a0, dir=(unknown: 32590), source=0x0, target=0x0, name=0x0, terminus_addr=0x0, no_route=208, initial_delivery=0x7f00d3048140, link_id=0x7f4eb403a050)
       at /home/chug/git/qpid-dispatch/src/router_core/connections.c:589`
   
   `#5  0x00007f4ed2fbaee5 in qdr_link_inbound_first_attach_CT (core=0x1, action=0x0, discard=78) at /home/chug/git/qpid-dispatch/src/router_core/connections.c:1696`
   
   `#6  0x00007f4ed2fd2d04 in qdr_protocol_adaptor (core=0x7f4ec0247810, name=0x0, context=0x2, activate=0x7f4eb403a050, first_attach=0x7f4eb005ca90, second_attach=0x7f4eb005a910, detach=0x0, flow=0x13d7b50, offer=0x0, drained=0x0, 
       drain=0x0, push=0x7f4ed2e754e2 <start_thread+226>, deliver=0x0, get_credit=0x7f4ec4863700, delivery_update=0x7f4ec4863700, conn_close=0x650f95d19ef944ca, conn_trace=0x7fff8d30d4de)
       at /home/chug/git/qpid-dispatch/src/router_core/router_core.c:1030`
   
   `#7  0x00007f4ed2fa57be in remote_sasl_max_encrypt_size (transport=0x7f4ed2fa57be <remote_sasl_max_encrypt_size+4>) at /home/chug/git/qpid-dispatch/src/remote_sasl.c:469`
   
   `#8  0x00000000013d7b50 in ?? ()`
   
   `#9  0x0000000000000000 in ?? ()`
   
   `(gdb) `
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[GitHub] [qpid-dispatch] kgiusti commented on a change in pull request #997: DISPATCH-1927: Don't operate on empty undelivered list

Posted by GitBox <gi...@apache.org>.
kgiusti commented on a change in pull request #997:
URL: https://github.com/apache/qpid-dispatch/pull/997#discussion_r563821097



##########
File path: src/router_core/transfer.c
##########
@@ -222,10 +222,12 @@ int qdr_link_process_deliveries(qdr_core_t *core, qdr_link_t *link, int credit)
                     }
                 }
                 else if (new_disp == QD_DELIVERY_MOVED_TO_NEW_LINK) {
-                    DEQ_REMOVE_HEAD(link->undelivered);
-                    dlv->link_work = 0;
-                    dlv->where = QDR_DELIVERY_NOWHERE;
-                    qdr_delivery_decref(core, dlv, "qdr_link_process_deliveries - moved from undelivered list to some other link");
+                    if (DEQ_HEAD(link->undelivered) != 0) {

Review comment:
       IIUC this check is necessary since the call into the delivery_handler may have already removed the head delivery, correct?
   
   If the delivery_handler has modified the list can we be sure that - if DEQ_HEAD(link->undelivered) !=0 - the head delivery is the same delivery as "dlv"?  This may be a good place for an assert(DEQ_HEAD(link->undelivered) == dlv) to ensure that this expectation doesn't silently break at some point.




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[GitHub] [qpid-dispatch] ChugR commented on pull request #997: DISPATCH-1927: Don't operate on empty undelivered list

Posted by GitBox <gi...@apache.org>.
ChugR commented on pull request #997:
URL: https://github.com/apache/qpid-dispatch/pull/997#issuecomment-766902938


   This patch reveals other problems. Letting the test run longer leads to a nasty crash:
   
   ` Core was generated by qdrouterd -c A.conf`
   `Program terminated with signal SIGSEGV, Segmentation fault.`
   
   `warning: Unexpected size of section `.reg-xstate/800006' in core file.`
   `#0  0x00007f4ed2f7db8d in qd_alloc_init (desc=0x9999999999999999) at /home/chug/git/qpid-dispatch/src/alloc_pool.c:269`
   `269	    sys_mutex_lock(init_lock);`
   `[Current thread is 1 (Thread 0x7f4ec4863700 (LWP 800006))]`
   `(gdb) bt`
   
   `#0  0x00007f4ed2f7db8d in qd_alloc_init (desc=0x9999999999999999) at /home/chug/git/qpid-dispatch/src/alloc_pool.c:269`
   
   `#1  0x00007f4ed2fccd67 in deactivate_route_connection (core=0x9999999999999999, conn=0x9999999999999999, cid=0x7f4ed2fccd67 <deactivate_route_connection+101>) at /home/chug/git/qpid-dispatch/src/router_core/route_control.c:626`
   
   `#2  0x00007f4ed2fbecaa in _receiver_second_attach_CT (context=0x7f4ed2fbecaa <_receiver_second_attach_CT+155>, remote_source=0x7f4ec4862140, remote_target=0x7f4ed2fd2a53 <qdr_global_stats_request_CT+532>)
       at /home/chug/git/qpid-dispatch/src/router_core/core_client_api.c:423`
   
   `#3  0x00007f4ed2fbf77d in _receiver_detached_CT (client_context=0x7f4eb40cb8d0, error=0x7f4eb40cb8d0) at /home/chug/git/qpid-dispatch/src/router_core/core_client_api.c:620`
   
   `#4  0x00007f4ed2fb6e97 in qdr_link_first_attach (conn=0x136b4a0, dir=(unknown: 32590), source=0x0, target=0x0, name=0x0, terminus_addr=0x0, no_route=208, initial_delivery=0x7f00d3048140, link_id=0x7f4eb403a050)
       at /home/chug/git/qpid-dispatch/src/router_core/connections.c:589`
   
   `#5  0x00007f4ed2fbaee5 in qdr_link_inbound_first_attach_CT (core=0x1, action=0x0, discard=78) at /home/chug/git/qpid-dispatch/src/router_core/connections.c:1696`
   
   `#6  0x00007f4ed2fd2d04 in qdr_protocol_adaptor (core=0x7f4ec0247810, name=0x0, context=0x2, activate=0x7f4eb403a050, first_attach=0x7f4eb005ca90, second_attach=0x7f4eb005a910, detach=0x0, flow=0x13d7b50, offer=0x0, drained=0x0, 
       drain=0x0, push=0x7f4ed2e754e2 <start_thread+226>, deliver=0x0, get_credit=0x7f4ec4863700, delivery_update=0x7f4ec4863700, conn_close=0x650f95d19ef944ca, conn_trace=0x7fff8d30d4de)
       at /home/chug/git/qpid-dispatch/src/router_core/router_core.c:1030`
   
   `#7  0x00007f4ed2fa57be in remote_sasl_max_encrypt_size (transport=0x7f4ed2fa57be <remote_sasl_max_encrypt_size+4>) at /home/chug/git/qpid-dispatch/src/remote_sasl.c:469`
   
   `#8  0x00000000013d7b50 in ?? ()`
   
   `#9  0x0000000000000000 in ?? ()`
   
   `(gdb) `
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org


[GitHub] [qpid-dispatch] ChugR closed pull request #997: DISPATCH-1927: Don't operate on empty undelivered list

Posted by GitBox <gi...@apache.org>.
ChugR closed pull request #997:
URL: https://github.com/apache/qpid-dispatch/pull/997


   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
For additional commands, e-mail: dev-help@qpid.apache.org