{"action":"closed","issue":{"url":"https://api.github.com/repos/bagder/curl/issues/549","labels_url":"https://api.github.com/repos/bagder/curl/issues/549/labels{/name}","comments_url":"https://api.github.com/repos/bagder/curl/issues/549/comments","events_url":"https://api.github.com/repos/bagder/curl/issues/549/events","html_url":"https://github.com/bagder/curl/issues/549","id":120168187,"number":549,"title":"Cookies handling difference between 32/64 bits binaries whengenerated on x86_64 arch","user":{"login":"lglayal","id":10627740,"avatar_url":"https://avatars.githubusercontent.com/u/10627740?v=3","gravatar_id":"","url":"https://api.github.com/users/lglayal","html_url":"https://github.com/lglayal","followers_url":"https://api.github.com/users/lglayal/followers","following_url":"https://api.github.com/users/lglayal/following{/other_user}","gists_url":"https://api.github.com/users/lglayal/gists{/gist_id}","starred_url":"https://api.github.com/users/lglayal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lglayal/subscriptions","organizations_url":"https://api.github.com/users/lglayal/orgs","repos_url":"https://api.github.com/users/lglayal/repos","events_url":"https://api.github.com/users/lglayal/events{/privacy}","received_events_url":"https://api.github.com/users/lglayal/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-12-03T13:12:55Z","updated_at":"2015-12-04T07:35:31Z","closed_at":"2015-12-04T07:35:31Z","body":"Hello.\r\nI have trouble using 32bits libcurl compiled on 64bits arch, using CentOS 6.6 x86_64, with gcc 4.4.7 20120313 (Red Hat 4.4.7-11),\r\n\r\nSuch compilation worked fine with libcurl 7.34 but using libcurl 7.35 or newer (checked 7.34, 7.35, 7.36, 7.37.1, 7.40, 7.46) cookies are not handled the same way If I generate a 32 or a 64 bits, using native size works fine.\r\n\r\nCompiling tarball from http://curl.haxx.se/download/ using :\r\n\r\n=32 bits binary on 64bits arch=\r\n<pre>\r\nexport CFLAGS=\"$CFLAGS -m32\"\r\nexport LDFLAGS=\"$LDFLAGS -m32\"\r\nexport CXXFLAGS=\"$CXXFLAGS -m32\"\r\n./configure --prefix=/usr/audio/dev/User/lglayal/CCAPI/LIBCURL/curl-7.35.0_32_allinternal/Binaries/ --disable-optimize --with-pic --disable-ldap --without-libssh2 --enable-debug\r\nmake\r\nmake install\r\n</pre>\r\nWhen I check cookies found using a given url :\r\n<pre>\r\n$file Binaries/bin/curl\r\nBinaries/bin/curl: ELF 32-bit LSB executable, Intel 80386, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, not stripped\r\n\r\n$Binaries/bin/curl -v --cookie-jar toto.txt --show-error http://192.168.160.2/mcc/cookie.php\r\n* STATE: INIT => CONNECT handle 0x856eecc; line 1021 (connection #-5000) \r\n* Hostname was NOT found in DNS cache\r\n*   Trying 192.168.160.2...\r\n* STATE: CONNECT => WAITCONNECT handle 0x856eecc; line 1068 (connection #0) \r\n* Connected to 192.168.160.2 (192.168.160.2) port 80 (#0)\r\n* STATE: WAITCONNECT => DO handle 0x856eecc; line 1187 (connection #0) \r\n> GET /mcc/cookie.php HTTP/1.1\r\n> User-Agent: curl/7.35.0\r\n> Host: 192.168.160.2\r\n> Accept: */*\r\n> \r\n* STATE: DO => DO_DONE handle 0x856eecc; line 1273 (connection #0) \r\n* STATE: DO_DONE => WAITPERFORM handle 0x856eecc; line 1399 (connection #0) \r\n* STATE: WAITPERFORM => PERFORM handle 0x856eecc; line 1412 (connection #0) \r\n* HTTP 1.1 or later with persistent connection, pipelining supported\r\n< HTTP/1.1 200 OK\r\n< Date: Thu, 03 Dec 2015 12:49:17 GMT\r\n* Server Apache/2.2.9 (Fedora) is not blacklisted\r\n< Server: Apache/2.2.9 (Fedora)\r\n< X-Powered-By: PHP/5.2.6\r\n* Added cookie ccapi=\"Hello+%21\" for domain 192.168.160.2, path /, expire 0\r\n< Set-Cookie: ccapi=Hello+%21; path=/; domain=192.168.160.2\r\n< Content-Length: 125\r\n< Connection: close\r\n< Content-Type: text/xml\r\n< \r\n...\r\n</pre>\r\nThe cookies file contains :\r\n<pre>\r\n# Netscape HTTP Cookie File\r\n# http://curl.haxx.se/docs/http-cookies.html\r\n# This file was generated by libcurl! Edit at your own risk.\r\n\r\n.192.168.160.2  TRUE    /       FALSE   0       (nil)   ccapi\r\n</pre>\r\n\r\nThe cookies file contains '(nil) ccapi' \r\n\r\n=64 bits binary on 64bits arch=\r\n* Using the same library but compiled using 64 bits :\r\n\r\n<pre>\r\n$file Binaries/bin/curl\r\nBinaries/bin/curl: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked (uses shared libs), for GNU/Linux 2.6.18, not stripped\r\n\r\n$Binaries/bin/curl -v --cookie-jar toto.txt --show-error http://192.168.160.2/mcc/cookie.php\r\n* STATE: INIT => CONNECT handle 0x1a9a8e8; line 1021 (connection #-5000) \r\n* Hostname was NOT found in DNS cache\r\n*   Trying 192.168.160.2...\r\n* STATE: CONNECT => WAITCONNECT handle 0x1a9a8e8; line 1068 (connection #0) \r\n* Connected to 192.168.160.2 (192.168.160.2) port 80 (#0)\r\n* STATE: WAITCONNECT => DO handle 0x1a9a8e8; line 1187 (connection #0) \r\n> GET /mcc/cookie.php HTTP/1.1\r\n> User-Agent: curl/7.35.0\r\n> Host: 192.168.160.2\r\n> Accept: */*\r\n> \r\n* STATE: DO => DO_DONE handle 0x1a9a8e8; line 1273 (connection #0) \r\n* STATE: DO_DONE => WAITPERFORM handle 0x1a9a8e8; line 1399 (connection #0) \r\n* STATE: WAITPERFORM => PERFORM handle 0x1a9a8e8; line 1412 (connection #0) \r\n* HTTP 1.1 or later with persistent connection, pipelining supported\r\n< HTTP/1.1 200 OK\r\n< Date: Thu, 03 Dec 2015 12:52:26 GMT\r\n* Server Apache/2.2.9 (Fedora) is not blacklisted\r\n< Server: Apache/2.2.9 (Fedora)\r\n< X-Powered-By: PHP/5.2.6\r\n* Added cookie ccapi=\"Hello+%21\" for domain 192.168.160.2, path /, expire 0\r\n< Set-Cookie: ccapi=Hello+%21; path=/; domain=192.168.160.2\r\n< Content-Length: 125\r\n< Connection: close\r\n< Content-Type: text/xml\r\n< \r\n...\r\n</pre>\r\nFile contains\r\n<pre>\r\n# Netscape HTTP Cookie File\r\n# http://curl.haxx.se/docs/http-cookies.html\r\n# This file was generated by libcurl! Edit at your own risk.\r\n\r\n.192.168.160.2  TRUE    /       FALSE   0       ccapi   Hello+%21\r\n\r\nThe cookies file contains 'ccapi   Hello+%21', the right thing.\r\n</pre>\r\n\r\nIt seems something goes wrong when forcing 32bits code generation on 64 bits arch. I also tried to force --host, --build, setarch on configure but results are identical.\r\n\r\nI also tried the same source compiled on 32 bits arch as 32bits binary and it works fine (test done on old FC9 with gcc 4.3) and it works.\r\n\r\nThanks."}}