{"action":"created","issue":{"url":"https://api.github.com/repos/pocoproject/poco/issues/1950","repository_url":"https://api.github.com/repos/pocoproject/poco","labels_url":"https://api.github.com/repos/pocoproject/poco/issues/1950/labels{/name}","comments_url":"https://api.github.com/repos/pocoproject/poco/issues/1950/comments","events_url":"https://api.github.com/repos/pocoproject/poco/issues/1950/events","html_url":"https://github.com/pocoproject/poco/issues/1950","id":267437673,"number":1950,"title":"Net Exception: Address family not supported with clang","user":{"login":"Bjoe","id":727911,"avatar_url":"https://avatars3.githubusercontent.com/u/727911?v=4","gravatar_id":"","url":"https://api.github.com/users/Bjoe","html_url":"https://github.com/Bjoe","followers_url":"https://api.github.com/users/Bjoe/followers","following_url":"https://api.github.com/users/Bjoe/following{/other_user}","gists_url":"https://api.github.com/users/Bjoe/gists{/gist_id}","starred_url":"https://api.github.com/users/Bjoe/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Bjoe/subscriptions","organizations_url":"https://api.github.com/users/Bjoe/orgs","repos_url":"https://api.github.com/users/Bjoe/repos","events_url":"https://api.github.com/users/Bjoe/events{/privacy}","received_events_url":"https://api.github.com/users/Bjoe/received_events","type":"User","site_admin":false},"labels":[{"id":17397361,"url":"https://api.github.com/repos/pocoproject/poco/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":{"login":"aleks-f","id":2429093,"avatar_url":"https://avatars1.githubusercontent.com/u/2429093?v=4","gravatar_id":"","url":"https://api.github.com/users/aleks-f","html_url":"https://github.com/aleks-f","followers_url":"https://api.github.com/users/aleks-f/followers","following_url":"https://api.github.com/users/aleks-f/following{/other_user}","gists_url":"https://api.github.com/users/aleks-f/gists{/gist_id}","starred_url":"https://api.github.com/users/aleks-f/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleks-f/subscriptions","organizations_url":"https://api.github.com/users/aleks-f/orgs","repos_url":"https://api.github.com/users/aleks-f/repos","events_url":"https://api.github.com/users/aleks-f/events{/privacy}","received_events_url":"https://api.github.com/users/aleks-f/received_events","type":"User","site_admin":false},"assignees":[{"login":"aleks-f","id":2429093,"avatar_url":"https://avatars1.githubusercontent.com/u/2429093?v=4","gravatar_id":"","url":"https://api.github.com/users/aleks-f","html_url":"https://github.com/aleks-f","followers_url":"https://api.github.com/users/aleks-f/followers","following_url":"https://api.github.com/users/aleks-f/following{/other_user}","gists_url":"https://api.github.com/users/aleks-f/gists{/gist_id}","starred_url":"https://api.github.com/users/aleks-f/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleks-f/subscriptions","organizations_url":"https://api.github.com/users/aleks-f/orgs","repos_url":"https://api.github.com/users/aleks-f/repos","events_url":"https://api.github.com/users/aleks-f/events{/privacy}","received_events_url":"https://api.github.com/users/aleks-f/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/pocoproject/poco/milestones/15","html_url":"https://github.com/pocoproject/poco/milestone/15","labels_url":"https://api.github.com/repos/pocoproject/poco/milestones/15/labels","id":1611084,"number":15,"title":"Release 1.8.0","description":"New Feature Release based on 1.7.9, but with some new features from develop:\r\n\r\n  * Support for UNIX Domain Sockets\r\n  * Redis client\r\n  * Zip64 support\r\n  * XML Stream Parser\r\n\r\nLast release that will work with a C++03 compiler. Future releases starting with 2.0 will require C++11/14.\r\n","creator":{"login":"obiltschnig","id":201635,"avatar_url":"https://avatars0.githubusercontent.com/u/201635?v=4","gravatar_id":"","url":"https://api.github.com/users/obiltschnig","html_url":"https://github.com/obiltschnig","followers_url":"https://api.github.com/users/obiltschnig/followers","following_url":"https://api.github.com/users/obiltschnig/following{/other_user}","gists_url":"https://api.github.com/users/obiltschnig/gists{/gist_id}","starred_url":"https://api.github.com/users/obiltschnig/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/obiltschnig/subscriptions","organizations_url":"https://api.github.com/users/obiltschnig/orgs","repos_url":"https://api.github.com/users/obiltschnig/repos","events_url":"https://api.github.com/users/obiltschnig/events{/privacy}","received_events_url":"https://api.github.com/users/obiltschnig/received_events","type":"User","site_admin":false},"open_issues":65,"closed_issues":22,"state":"open","created_at":"2016-02-29T08:09:45Z","updated_at":"2017-10-28T03:40:29Z","due_on":"2017-11-06T08:00:00Z","closed_at":null},"comments":6,"created_at":"2017-10-22T05:34:58Z","updated_at":"2017-10-28T03:57:07Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"I write a simple HTTP client to download a file and I get following exception:  \r\n> Net Exception: Address family not supported\r\n\r\nI try to find out the root cause of these error because my code was working.\r\nI found following weird bug:\r\n\r\nI print following member stack addresses:\r\n* _counter member in RefCountedObject ->  poco/Foundation/src/RefCountedObject.cpp:26\r\n* _addr member in IPv4SocketAddressImpl -> poco/Net/src/SocketAddressImpl.cpp:63\r\n* _addr member in IPv4SocketAddressImpl addr function -> poco/Net/include/Poco/Net/SocketAddressImpl.h:103\r\n\r\n(see also my https://github.com/Bjoe/poco.git Branch: stack_address_issue) \r\n\r\nand I get following result:\r\n\r\n\r\n RefCountedObject::RefCountedObject() Stack address from _counter:             **0x2639bc8**\r\n IPv4SocketAddressImpl::IPv4SocketAddressImpl() Stack address from _addr: **0x2639bcc**\r\n IPv4SocketAddressImpl::addr() Stack address from _addr:                               **0x2639bc8**\r\n \r\n \r\n\r\nWTH... why is the stack address from _addr in function addr the same stack addr in _counter **0x2639bc8** ?\r\n\r\nI try some compiler and it looks like it only happens with clang and -std=XXX argument without any optimization:\r\n\r\nclang++-3.8 -std=c++11\r\nclang++-4.0 -std=c++11\r\nclang++-3.8 -std=c++14\r\nclang++-4.0 -std=c++14\r\n\r\nIf I move the function\r\n```\r\ninline const struct sockaddr* IPv4SocketAddressImpl::addr() const\r\n````\r\nfrom the header in the source file it works.\r\n\r\nHave somebody an idea?\r\nHow looks like on android? They use also clang there.\r\nIs this really a compiler bug?\r\nLooks like on FreeBSD, they use clang as compiler, they have also this issue, see #1684 \r\n\r\n\r\nHere my code to test:\r\n```\r\n#include <Poco/Net/SocketAddress.h>\r\nint main()\r\n{\r\n  Poco::Net::SocketAddress sa(\"localhost\", 80);\r\n  const sockaddr* s = sa.addr();\r\n  return 0;\r\n}\r\n\r\n```\r\nwith my branch:\r\nhttps://github.com/Bjoe/poco.git Branch: stack_address_issue"},"comment":{"url":"https://api.github.com/repos/pocoproject/poco/issues/comments/340137175","html_url":"https://github.com/pocoproject/poco/issues/1950#issuecomment-340137175","issue_url":"https://api.github.com/repos/pocoproject/poco/issues/1950","id":340137175,"user":{"login":"aleks-f","id":2429093,"avatar_url":"https://avatars1.githubusercontent.com/u/2429093?v=4","gravatar_id":"","url":"https://api.github.com/users/aleks-f","html_url":"https://github.com/aleks-f","followers_url":"https://api.github.com/users/aleks-f/followers","following_url":"https://api.github.com/users/aleks-f/following{/other_user}","gists_url":"https://api.github.com/users/aleks-f/gists{/gist_id}","starred_url":"https://api.github.com/users/aleks-f/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aleks-f/subscriptions","organizations_url":"https://api.github.com/users/aleks-f/orgs","repos_url":"https://api.github.com/users/aleks-f/repos","events_url":"https://api.github.com/users/aleks-f/events{/privacy}","received_events_url":"https://api.github.com/users/aleks-f/received_events","type":"User","site_admin":false},"created_at":"2017-10-28T03:57:07Z","updated_at":"2017-10-28T03:57:07Z","author_association":"OWNER","body":"an alternative for 1.8: ke SOo and no-SOO, but for no SOO version remove inheriting from RefCountedObject and move reference counting functionality directly into *Impl classes (not much work) and un-inline everything, so these classes look always the same to the users, regardless of an application compile-time flags"}}
{"actor":{"display_login":"aleks-f"}}