Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fail to upload long Blob using mbedtls+compact(Issue #1995) #536

Merged

Conversation

maallahatem
Copy link
Contributor

@maallahatem maallahatem commented Jun 18, 2021

Hello,
The aim of this pull request is to propose a fix for the bug Fail to upload long Blob using mbedtls+compact #1995
Note, that the other part of the solution is available a PR on the azure-iot-sdk-c repository #2004

Regard
Hatem

@ericwolz ericwolz requested review from jspaith and ewertons June 18, 2021 17:56
@@ -235,7 +235,7 @@ HTTP_HANDLE HTTPAPI_CreateConnection(const char* hostName)
tlsio_config.port = 443;
tlsio_config.underlying_io_interface = NULL;
tlsio_config.underlying_io_parameters = NULL;

tlsio_config.protocol="http";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @maallahatem , thank you very much for the PR.
I have a few points about the code change though.

  1. The TLS layer should not be tied to any specific protocol, so the best way would be create a flag in the tlsio_config structure like "invoke_on_send_complete_callback_for_fragments" (true/false);
  2. I am concerned about the behavior of the upper layer if it now starts firing multiple on_send_complete for a single send (single from an upper layer perspective) - I will need to test to make sure this is not a breaking change for the SDK;
  3. I need to double check if something need to be done on the other tlsio_* adapters for this new flag, in case they also need to consume it or document that they ignore it completely.

For now if you could address item 1 above, I'll work on items 2 and 3 within the next week.

Thanks!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @maallahatem , I see you made the changes. We will verify them next.

@@ -1408,6 +1408,7 @@ HTTPAPI_RESULT HTTPAPI_SetOption(HTTP_HANDLE handle, const char* optionName, con
tlsio_config.port = 443;
tlsio_config.underlying_io_interface = http_proxy_io_get_interface_description();
tlsio_config.underlying_io_parameters = &proxy_config;
tlsio_config.invoke_on_send_complete_callback_for_fragments=true;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
tlsio_config.invoke_on_send_complete_callback_for_fragments=true;
tlsio_config.invoke_on_send_complete_callback_for_fragments = true;

{
// trigger callback always on failure, otherwise call it on last fragment completion
// In case of http communication (ie blob upload), The callback is called with each fragment
if((tls_io_instance->invoke_on_send_complete_callback_for_fragments && tls_io_instance->send_complete_info.is_fragmented_req)||
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if((tls_io_instance->invoke_on_send_complete_callback_for_fragments && tls_io_instance->send_complete_info.is_fragmented_req)||
if ((tls_io_instance->invoke_on_send_complete_callback_for_fragments && tls_io_instance->send_complete_info.is_fragmented_req)||

@ericwolz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ericwolz

This comment has been minimized.

@ericwolz
Copy link
Contributor

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ericwolz
Copy link
Contributor

Still unit test failures

2021-06-25T18:29:36.9899908Z ==3366== HEAP SUMMARY:
2021-06-25T18:29:36.9900500Z ==3366== in use at exit: 81,264 bytes in 6 blocks
2021-06-25T18:29:36.9901248Z ==3366== total heap usage: 8,765 allocs, 8,759 frees, 1,409,456 bytes allocated
2021-06-25T18:29:36.9901866Z ==3366==
2021-06-25T18:29:36.9902514Z ==3366== 40,632 (40,608 direct, 24 indirect) bytes in 1 blocks are definitely lost in loss record 5 of 6
2021-06-25T18:29:36.9903628Z ==3366== at 0x4C31B25: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
2021-06-25T18:29:36.9904895Z ==3366== by 0x125FD6: my_gballoc_calloc (in /__w/20/s/cmake/shared-util_linux/tests/tlsio_mbedtls_ut/tlsio_mbedtls_ut_exe)
2021-06-25T18:29:36.9906190Z ==3366== by 0x12F2F6: gballoc_calloc (in /__w/20/s/cmake/shared-util_linux/tests/tlsio_mbedtls_ut/tlsio_mbedtls_ut_exe)
2021-06-25T18:29:36.9907495Z ==3366== by 0x2BA0BC: tlsio_mbedtls_create (in /__w/20/s/cmake/shared-util_linux/tests/tlsio_mbedtls_ut/tlsio_mbedtls_ut_exe)
2021-06-25T18:29:36.9908886Z ==3366== by 0x2B6677: tlsio_mbedtls_send_large_payload_failure (in /__w/20/s/cmake/shared-util_linux/tests/tlsio_mbedtls_ut/tlsio_mbedtls_ut_exe)
2021-06-25T18:29:36.9910213Z ==3366== by 0x2C193B: RunTests (in /__w/20/s/cmake/shared-util_linux/tests/tlsio_mbedtls_ut/tlsio_mbedtls_ut_exe)
2021-06-25T18:29:36.9911454Z ==3366== by 0x2BBB92: main (in /__w/20/s/cmake/shared-util_linux/tests/tlsio_mbedtls_ut/tlsio_mbedtls_ut_exe)
2021-06-25T18:29:36.9912201Z ==3366==
2021-06-25T18:29:36.9912802Z {
2021-06-25T18:29:36.9913297Z <insert_a_suppression_name_here>
2021-06-25T18:29:36.9913833Z Memcheck:Leak
2021-06-25T18:29:36.9914621Z match-leak-kinds: definite
2021-06-25T18:29:36.9915204Z fun:calloc
2021-06-25T18:29:36.9915699Z fun:my_gballoc_calloc
2021-06-25T18:29:36.9916207Z fun:gballoc_calloc
2021-06-25T18:29:36.9916732Z fun:tlsio_mbedtls_create
2021-06-25T18:29:36.9917302Z fun:tlsio_mbedtls_send_large_payload_failure
2021-06-25T18:29:36.9917849Z fun:RunTests
2021-06-25T18:29:36.9918318Z fun:main
2021-06-25T18:29:36.9918756Z }
2021-06-25T18:29:36.9919400Z ==3366== 40,632 (40,608 direct, 24 indirect) bytes in 1 blocks are definitely lost in loss record 6 of 6
2021-06-25T18:29:36.9920518Z ==3366== at 0x4C31B25: calloc (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
2021-06-25T18:29:36.9921909Z ==3366== by 0x125FD6: my_gballoc_calloc (in /__w/20/s/cmake/shared-util_linux/tests/tlsio_mbedtls_ut/tlsio_mbedtls_ut_exe)
2021-06-25T18:29:36.9923232Z ==3366== by 0x12F2F6: gballoc_calloc (in /__w/20/s/cmake/shared-util_linux/tests/tlsio_mbedtls_ut/tlsio_mbedtls_ut_exe)
2021-06-25T18:29:36.9924625Z ==3366== by 0x2BA0BC: tlsio_mbedtls_create (in /__w/20/s/cmake/shared-util_linux/tests/tlsio_mbedtls_ut/tlsio_mbedtls_ut_exe)
2021-06-25T18:29:36.9926174Z ==3366== by 0x2B5F49: tlsio_mbedtls_send_large_payload_success (in /__w/20/s/cmake/shared-util_linux/tests/tlsio_mbedtls_ut/tlsio_mbedtls_ut_exe)
2021-06-25T18:29:36.9927569Z ==3366== by 0x2C193B: RunTests (in /__w/20/s/cmake/shared-util_linux/tests/tlsio_mbedtls_ut/tlsio_mbedtls_ut_exe)
2021-06-25T18:29:36.9928852Z ==3366== by 0x2BBB92: main (in /__w/20/s/cmake/shared-util_linux/tests/tlsio_mbedtls_ut/tlsio_mbedtls_ut_exe)
2021-06-25T18:29:36.9929582Z ==3366==
2021-06-25T18:29:36.9930022Z {
2021-06-25T18:29:36.9930518Z <insert_a_suppression_name_here>
2021-06-25T18:29:36.9931052Z Memcheck:Leak
2021-06-25T18:29:36.9931788Z match-leak-kinds: definite
2021-06-25T18:29:36.9932373Z fun:calloc
2021-06-25T18:29:36.9932896Z fun:my_gballoc_calloc
2021-06-25T18:29:36.9933472Z fun:gballoc_calloc
2021-06-25T18:29:36.9933977Z fun:tlsio_mbedtls_create
2021-06-25T18:29:36.9934547Z fun:tlsio_mbedtls_send_large_payload_success
2021-06-25T18:29:36.9935092Z fun:RunTests
2021-06-25T18:29:36.9935576Z fun:main
2021-06-25T18:29:36.9936010Z }
2021-06-25T18:29:36.9936460Z ==3366== LEAK SUMMARY:
2021-06-25T18:29:36.9937033Z ==3366== definitely lost: 81,216 bytes in 2 blocks
2021-06-25T18:29:36.9937704Z ==3366== indirectly lost: 48 bytes in 4 blocks
2021-06-25T18:29:36.9938659Z ==3366== possibly lost: 0 bytes in 0 blocks
2021-06-25T18:29:36.9939367Z ==3366== still reachable: 0 bytes in 0 blocks
2021-06-25T18:29:36.9940001Z ==3366== suppressed: 0 bytes in 0 blocks
2021-06-25T18:29:36.9940561Z ==3366==
2021-06-25T18:29:36.9941505Z ==3366== For counts of detected and suppressed errors, rerun with: -v
2021-06-25T18:29:36.9942580Z ==3366== ERROR SUMMARY: 2 errors from 2 contexts (suppressed: 0 from 0)

@maallahatem
Copy link
Contributor Author

I'm using Valgrind on my side and everything feels fine

valgrind  --leak-check=full ./tlsio_mbedtls_ut_exe
==3398== Memcheck, a memory error detector
==3398== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==3398== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==3398== Command: ./tlsio_mbedtls_ut_exe
==3398== 
 === Executing test suite tlsio_mbedtls_ut ===
Executing test tlsio_mbedtls_setoption_renegotiation_value_NULL_fail ...
Error: Time:Mon Jun 28 12:34:01 2021 File:/home/hatem/work/azure-c-shared-utility/adapters/tlsio_mbedtls.c Func:tlsio_mbedtls_setoption Line:1024 Invalid value set for tls renegotiation
Test tlsio_mbedtls_setoption_renegotiation_value_NULL_fail result = Succeeded.
Executing test tlsio_mbedtls_setoption_renegotiation_success ...
Test tlsio_mbedtls_setoption_renegotiation_success result = Succeeded.
Executing test tlsio_mbedtls_setoption_certificate_key_success ...
Test tlsio_mbedtls_setoption_certificate_key_success result = Succeeded.
Executing test tlsio_mbedtls_setoption_certificate_success ...
Test tlsio_mbedtls_setoption_certificate_success result = Succeeded.
Executing test tlsio_on_io_recv_context_NULL_success ...
Error: Time:Mon Jun 28 12:34:01 2021 File:/home/hatem/work/azure-c-shared-utility/adapters/tlsio_mbedtls.c Func:on_io_recv Line:288 Invalid context NULL value passed
Test tlsio_on_io_recv_context_NULL_success result = Succeeded.
Executing test tlsio_on_io_recv_success ...
Test tlsio_on_io_recv_success result = Succeeded.
Executing test tlsio_on_io_recv_timeout_success ...
Test tlsio_on_io_recv_timeout_success result = Succeeded.
Executing test tlsio_on_underlying_io_bytes_received_success ...
Test tlsio_on_underlying_io_bytes_received_success result = Succeeded.
Executing test tlsio_mbedtls_dowork_w_data_success ...
Test tlsio_mbedtls_dowork_w_data_success result = Succeeded.
Executing test tlsio_mbedtls_dowork_success ...
Test tlsio_mbedtls_dowork_success result = Succeeded.
Executing test tlsio_mbedtls_dowork_handle_NULL_fail ...
Test tlsio_mbedtls_dowork_handle_NULL_fail result = Succeeded.
Executing test tlsio_mbedtls_send_large_payload_failure ...
Error: Time:Mon Jun 28 12:34:01 2021 File:/home/hatem/work/azure-c-shared-utility/adapters/tlsio_mbedtls.c Func:tlsio_mbedtls_send Line:757 Failed to send last fragment with error:0x2, aborting whole send
Test tlsio_mbedtls_send_large_payload_failure result = Succeeded.
Executing test tlsio_mbedtls_send_large_payload_success ...
Test tlsio_mbedtls_send_large_payload_success result = Succeeded.
Executing test tlsio_mbedtls_send_failure ...
Error: Time:Mon Jun 28 12:34:01 2021 File:/home/hatem/work/azure-c-shared-utility/adapters/tlsio_mbedtls.c Func:tlsio_mbedtls_send Line:751 Unexpected data size returned from  mbedtls_ssl_write -1/3
Test tlsio_mbedtls_send_failure result = Succeeded.
Executing test tlsio_mbedtls_send_success ...
Test tlsio_mbedtls_send_success result = Succeeded.
Executing test tlsio_mbedtls_send_not_open_fail ...
Error: Time:Mon Jun 28 12:34:01 2021 File:/home/hatem/work/azure-c-shared-utility/adapters/tlsio_mbedtls.c Func:tlsio_mbedtls_send Line:732 Invalid state specified 0
Test tlsio_mbedtls_send_not_open_fail result = Succeeded.
Executing test tlsio_mbedtls_send_handle_NULL_fail ...
Error: Time:Mon Jun 28 12:34:01 2021 File:/home/hatem/work/azure-c-shared-utility/adapters/tlsio_mbedtls.c Func:tlsio_mbedtls_send Line:724 Invalid parameter specified tls_io: (nil), buffer: 0x2ce946, size: 3l
Test tlsio_mbedtls_send_handle_NULL_fail result = Succeeded.
Executing test tlsio_mbedtls_close_multiple_calls_fail ...
Error: Time:Mon Jun 28 12:34:01 2021 File:/home/hatem/work/azure-c-shared-utility/adapters/tlsio_mbedtls.c Func:tlsio_mbedtls_close Line:678 IO should not be closed: 4
Test tlsio_mbedtls_close_multiple_calls_fail result = Succeeded.
Executing test tlsio_mbedtls_close_success ...
Test tlsio_mbedtls_close_success result = Succeeded.
Executing test tlsio_mbedtls_close_handle_NULL_fail ...
Error: Time:Mon Jun 28 12:34:01 2021 File:/home/hatem/work/azure-c-shared-utility/adapters/tlsio_mbedtls.c Func:tlsio_mbedtls_close Line:668 Invalid parameter specified tls_io: NULL
Test tlsio_mbedtls_close_handle_NULL_fail result = Succeeded.
Executing test tlsio_entropy_poll_success ...
Test tlsio_entropy_poll_success result = Succeeded.
Executing test tlsio_mbedtls_open_fail ...
Error: Time:Mon Jun 28 12:34:01 2021 File:/home/hatem/work/azure-c-shared-utility/adapters/tlsio_mbedtls.c Func:tlsio_mbedtls_open Line:653 Underlying IO open failed
Test tlsio_mbedtls_open_fail result = Succeeded.
Executing test tlsio_mbedtls_open_multiple_calls_fail ...
Error: Time:Mon Jun 28 12:34:01 2021 File:/home/hatem/work/azure-c-shared-utility/adapters/tlsio_mbedtls.c Func:tlsio_mbedtls_open Line:631 IO should not be open: 1
Test tlsio_mbedtls_open_multiple_calls_fail result = Succeeded.
Executing test tlsio_mbedtls_open_succeed ...
Test tlsio_mbedtls_open_succeed result = Succeeded.
Executing test tlsio_mbedtls_open_handle_NULL_fail ...
Error: Time:Mon Jun 28 12:34:01 2021 File:/home/hatem/work/azure-c-shared-utility/adapters/tlsio_mbedtls.c Func:tlsio_mbedtls_open Line:622 Invalid parameter specified tls_io: NULL
Test tlsio_mbedtls_open_handle_NULL_fail result = Succeeded.
Executing test tlsio_mbedtls_destroy_handle_NULL_fail ...
Test tlsio_mbedtls_destroy_handle_NULL_fail result = Succeeded.
Executing test tlsio_mbedtls_destroy_succeed ...
Test tlsio_mbedtls_destroy_succeed result = Succeeded.
Executing test tlsio_mbedtls_create_fail ...
Error: Time:Mon Jun 28 12:34:02 2021 File:/home/hatem/work/azure-c-shared-utility/adapters/tlsio_mbedtls.c Func:tlsio_mbedtls_create Line:570 Failure allocating TLS object
Error: Time:Mon Jun 28 12:34:02 2021 File:/home/hatem/work/azure-c-shared-utility/adapters/tlsio_mbedtls.c Func:tlsio_mbedtls_create Line:550 Failure allocating hostname.
Test tlsio_mbedtls_create_fail result = Succeeded.
Executing test tlsio_mbedtls_create_succeed ...
Test tlsio_mbedtls_create_succeed result = Succeeded.
Executing test tlsio_mbedtls_create_config_NULL_fail ...
Error: Time:Mon Jun 28 12:34:02 2021 File:/home/hatem/work/azure-c-shared-utility/adapters/tlsio_mbedtls.c Func:tlsio_mbedtls_create Line:511 NULL tls_io_config
Test tlsio_mbedtls_create_config_NULL_fail result = Succeeded.
30 tests ran, 0 failed, 30 succeeded.
==3398== 
==3398== HEAP SUMMARY:
==3398==     in use at exit: 0 bytes in 0 blocks
==3398==   total heap usage: 8,708 allocs, 8,708 frees, 1,404,155 bytes allocated
==3398== 
==3398== All heap blocks were freed -- no leaks are possible
==3398== 
==3398== For lists of detected and suppressed errors, rerun with: -s
==3398== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

@ericwolz
Copy link
Contributor

We can't upgrade from valgrind 3.12 because there is no newer release on Ubuntu-18.04 I can look at adding valgrind suppressing rules.

There are still other failures as below.

2021-06-25T18:29:35.4783949Z [0mExecuting test tlsio_mbedtls_dowork_handle_NULL_fail ...
2021-06-25T18:29:35.4785214Z [32mTest tlsio_mbedtls_dowork_handle_NULL_fail result = Succeeded.
2021-06-25T18:29:35.4786499Z [0mExecuting test tlsio_mbedtls_send_large_payload_failure ...
2021-06-25T18:29:35.4787752Z Error: Time:Fri Jun 25 18:29:34 2021 File:/__w/20/s/adapters/tlsio_mbedtls.c Func:tlsio_mbedtls_send Line:758 Failed to send last fragment with error:0x2, aborting whole send
2021-06-25T18:29:35.4790290Z Assert failed in line 957 Expected: [mbedtls_ssl_get_max_frag_len((nil))][mbedtls_ssl_write((nil),0x52,2)][xio_send((nil),(nil),0,(nil),(nil))][on_send_complete((nil),IO_SEND_ERROR)], Actual: [on_send_complete((nil),IO_SEND_OK)][mbedtls_ssl_get_max_frag_len(0x557185ae5628)][mbedtls_ssl_write(0x557185ae5628,0x52,2)][xio_send(0x557185ae6940,0x52,2,0x557183de4a89,0x557185adbfe0)][on_send_complete((nil),IO_SEND_ERROR)]
2021-06-25T18:29:35.4793052Z [31mTest tlsio_mbedtls_send_large_payload_failure result = !!! FAILED !!!
2021-06-25T18:29:35.4794475Z [0mExecuting test tlsio_mbedtls_send_large_payload_success ...
2021-06-25T18:29:35.4796841Z Assert failed in line 912 Expected: [mbedtls_ssl_get_max_frag_len((nil))][mbedtls_ssl_write((nil),0x52,2)][xio_send((nil),(nil),0,(nil),(nil))][mbedtls_ssl_get_max_frag_len((nil))][mbedtls_ssl_write((nil),0x53,1)][xio_send((nil),(nil),0,(nil),(nil))][on_send_complete((nil),IO_SEND_OK)], Actual: [on_send_complete((nil),IO_SEND_OK)][mbedtls_ssl_get_max_frag_len(0x557185af2fb8)][mbedtls_ssl_write(0x557185af2fb8,0x52,2)][xio_send(0x557185ae5f20,0x52,2,0x557183de4a89,0x557185ae9970)][on_send_complete((nil),IO_SEND_OK)][mbedtls_ssl_get_max_frag_len(0x557185af2fb8)][mbedtls_ssl_write(0x557185af2fb8,0x53,1)][xio_send(0x557185ae5f20,0x53,1,0x557183de4a89,0x557185ae9970)][on_send_complete((nil),IO_SEND_OK)]
2021-06-25T18:29:35.4800079Z [31mTest tlsio_mbedtls_send_large_payload_success result = !!! FAILED !!!
2021-06-25T18:29:35.4801713Z [0mExecuting test tlsio_mbedtls_send_failure ...

@ericwolz
Copy link
Contributor

Humm, ran it under valgrind v3.15 and I still see the memory leak errors. Are you sure you are on the branch SE/fix_blob_upload_fail_mbedtls_1995?

$ valgrind tests/tlsio_mbedtls_ut/tlsio_mbedtls_ut_exe
==21265== Memcheck, a memory error detector
==21265== Copyright (C) 2002-2017, and GNU GPL'd, by Julian Seward et al.
==21265== Using Valgrind-3.15.0 and LibVEX; rerun with -h for copyright info
==21265== Command: tests/tlsio_mbedtls_ut/tlsio_mbedtls_ut_exe
==21265==
=== Executing test suite tlsio_mbedtls_ut ===
Executing test tlsio_mbedtls_setoption_renegotiation_value_NULL_fail ...
Error: Time:Tue Jun 29 18:20:11 2021 File:/mnt/c/temp/azure-c-shared-utility-EcoStruxure/adapters/tlsio_mbedtls.c Func:tlsio_mbedtls_setoption Line:1024 Invalid value set for tls renegotiation
Test tlsio_mbedtls_setoption_renegotiation_value_NULL_fail result = Succeeded.
Executing test tlsio_mbedtls_setoption_renegotiation_success ...
Test tlsio_mbedtls_setoption_renegotiation_success result = Succeeded.
Executing test tlsio_mbedtls_setoption_certificate_key_success ...
Test tlsio_mbedtls_setoption_certificate_key_success result = Succeeded.
Executing test tlsio_mbedtls_setoption_certificate_success ...
Test tlsio_mbedtls_setoption_certificate_success result = Succeeded.
Executing test tlsio_on_io_recv_context_NULL_success ...
Error: Time:Tue Jun 29 18:20:12 2021 File:/mnt/c/temp/azure-c-shared-utility-EcoStruxure/adapters/tlsio_mbedtls.c Func:on_io_recv Line:288 Invalid context NULL value passed
Test tlsio_on_io_recv_context_NULL_success result = Succeeded.
Executing test tlsio_on_io_recv_success ...
Test tlsio_on_io_recv_success result = Succeeded.
Executing test tlsio_on_io_recv_timeout_success ...
Test tlsio_on_io_recv_timeout_success result = Succeeded.
Executing test tlsio_on_underlying_io_bytes_received_success ...
Test tlsio_on_underlying_io_bytes_received_success result = Succeeded.
Executing test tlsio_mbedtls_dowork_w_data_success ...
Test tlsio_mbedtls_dowork_w_data_success result = Succeeded.
Executing test tlsio_mbedtls_dowork_success ...
Test tlsio_mbedtls_dowork_success result = Succeeded.
Executing test tlsio_mbedtls_dowork_handle_NULL_fail ...
Test tlsio_mbedtls_dowork_handle_NULL_fail result = Succeeded.
Executing test tlsio_mbedtls_send_large_payload_failure ...
Error: Time:Tue Jun 29 18:20:12 2021 File:/mnt/c/temp/azure-c-shared-utility-EcoStruxure/adapters/tlsio_mbedtls.c Func:tlsio_mbedtls_send Line:757 Failed to send last fragment with error:0x2, aborting whole send
Assert failed in line 957 Expected: [mbedtls_ssl_get_max_frag_len((nil))][mbedtls_ssl_write((nil),0x52,2)][xio_send((nil),(nil),0,(nil),(nil))][on_send_complete((nil),IO_SEND_ERROR)], Actual: [on_send_complete((nil),IO_SEND_OK)][mbedtls_ssl_get_max_frag_len(0x4b1f278)][mbedtls_ssl_write(0x4b1f278,0x52,2)][xio_send(0x4b20180,0x52,2,0x2c35d8,0x4b15c30)][on_send_complete((nil),IO_SEND_ERROR)]
Test tlsio_mbedtls_send_large_payload_failure result = !!! FAILED !!!
Executing test tlsio_mbedtls_send_large_payload_success ...
Assert failed in line 912 Expected: [mbedtls_ssl_get_max_frag_len((nil))][mbedtls_ssl_write((nil),0x52,2)][xio_send((nil),(nil),0,(nil),(nil))][mbedtls_ssl_get_max_frag_len((nil))][mbedtls_ssl_write((nil),0x53,1)][xio_send((nil),(nil),0,(nil),(nil))][on_send_complete((nil),IO_SEND_OK)], Actual: [on_send_complete((nil),IO_SEND_OK)][mbedtls_ssl_get_max_frag_len(0x4b35968)][mbedtls_ssl_write(0x4b35968,0x52,2)][xio_send(0x4b36870,0x52,2,0x2c35d8,0x4b2c320)][on_send_complete((nil),IO_SEND_OK)][mbedtls_ssl_get_max_frag_len(0x4b35968)][mbedtls_ssl_write(0x4b35968,0x53,1)][xio_send(0x4b36870,0x53,1,0x2c35d8,0x4b2c320)][on_send_complete((nil),IO_SEND_OK)]
Test tlsio_mbedtls_send_large_payload_success result = !!! FAILED !!!
Executing test tlsio_mbedtls_send_failure ...
Error: Time:Tue Jun 29 18:20:12 2021 File:/mnt/c/temp/azure-c-shared-utility-EcoStruxure/adapters/tlsio_mbedtls.c Func:tlsio_mbedtls_send Line:751 Unexpected data size returned from mbedtls_ssl_write -1/3
Test tlsio_mbedtls_send_failure result = Succeeded.
Executing test tlsio_mbedtls_send_success ...
Test tlsio_mbedtls_send_success result = Succeeded.
Executing test tlsio_mbedtls_send_not_open_fail ...
Error: Time:Tue Jun 29 18:20:12 2021 File:/mnt/c/temp/azure-c-shared-utility-EcoStruxure/adapters/tlsio_mbedtls.c Func:tlsio_mbedtls_send Line:732 Invalid state specified 0
Test tlsio_mbedtls_send_not_open_fail result = Succeeded.
Executing test tlsio_mbedtls_send_handle_NULL_fail ...
Error: Time:Tue Jun 29 18:20:12 2021 File:/mnt/c/temp/azure-c-shared-utility-EcoStruxure/adapters/tlsio_mbedtls.c Func:tlsio_mbedtls_send Line:724 Invalid parameter specified tls_io: (nil), buffer: 0x2ce946, size: 3l
Test tlsio_mbedtls_send_handle_NULL_fail result = Succeeded.
Executing test tlsio_mbedtls_close_multiple_calls_fail ...
Error: Time:Tue Jun 29 18:20:12 2021 File:/mnt/c/temp/azure-c-shared-utility-EcoStruxure/adapters/tlsio_mbedtls.c Func:tlsio_mbedtls_close Line:678 IO should not be closed: 4
Test tlsio_mbedtls_close_multiple_calls_fail result = Succeeded.
Executing test tlsio_mbedtls_close_success ...
Test tlsio_mbedtls_close_success result = Succeeded.
Executing test tlsio_mbedtls_close_handle_NULL_fail ...
Error: Time:Tue Jun 29 18:20:12 2021 File:/mnt/c/temp/azure-c-shared-utility-EcoStruxure/adapters/tlsio_mbedtls.c Func:tlsio_mbedtls_close Line:668 Invalid parameter specified tls_io: NULL
Test tlsio_mbedtls_close_handle_NULL_fail result = Succeeded.
Executing test tlsio_entropy_poll_success ...
Test tlsio_entropy_poll_success result = Succeeded.
Executing test tlsio_mbedtls_open_fail ...
Error: Time:Tue Jun 29 18:20:12 2021 File:/mnt/c/temp/azure-c-shared-utility-EcoStruxure/adapters/tlsio_mbedtls.c Func:tlsio_mbedtls_open Line:653 Underlying IO open failed
Test tlsio_mbedtls_open_fail result = Succeeded.
Executing test tlsio_mbedtls_open_multiple_calls_fail ...
Error: Time:Tue Jun 29 18:20:12 2021 File:/mnt/c/temp/azure-c-shared-utility-EcoStruxure/adapters/tlsio_mbedtls.c Func:tlsio_mbedtls_open Line:631 IO should not be open: 1
Test tlsio_mbedtls_open_multiple_calls_fail result = Succeeded.
Executing test tlsio_mbedtls_open_succeed ...
Test tlsio_mbedtls_open_succeed result = Succeeded.
Executing test tlsio_mbedtls_open_handle_NULL_fail ...
Error: Time:Tue Jun 29 18:20:12 2021 File:/mnt/c/temp/azure-c-shared-utility-EcoStruxure/adapters/tlsio_mbedtls.c Func:tlsio_mbedtls_open Line:622 Invalid parameter specified tls_io: NULL
Test tlsio_mbedtls_open_handle_NULL_fail result = Succeeded.
Executing test tlsio_mbedtls_destroy_handle_NULL_fail ...
Test tlsio_mbedtls_destroy_handle_NULL_fail result = Succeeded.
Executing test tlsio_mbedtls_destroy_succeed ...
Test tlsio_mbedtls_destroy_succeed result = Succeeded.
Executing test tlsio_mbedtls_create_fail ...
Error: Time:Tue Jun 29 18:20:12 2021 File:/mnt/c/temp/azure-c-shared-utility-EcoStruxure/adapters/tlsio_mbedtls.c Func:tlsio_mbedtls_create Line:570 Failure allocating TLS object
Error: Time:Tue Jun 29 18:20:12 2021 File:/mnt/c/temp/azure-c-shared-utility-EcoStruxure/adapters/tlsio_mbedtls.c Func:tlsio_mbedtls_create Line:550 Failure allocating hostname.
Test tlsio_mbedtls_create_fail result = Succeeded.
Executing test tlsio_mbedtls_create_succeed ...
Test tlsio_mbedtls_create_succeed result = Succeeded.
Executing test tlsio_mbedtls_create_config_NULL_fail ...
Error: Time:Tue Jun 29 18:20:12 2021 File:/mnt/c/temp/azure-c-shared-utility-EcoStruxure/adapters/tlsio_mbedtls.c Func:tlsio_mbedtls_create Line:511 NULL tls_io_config
Test tlsio_mbedtls_create_config_NULL_fail result = Succeeded.
30 tests ran, 2 failed, 28 succeeded.
==21265==
==21265== HEAP SUMMARY:
==21265== in use at exit: 81,296 bytes in 6 blocks
==21265== total heap usage: 8,759 allocs, 8,753 frees, 1,405,465 bytes allocated
==21265==
==21265== LEAK SUMMARY:
==21265== definitely lost: 81,248 bytes in 2 blocks
==21265== indirectly lost: 48 bytes in 4 blocks
==21265== possibly lost: 0 bytes in 0 blocks
==21265== still reachable: 0 bytes in 0 blocks
==21265== suppressed: 0 bytes in 0 blocks
==21265== Rerun with --leak-check=full to see details of leaked memory
==21265==
==21265== For lists of detected and suppressed errors, rerun with: -s
==21265== ERROR SUMMARY: 0 errors from 0 contexts (suppressed: 0 from 0)

@maallahatem
Copy link
Contributor Author

I'm sorry, it seems that I'm using the wrong branch,
Now everything is ok, Could you check in your side, please

Regards

@ericwolz
Copy link
Contributor

ericwolz commented Jul 6, 2021

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@ericwolz
Copy link
Contributor

ericwolz commented Jul 7, 2021

@maallahatem thanks. We will validate this before merging the PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants