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: (48) An unknown option was passed in to libcurl #39949

Closed
deepfire opened this issue May 3, 2018 · 8 comments
Closed

curl: (48) An unknown option was passed in to libcurl #39949

deepfire opened this issue May 3, 2018 · 8 comments
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md

Comments

@deepfire
Copy link
Contributor

deepfire commented May 3, 2018

This is from curl installed from Nixpkgs master, commit 0f62284972aff639bc772245311446161911a985:

[nix-shell:~]$ ltrace -f curl https://hackage.haskell.org/package/flexible-defaults/src/flexible-defaults.cabal 2>&1 | grep 'CURLOPT_\|unknown' | tail -n 20
[pid 9098] strcmp("CURLOPT_PROXY_SSL_VERIFYPEER", "CURLOPT_SSL_VERIFYHOST") = -3
[pid 9098] strcmp("CURLOPT_PROXY_SSL_VERIFYPEER", "CURLOPT_SSL_ENABLE_NPN") = -3
[pid 9098] strcmp("CURLOPT_PROXY_SSL_VERIFYPEER", "CURLOPT_SSL_ENABLE_ALPN") = -3
[pid 9098] strcmp("CURLOPT_PROXY_SSL_VERIFYPEER", "CURLOPT_TCP_NODELAY") = -4
[pid 9098] strcmp("CURLOPT_PROXY_SSL_VERIFYPEER", "CURLOPT_PROXY_SSL_VERIFYPEER") = 0
[pid 9098] strcmp("CURLOPT_CRLF", "CURLOPT_SSL_VERIFYPEER") = -16
[pid 9098] strcmp("CURLOPT_CRLF", "CURLOPT_SSL_VERIFYHOST") = -16
[pid 9098] strcmp("CURLOPT_CRLF", "CURLOPT_SSL_ENABLE_NPN") = -16
[pid 9098] strcmp("CURLOPT_CRLF", "CURLOPT_SSL_ENABLE_ALPN") = -16
[pid 9098] strcmp("CURLOPT_CRLF", "CURLOPT_TCP_NODELAY") = -17
[pid 9098] strcmp("CURLOPT_CRLF", "CURLOPT_PROXY_SSL_VERIFYPEER") = -13
[pid 9098] strcmp("CURLOPT_CRLF", "CURLOPT_PROXY_SSL_VERIFYHOST") = -13
[pid 9098] strcmp("CURLOPT_CRLF", "CURLOPT_SOCKS5_AUTH") = -16
[pid 9098] strcmp("CURLOPT_COOKIESESSION", "CURLOPT_SSL_VERIFYPEER") = -16
[pid 9098] strcmp("CURLOPT_COOKIESESSION", "CURLOPT_SSL_VERIFYHOST") = -16
[pid 9098] strcmp("CURLOPT_COOKIESESSION", "CURLOPT_SSL_ENABLE_NPN") = -16
[pid 9098] strcmp("CURLOPT_COOKIESESSION", "CURLOPT_SSL_ENABLE_ALPN") = -16
[pid 9098] strcmp("CURLOPT_COOKIESESSION", "CURLOPT_TCP_NODELAY") = -17
[pid 9098] strcmp("CURLOPT_COOKIESESSION", "CURLOPT_PROXY_SSL_VERIFYPEER") = -13
[pid 9098] strcmp("CURLOPT_COOKIESESSION", "CURLOPT_PROXY_SSL_VERIFYHOST") = -13
[pid 9098] strcmp("CURLOPT_COOKIESESSION", "CURLOPT_SOCKS5_AUTH") = -16
[pid 9098] curl_mfprintf(0x7fc804b574e0, 0x41a72a, 48, 0x7fc8056ab3f0curl: (48) An unknown option was passed in to libcurl

[nix-shell:~]$ which curl
/home/deepfire/.nix-profile/bin/curl

[nix-shell:~]$ ls -l /home/deepfire/.nix-profile/bin/curl                                      lrwxrwxrwx 1 root root 68 Jan  1  1970 /home/deepfire/.nix-profile/bin/curl -> /nix/store/0bh7i8xlw19vdz5yw66farn0ab92v189-curl-7.59.0-bin/bin/curl

[nix-shell:~]$ (cd ~/nixpkgs/; git log -n1)                                                    commit 0f62284972aff639bc772245311446161911a985
Author: florianjacob <accounts+github@florianjacob.de>
Date:   Thu May 3 23:38:14 2018 +0200

    matrix-synapse: 0.27.4 -> 0.28.1 (#39922)

It indeed looks like unexpected options are passed to libcurl.

Steps to reproduce

See above.

Technical details

NOTE: the Nixpkgs commit used is as per above, not below.

  • system: "x86_64-linux"
  • host os: Linux 4.15.2, NixOS, 18.03.git.94bdeac (Impala)
  • multi-user?: yes
  • sandbox: yes
  • version: nix-env (Nix) 2.0
  • channels(root): "nixos-17.03.899.c87abfae79"
  • nixpkgs: /home/deepfire/nixpkgs
@deepfire
Copy link
Contributor Author

deepfire commented May 4, 2018

The unabridged part of the ltrace:

[pid 17448] getenv("CURL_HOME")                  = nil
[pid 17448] getenv("HOME")                       = "/home/deepfire"
[pid 17448] strdup("/home/deepfire")             = 0x210ef60
[pid 17448] curl_maprintf(0x41a01e, 0x210ef60, 0x414c5b, 0x65726966706565) = 0x20ea230
[pid 17448] curl_easy_setopt(0x2105340, 0x27c7, 0x20ea230, 0) = 0
[pid 17448] free(0)                              = <void>
[pid 17448] curl_free(0x20ea230, 0x20ea230, 32, 0) = 1
[pid 17448] free(0x210ef60)                      = <void>
[pid 17448] strcmp("CURLOPT_CRLF", "CURLOPT_SSL_VERIFYPEER") = -16
[pid 17448] strcmp("CURLOPT_CRLF", "CURLOPT_SSL_VERIFYHOST") = -16
[pid 17448] strcmp("CURLOPT_CRLF", "CURLOPT_SSL_ENABLE_NPN") = -16
[pid 17448] strcmp("CURLOPT_CRLF", "CURLOPT_SSL_ENABLE_ALPN") = -16
[pid 17448] strcmp("CURLOPT_CRLF", "CURLOPT_TCP_NODELAY") = -17
[pid 17448] strcmp("CURLOPT_CRLF", "CURLOPT_PROXY_SSL_VERIFYPEER") = -13
[pid 17448] strcmp("CURLOPT_CRLF", "CURLOPT_PROXY_SSL_VERIFYHOST") = -13
[pid 17448] strcmp("CURLOPT_CRLF", "CURLOPT_SOCKS5_AUTH") = -16
[pid 17448] curl_msnprintf(0x7fffaa438bf0, 256, 0x41af74, 0) = 2
[pid 17448] curl_easy_setopt(0x2105340, 27, 0, 0) = 0
[pid 17448] free(0)                              = <void>
[pid 17448] curl_easy_setopt(0x2105340, 0x272c, 0, 0x272c) = 0
[pid 17448] curl_easy_setopt(0x2105340, 0x2737, 0, 0x2737) = 0
[pid 17448] curl_easy_setopt(0x2105340, 0x276d, 0, 0x276d) = 0
[pid 17448] strcmp("CURLOPT_COOKIESESSION", "CURLOPT_SSL_VERIFYPEER") = -16
[pid 17448] strcmp("CURLOPT_COOKIESESSION", "CURLOPT_SSL_VERIFYHOST") = -16
[pid 17448] strcmp("CURLOPT_COOKIESESSION", "CURLOPT_SSL_ENABLE_NPN") = -16
[pid 17448] strcmp("CURLOPT_COOKIESESSION", "CURLOPT_SSL_ENABLE_ALPN") = -16
[pid 17448] strcmp("CURLOPT_COOKIESESSION", "CURLOPT_TCP_NODELAY") = -17
[pid 17448] strcmp("CURLOPT_COOKIESESSION", "CURLOPT_PROXY_SSL_VERIFYPEER") = -13
[pid 17448] strcmp("CURLOPT_COOKIESESSION", "CURLOPT_PROXY_SSL_VERIFYHOST") = -13
[pid 17448] strcmp("CURLOPT_COOKIESESSION", "CURLOPT_SOCKS5_AUTH") = -16
[pid 17448] curl_msnprintf(0x7fffaa438bf0, 256, 0x41af74, 0) = 2
[pid 17448] curl_easy_setopt(0x2105340, 96, 0, 0) = 0
[pid 17448] free(0)                              = <void>
[pid 17448] curl_easy_setopt(0x2105340, 33, 0, 33) = 0
[pid 17448] curl_msnprintf(0x7fffaa438bf0, 256, 0x41af79, 0) = 13
[pid 17448] curl_easy_setopt(0x2105340, 0x763e, 0, 0) = 48
[pid 17448] free(0)                              = <void>
[pid 17448] curl_easy_strerror(48, 0xffffffff, 0, 0x7fffaa438fe0) = 0x7ff0222843f0
[pid 17448] curl_mfprintf(0x7ff0217304e0, 0x41a72a, 48, 0x7ff0222843f0curl: (48) An unknown option was passed in to libcurl
) = 54

@deepfire
Copy link
Contributor Author

deepfire commented May 4, 2018

So, that would look like the curl_easy_setopt(0x2105340, 0x763e, 0, 0) = 48 call is the culprit.

@deepfire
Copy link
Contributor Author

deepfire commented May 4, 2018

Next step is breaking down 0x763e into CURLOPT_*..

@dtzWill
Copy link
Member

dtzWill commented May 4, 2018

Sounds like curl/libcurl aren't the same version.

Ways to check if this is the case:

  • curl -V
  • ldd curl
  • LD_DEBUG=libs curl

The next step will be determining why the wrong libcurl is being used.

My best guess is LD_LIBRARY_PATH is pointing it to the wrong one, check it's value.

@deepfire
Copy link
Contributor Author

deepfire commented May 4, 2018

@dtzWill, indeed -- 7.56.1 vs. 7.59:

deepfire@andromedae:~/nixpkgs$ curl -V
curl 7.59.0 (x86_64-pc-linux-gnu) libcurl/7.56.1 OpenSSL/1.0.2o zlib/1.2.11 libssh2/1.8.0 nghttp2/1.24.0
...
deepfire@andromedae:~/nixpkgs$ ldd `which curl`
        linux-vdso.so.1 (0x00007fff6a7fd000)
        libcurl.so.4 => /nix/store/2mh5y8mrxj6f98p6hmmkzfzsg8gybb04-curl-7.56.1/lib/libcurl.so.4 (0x00007f3c964d7000)
...

@pschuprikov
Copy link
Contributor

curl works just fine with nixos-20.03beta695.b2935fbecea, maybe the issue can be closed?

@stale
Copy link

stale bot commented Sep 18, 2020

Hello, I'm a bot and I thank you in the name of the community for opening this issue.

To help our human contributors focus on the most-relevant reports, I check up on old issues to see if they're still relevant. This issue has had no activity for 180 days, and so I marked it as stale, but you can rest assured it will never be closed by a non-human.

The community would appreciate your effort in checking if the issue is still valid. If it isn't, please close it.

If the issue persists, and you'd like to remove the stale label, you simply need to leave a comment. Your comment can be as simple as "still important to me". If you'd like it to get more attention, you can ask for help by searching for maintainers and people that previously touched related code and @ mention them in a comment. You can use Git blame or GitHub's web interface on the relevant files to find them.

Lastly, you can always ask for help at our Discourse Forum or at #nixos' IRC channel.

@stale stale bot added the 2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md label Sep 18, 2020
@deepfire
Copy link
Contributor Author

Probably no longer relevant.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
2.status: stale https://github.com/NixOS/nixpkgs/blob/master/.github/STALE-BOT.md
Projects
None yet
Development

No branches or pull requests

3 participants