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

curl_easy_perform() failed: out of memory on Raspberry pi #519

Closed
narendranaren14 opened this issue Jun 12, 2018 · 8 comments
Closed

curl_easy_perform() failed: out of memory on Raspberry pi #519

narendranaren14 opened this issue Jun 12, 2018 · 8 comments
Assignees
Labels

Comments

@narendranaren14
Copy link

Hi,

I ran sample example iothub_ll_telemetry_sample on raspberry pi 3. I get the following error. I know this issue has been addressed before #308. I updated the CURL to the latest version 7.52.1-5+deb9u6 (stable) as per the recommendation in #308. However, the error still persists on raspbian. Any recommendations?

Creating IoTHub handle
Sending message 1 to IoTHub

  • Trying 168.61.54.255...
  • TCP_NODELAY set
  • Connected to EcolabResearchCellular.azure-devices.net (168.61.54.255) port 443 (#0)
  • SSL: couldn't create a context: error:140A90A1:lib(20):func(169):reason(161)
  • Curl_http_done: called premature == 0
  • Closing connection 0
    Error: Time:Mon Jun 11 16:08:27 2018 File:/home/narendra/source/azure-iot-sdk-c/c-utility/adapters/httpapi_curl.c Func:HTTPAPI_ExecuteRequest Line:582 curl_easy_perform() failed: Out of memory

Error: Time:Mon Jun 11 16:08:27 2018 File:/home/narendra/source/azure-iot-sdk-c/c-utility/adapters/httpapi_curl.c Func:HTTPAPI_ExecuteRequest Line:584 (result = HTTPAPI_OPEN_REQUEST_FAILED)
Error: Time:Mon Jun 11 16:08:27 2018 File:/home/narendra/source/azure-iot-sdk-c/c-utility/src/httpapiex.c Func:HTTPAPIEX_ExecuteRequest Line:475 unable to recover sending to a working state
Error: Time:Mon Jun 11 16:08:27 2018 File:/home/narendra/source/azure-iot-sdk-c/iothub_client/src/iothubtransporthttp.c Func:DoEvent Line:1667 Unable to HTTPAPIEX_ExecuteRequest.

Regards
Narendra

@ewertons ewertons self-assigned this Jun 12, 2018
@ewertons
Copy link
Contributor

Hi @narendranaren14 ,
did you confirm you got the library updated in the system (you can check with dpkg -l | grep -i curl) and that the correct library was loaded during the execution?
You can check which library was loaded using gdb, breaking during the execution and checking the modules (i shared).

@narendranaren14
Copy link
Author

Hi @ewertons ,

Appreciate the response! Here is the output from gdb "i shared". It is using "libcurl.so.4". Would this be valid lib?

0x76fce820 0x76fea560 Yes /lib/ld-linux-armhf.so.3
0x76fb8588 0x76fbc2fc Yes () /usr/lib/arm-linux-gnueabihf/libarmmem.so
0x76f30038 0x76f86080 Yes (
) /usr/lib/arm-linux-gnueabihf/libcurl.so.4
0x76ed6690 0x76f0be2c Yes () /usr/lib/arm-linux-gnueabihf/libssl.so.1.1
0x76d40000 0x76e66c38 Yes (
) /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.1
0x76cd2140 0x76ce1344 Yes /lib/arm-linux-gnueabihf/libpthread.so.0
0x76c52d60 0x76c875f8 Yes /lib/arm-linux-gnueabihf/libm.so.6
0x76c39720 0x76c3cf58 Yes /lib/arm-linux-gnueabihf/librt.so.1
0x76c24ef8 0x76c26ae0 Yes () /lib/arm-linux-gnueabihf/libuuid.so.1
0x76afafe0 0x76bef888 Yes /lib/arm-linux-gnueabihf/libc.so.6
0x76aba3b0 0x76acc570 Yes (
) /usr/lib/arm-linux-gnueabihf/libnghttp2.so.14
0x76a85ebc 0x76a89874 Yes () /usr/lib/arm-linux-gnueabihf/libidn2.so.0
0x76a5f7b8 0x76a6ed28 Yes (
) /usr/lib/arm-linux-gnueabihf/librtmp.so.1
0x76a2a310 0x76a4665c Yes () /usr/lib/arm-linux-gnueabihf/libssh2.so.1
0x76a0ae48 0x76a0c8a8 Yes (
) /usr/lib/arm-linux-gnueabihf/libpsl.so.5
0x769b78d8 0x769ee4e0 Yes () /usr/lib/arm-linux-gnueabihf/libssl.so.1.0.2
0x7686dde0 0x76953454 Yes (
) /usr/lib/arm-linux-gnueabihf/libcrypto.so.1.0.2
0x767e87c8 0x76814d84 Yes () /usr/lib/arm-linux-gnueabihf/libgssapi_krb5.so.2
0x7673e110 0x767976a4 Yes (
) /usr/lib/arm-linux-gnueabihf/libkrb5.so.3
0x766edca0 0x7670ded4 Yes () /usr/lib/arm-linux-gnueabihf/libk5crypto.so.3
0x766d8ea0 0x766d9bf4 Yes (
) /lib/arm-linux-gnueabihf/libcom_err.so.2
0x766be504 0x766c5408 Yes () /usr/lib/arm-linux-gnueabihf/liblber-2.4.so.2
0x76671a18 0x766a362c Yes (
) /usr/lib/arm-linux-gnueabihf/libldap_r-2.4.so.2
0x7664186c 0x766517dc Yes () /lib/arm-linux-gnueabihf/libz.so.1
0x7662d950 0x7662e7c4 Yes /lib/arm-linux-gnueabihf/libdl.so.2
0x76528444 0x7655358c Yes (
) /usr/lib/arm-linux-gnueabihf/libunistring.so.0
0x763ad1bc 0x764b9644 Yes () /usr/lib/arm-linux-gnueabihf/libgnutls.so.30
0x76359368 0x763664ac Yes (
) /usr/lib/arm-linux-gnueabihf/libhogweed.so.4
0x76313810 0x76337b90 Yes () /usr/lib/arm-linux-gnueabihf/libnettle.so.6
0x762a2c20 0x762f2454 Yes (
) /usr/lib/arm-linux-gnueabihf/libgmp.so.10
0x761cfc00 0x7625b9a8 Yes () /lib/arm-linux-gnueabihf/libgcrypt.so.20
0x761b3198 0x761b847c Yes (
) /usr/lib/arm-linux-gnueabihf/libkrb5support.so.0
0x7619f01c 0x7619fbfc Yes () /lib/arm-linux-gnueabihf/libkeyutils.so.1
0x7617b480 0x761886a4 Yes /lib/arm-linux-gnueabihf/libresolv.so.2
0x761541d8 0x76165b0c Yes (
) /usr/lib/arm-linux-gnueabihf/libsasl2.so.2
0x760fb5ac 0x7612f64c Yes () /usr/lib/arm-linux-gnueabihf/libp11-kit.so.0
0x760b4ce8 0x760b9af8 Yes (
) /lib/arm-linux-gnueabihf/libidn.so.11
0x76094904 0x7609fc70 Yes () /usr/lib/arm-linux-gnueabihf/libtasn1.so.6
0x76074f48 0x7607e8f0 Yes (
) /lib/arm-linux-gnueabihf/libgpg-error.so.0
0x7605c368 0x76060e74 Yes () /usr/lib/arm-linux-gnueabihf/libffi.so.6
0x7603b180 0x76049930 Yes (
) /lib/arm-linux-gnueabihf/libgcc_s.so.1

Regards
Narendra NA

@narendranaren14
Copy link
Author

Hi @ewertons,

More information below for your reference. Hopefully this should help to provide guidance.

pi@raspberrypi:~/azure-iot-sdk-c/build_all/linux $ ls /usr/lib/arm-linux-gnueabihf/libcurl
libcurl.a libcurl-gnutls.so.3 libcurl-gnutls.so.4 libcurl-gnutls.so.4.4.0 libcurl.la libcurl.so libcurl.so.3 libcurl.so.4 libcurl.so.4.4.0

Output of the command dpkg -l | grep -i curl
ii curl 7.52.1-5+deb9u6 armhf command line tool for transferring data with URL syntax
ii libcurl3:armhf 7.52.1-5+deb9u6 armhf easy-to-use client-side URL transfer library (OpenSSL flavour)
ii libcurl3-gnutls:armhf 7.52.1-5+deb9u6 armhf easy-to-use client-side URL transfer library (GnuTLS flavour)
ii libcurl4-openssl-dev:armhf 7.52.1-5+deb9u6 armhf development files and documentation for libcurl (OpenSSL flavour)

Regards
Narendra NA

@ewertons
Copy link
Contributor

Hey @narendranaren14 ,
this is wonderful info, thanks a lot for the level of detail.

With the path to the lib you showed in the shared modules, you verified where the package is installed.
Then with dpkg you confirmed you only have one version of curl installed.

However, as stated in the documentation we currently require at least curl 7.56 to avoid hitting a but that package had in previous versions.
So the solution for you will be to upgrade curl in your environment.
As an alternative, you can try switching from openssl to gnutls as show here.

@ewertons
Copy link
Contributor

@narendranaren14 ,
we will close this issue for now but feel free to reopen it if you would like to follow up.
Thanks for using the Azure IoT SDKs!

@ewertons
Copy link
Contributor

@narendranaren14 , thank you for your contribution to our open-sourced project! Please help us improve by filling out this 2-minute customer satisfaction survey

@narendranaren14
Copy link
Author

Thanks @ewertons ! It appears to working. I will do further investigation. If necessary, I will reopen.
Appreciate your help!

@Vafa-Andalibi
Copy link

@narendranaren14 did you fix this issue by building curl on RP ?

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

No branches or pull requests

3 participants