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

Net Exception: Address family not supported with clang #1950

Closed
Bjoe opened this issue Oct 22, 2017 · 14 comments
Closed

Net Exception: Address family not supported with clang #1950

Bjoe opened this issue Oct 22, 2017 · 14 comments
Assignees
Milestone

Comments

@Bjoe
Copy link
Contributor

Bjoe commented Oct 22, 2017

I write a simple HTTP client to download a file and I get following exception:

Net Exception: Address family not supported

I try to find out the root cause of these error because my code was working.
I found following weird bug:

I print following member stack addresses:

  • _counter member in RefCountedObject -> poco/Foundation/src/RefCountedObject.cpp:26
  • _addr member in IPv4SocketAddressImpl -> poco/Net/src/SocketAddressImpl.cpp:63
  • _addr member in IPv4SocketAddressImpl addr function -> poco/Net/include/Poco/Net/SocketAddressImpl.h:103

(see also my https://github.com/Bjoe/poco.git Branch: stack_address_issue)

and I get following result:

RefCountedObject::RefCountedObject() Stack address from _counter: 0x2639bc8
IPv4SocketAddressImpl::IPv4SocketAddressImpl() Stack address from _addr: 0x2639bcc
IPv4SocketAddressImpl::addr() Stack address from _addr: 0x2639bc8

WTH... why is the stack address from _addr in function addr the same stack addr in _counter 0x2639bc8 ?

I try some compiler and it looks like it only happens with clang and -std=XXX argument without any optimization:

clang++-3.8 -std=c++11
clang++-4.0 -std=c++11
clang++-3.8 -std=c++14
clang++-4.0 -std=c++14

If I move the function

inline const struct sockaddr* IPv4SocketAddressImpl::addr() const

from the header in the source file it works.

Have somebody an idea?
How looks like on android? They use also clang there.
Is this really a compiler bug?
Looks like on FreeBSD, they use clang as compiler, they have also this issue, see #1684

Here my code to test:

#include <Poco/Net/SocketAddress.h>
int main()
{
  Poco::Net::SocketAddress sa("localhost", 80);
  const sockaddr* s = sa.addr();
  return 0;
}

with my branch:
https://github.com/Bjoe/poco.git Branch: stack_address_issue

@aleks-f
Copy link
Member

aleks-f commented Oct 24, 2017

@Bjoe that's with 1.7.9, right?

@aleks-f
Copy link
Member

aleks-f commented Oct 25, 2017

@Bjoe I can't reproduce it, tried with clang 3.8 debug build. Somehow, there seems to be a compile-time mixup and AutoPtr ends up being mixed with SOO mode, then you have class inheriting from RefCountedObject, and the first data member is _counter. That's the only explanation I have for that behavior.

There was an unrelated problem with MSVC precompiled headers and inlining of some IPAddress functions, fixed recently in develop. Can you try similar fix with SocketAddress and see if it fixes the problem (even better, try to understand why it happens, I can't reproduce and don't see it from reading code).

thanks for your help.

Bjoe added a commit to Bjoe/poco that referenced this issue Oct 26, 2017
Add workaround for clang, move inline functions from header to source file
@Bjoe
Copy link
Contributor Author

Bjoe commented Oct 26, 2017

@aleks-f Sorry for the late answer. I try to create a bug report to clang. I try to create a small snippet for the bug report but it is not easy to reproduce this bug :-(.

that's with 1.7.9, right?

Yes, sorry I forgott some infos.

Somehow, there seems to be a compile-time mixup and AutoPtr ends up being mixed with SOO mode, then you have class inheriting from RefCountedObject, and the first data member is _counter.

I also thinking about this. When is the define POCO_HAVE_ALIGNMENT set?

There was an unrelated problem with MSVC precompiled headers and inlining of some IPAddress functions, fixed recently in develop. Can you try similar fix with SocketAddress and see if it fixes the problem

Yes, that is what I mean with

If I move the function ... from the header in the source file ...

See also my pull request.

I tested on:
Distributor ID: Ubuntu
Description: Ubuntu 17.04
Release: 17.04
Codename: zesty
poco 1.7.9

@aleks-f On which platftorm you test this? Can you try following:

Use poco from my github repo:
https://github.com/Bjoe/poco.git

Use branch: stack_address_issue
or
commit id: dcbc92e2e3d71a58180d24343023108a530aac44

git checkout dcbc92e2e3d71a58180d24343023108a530aac44

Build poco:

poco/configure --omit=Data,NetSSL,Zip,XML,JSON,CppParser,Crypto,MongoDB,PDF,Util --prefix=/opt/poco-1.7.9 --no-samples --no-tests

Edit config.make. Change POCO_CONFIG = Linux to POCO_CONFIG = Linux-clang

or use cmake build system:
cmake -DCMAKE_CXX_COMPILER=clang++ -DCMAKE_C_COMPILER=clang -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/opt/poco-1.7.9 -DENABLE_XML=OFF -DENABLE_JSON=OFF -DENABLE_MONGODB=OFF -DENABLE_PDF=OFF -DENABBLE_UTIL=OFF -DENABLE_NETSSL=OFF -DENABLE_CRYPTO=OFF -DENABLE_DATA=OFF -DENABLE_ZIP=OFF -DENABLE_PAGECOMPILER=OFF -DENABLE_PAGECOMPILER_FILE2PAGE=OFF poco

execute: make install

Compile this code:

#include <Poco/Net/SocketAddress.h>
int main()
{
  Poco::Net::SocketAddress sa("localhost", 80);
  const sockaddr* s = sa.addr();
  return 0;
}

with:

clang++ -I/opt/poco-1.7.9/include -std=c++1y -MD -MT main.cpp.o -MF main.cpp.o.d -o main.cpp.o -c main.cpp
clang++ -std=c++1y main.cpp.o -o test-debug -rdynamic /opt/poco-1.7.9/lib/libPocoNetd.so /opt/poco-1.7.9/lib/libPocoFoundationd.so

execute test-debug:
RefCountedObject::RefCountedObject Stack address from _counter: 0x1ab0fc8
IPv4SocketAddressImpl::IPv4SocketAddressImpl Stack address from _addr: 0x1ab0fcc
IPv4SocketAddressImpl::addr Stack address from _addr: 0x1ab0fc8

Now you should get the weird bug.

Build with -Ox here with -O1
clang++ -I/opt/poco-1.7.9/include -std=c++1y -O1 -MD -MT main.cpp.o -MF main.cpp.o.d -o main.cpp.o -c /Development/poco-example/main.cpp
clang++ -std=c++1y -O1 main.cpp.o -o test-debug -rdynamic /opt/poco-1.7.9/lib/libPocoNetd.so /opt/poco-1.7.9/lib/libPocoFoundationd.so

RefCountedObject::RefCountedObject Stack address from _counter: 0xb86fc8
IPv4SocketAddressImpl::IPv4SocketAddressImpl Stack address from _addr: 0xb86fcc
IPv4SocketAddressImpl::addr Stack address from _addr: 0xb86fcc

all is fine.

Build without -std=c++XX and withouth -Ox:

clang++-3.8 -I/opt/poco-1.7.9/include -MD -MT main.cpp.o -MF main.cpp.o.d -o main.cpp.o -c main.cpp
clang++-3.8 main.cpp.o -o test-debug -rdynamic /opt/poco-1.7.9/lib/libPocoNetd.so /opt/poco-1.7.9/lib/libPocoFoundationd.so

is also fine.

For me it looks like it is a clang compiler bug. Should I post this to clang bug report? Maybe I meet somebody from clang project on the "Meeting C++" conference in Berlin :-)

@aleks-f
Copy link
Member

aleks-f commented Oct 26, 2017

When is the define POCO_HAVE_ALIGNMENT set?

It is set here. The intent was to use the custom alignment code on pre-c++11 compilers, but as it is now, it will not come automatically into effect unless c++11 mode is enabled (ie. default c++11 build will use standard alignment code).

Should I post this to clang bug report?

If you can create a simple example reproducing it, sure. One way or the other, I'd un-inline all the related functions in SocketAddress and IPAddress to prevent it from happening.

I'm busy with other things at the moment, may come to it later.

I could not reproduce with:

alex@ubuntu16:~$ uname -a 
Linux ubuntu16 4.4.0-97-generic #120-Ubuntu SMP Tue Sep 19 17:28:18 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
alex@ubuntu16:~$ c++ --version
clang version 3.8.0-2ubuntu4 (tags/RELEASE_380/final)
Target: x86_64-pc-linux-gnu
Thread model: posix
InstalledDir: /usr/bin

@Bjoe
Copy link
Contributor Author

Bjoe commented Oct 27, 2017

It is set here. The intent was to use the custom alignment code on pre-c++11 compilers, but as it is now, it will not come automatically into effect unless c++11 mode is enabled (ie. default c++11 build will use standard alignment code).

Ok. I was expected that I can choose if I will have POCO_HAVE_ALIGNMENT via a parameter on configure or cmake.

I wonder what happens with following scenarios:

When POCO library is building with C++11 parameter. POCO_HAVE_ALIGNMENT is activated and after the preprocessor the header of SocketAddress.h and SocketAddressImpl.h looks like:

SocketAddress.h

namespace Poco {
namespace Net {

class IPAddress;

class __attribute__ ((visibility ("default"))) SocketAddress
{
public:
 SocketAddress();

 ....
 
 Ptr pImpl() const;

 void newIPv4();

 void newIPv4(const sockaddr_in*);

 void newIPv4(const IPAddress& hostAddress, Poco::UInt16 portNumber);

 ....
 
 char* storage();

  AlignedCharArrayUnion <Poco::Net::Impl::IPv6SocketAddressImpl>

  _memory;
};

....

inline void SocketAddress::newIPv4()
{
 new (storage()) Poco::Net::Impl::IPv4SocketAddressImpl;
}

inline void SocketAddress::newIPv4(const sockaddr_in* sockAddr)
{
 new (storage()) Poco::Net::Impl::IPv4SocketAddressImpl(sockAddr);
}

inline void SocketAddress::newIPv4(const IPAddress& hostAddress, Poco::UInt16 portNumber)
{
 new (storage()) Poco::Net::Impl::IPv4SocketAddressImpl(hostAddress.addr(), htons(portNumber));
}
...

SocketAddressImpl.h

class __attribute__ ((visibility ("default"))) SocketAddressImpl



{
public:
 virtual ~SocketAddressImpl();

 virtual IPAddress host() const = 0;
 virtual UInt16 port() const = 0;
 virtual socklen_t length() const = 0;
 virtual const struct sockaddr* addr() const = 0;
 virtual int af() const = 0;

protected:
 SocketAddressImpl();

private:
 SocketAddressImpl(const SocketAddressImpl&);
 SocketAddressImpl& operator = (const SocketAddressImpl&);
};


class __attribute__ ((visibility ("default"))) IPv4SocketAddressImpl: public SocketAddressImpl
{
public:
 IPv4SocketAddressImpl();
 IPv4SocketAddressImpl(const struct sockaddr_in* addr);
 IPv4SocketAddressImpl(const void* addr, UInt16 port);
 IPAddress host() const;
 UInt16 port() const;
 socklen_t length() const;
 const struct sockaddr* addr() const;
 int af() const;
 IPAddress::Family family() const;
 std::string toString() const;

private:
 struct sockaddr_in _addr;
};

....

inline const struct sockaddr* IPv4SocketAddressImpl::addr() const
{
 return reinterpret_cast<const struct sockaddr*>(&_addr);
}
....

Now I build my project that uses POCO withouth C++11 parameter. POCO_HAVE_ALIGNMENT is not activated and after the preprocessor the header of SocketAddress.h and SocketAddressImpl.h looks like:

SocketAddress.h

namespace Poco {
namespace Net {

class IPAddress;

class __attribute__ ((visibility ("default"))) SocketAddress

{
public:
 SocketAddress();

...

private:
 typedef Poco::Net::Impl::SocketAddressImpl Impl;

 typedef Poco::AutoPtr<Impl> Ptr;

 Ptr pImpl() const;

 void newIPv4();

 void newIPv4(const sockaddr_in*);

 void newIPv4(const IPAddress& hostAddress, Poco::UInt16 portNumber);
 
 Ptr _pImpl;

};

...

inline SocketAddress::Ptr SocketAddress::pImpl() const
{
 if (_pImpl) return _pImpl;
 throw Poco::NullPointerException("Pointer to SocketAddress implementation is NULL.");
}

inline void SocketAddress::newIPv4()
{
 _pImpl = new Poco::Net::Impl::IPv4SocketAddressImpl;
}

inline void SocketAddress::newIPv4(const sockaddr_in* sockAddr)
{
 _pImpl = new Poco::Net::Impl::IPv4SocketAddressImpl(sockAddr);
}

inline void SocketAddress::newIPv4(const IPAddress& hostAddress, Poco::UInt16 portNumber)
{
 _pImpl = new Poco::Net::Impl::IPv4SocketAddressImpl(hostAddress.addr(), htons(portNumber));
}

SocketAddressImpl.h

namespace Poco {
namespace Net {
namespace Impl {


class __attribute__ ((visibility ("default"))) SocketAddressImpl

 : public Poco::RefCountedObject

{
public:
 virtual ~SocketAddressImpl();

 virtual IPAddress host() const = 0;
 virtual UInt16 port() const = 0;
 virtual socklen_t length() const = 0;
 virtual const struct sockaddr* addr() const = 0;
 virtual int af() const = 0;

protected:
 SocketAddressImpl();

private:
 SocketAddressImpl(const SocketAddressImpl&);
 SocketAddressImpl& operator = (const SocketAddressImpl&);
};


class __attribute__ ((visibility ("default"))) IPv4SocketAddressImpl: public SocketAddressImpl
{
public:
 IPv4SocketAddressImpl();
 IPv4SocketAddressImpl(const struct sockaddr_in* addr);
 IPv4SocketAddressImpl(const void* addr, UInt16 port);
 IPAddress host() const;
 UInt16 port() const;
 socklen_t length() const;
 const struct sockaddr* addr() const;
 int af() const;
 IPAddress::Family family() const;
 std::string toString() const;

private:
 struct sockaddr_in _addr;
};

...

inline const struct sockaddr* IPv4SocketAddressImpl::addr() const
{
 return reinterpret_cast<const struct sockaddr*>(&_addr);
}

Ok, newIPv4() functions are private and is only accessible via SocketAddress. So this function is compiled into the library and should never compiled in my project (Hopefully nobody will create this function public).

But what is with SocketAddressImpl? With POCO_HAVE_ALIGNMENT, SocketAddressImpl is not inherited from RefCountedObject. Without POCO_HAVE_ALIGNMENT, SocketAddressImpl is inherited from RefCountedObject.

From my example project, the compiler thinks that in Poco library SocketAddressImpl is inherited from RefCountedObject, but it is not. This mismatch affects only IPv4SocketAddressImpl::addr() because this function is compiled in my project. The constructor of IPv4SocketAddressImpl is compiled in the library.

BtW, POCO_HAVE_ALIGNMENT is not only depended on the c++11 compiler parameter. In Alignment.h there check which compiler is used. For example, if clang is used as compiler and they have the cxx_alignas feature, POCO_HAVE_ALIGNMENT is also set.

I wonder, how I know as a "library user" which implementation/parameter is used when I install POCO via the package manager of the OS? For example we have this issue with #1684. I know that FreeBSD is using as default compiler, clang in the build system. I don't know if Dian8 is using gcc as a default compiler, because it is possible on FreeBSD to change this localy.

It looks like the ABI of POCO libray is depended on POCO_HAVE_ALIGNMENT.
Maybe we have following solutions:

  1. Move all dependend POCO_HAVE_ALIGNMENT headers/inline ... .h and .ipp ... like boost.
  2. Move all dependend POCO_HAVE_ALIGNMENT "in source" files to "hide the implementation".
  3. Create a config.h in the build process to "save" how the library is build. Like openssl or pjproject. This can still make problems...

Some other ideas ? Comments ?

@aleks-f
Copy link
Member

aleks-f commented Oct 27, 2017

@Bjoe This feature has caused more trouble than benefit; I'd say, let's make things clean and simple - get rid of all SOO for IPAddress and SocketAddress altogether for 1.8.0. And un-inline anything that may cause problems.

2.0 is c++11 and alignment availability is guaranteed by standard, so the *Impl RefCountedObject inheritance can be removed and only SOO version used. I'll clean up develop for 2.0

@obiltschnig ?

@aleks-f aleks-f added this to the Release 1.8.0 milestone Oct 27, 2017
@aleks-f
Copy link
Member

aleks-f commented Oct 28, 2017

an alternative for 1.8: have 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

@Bjoe
Copy link
Contributor Author

Bjoe commented Oct 28, 2017

I'd say, let's make things clean and simple

Full Ack! 👍

get rid of all SOO for IPAddress and SocketAddress altogether for 1.8.0.

👍

an alternative for 1.8: have SOO and no-SOO, but for no-SOO version remove inheriting from RefCountedObject move reference counting functionality directly into *Impl classes

That's also an alternative.

un-inline everything, so these classes look always the same to the users, regardless of an application compile-time flags

That's what I mean with: Move all dependend POCO_HAVE_ALIGNMENT "in source" files to "hide the implementation".

Or, let developer decide if he will have POCO_HAVE_ALIGNMENT or not via a parameter at the build system. Default is off so that POCO is compiled on every Linux/Unix OS'es without POCO_HAVE_ALIGNMENT and POCO works with every compiler.
But, I vote for '''let's make things clean and simple''' .... Is mostly the better approach.

Let me know which solution we will choose. I will help you.

Btw. should I close my merge request #1959 ?

@Bjoe Bjoe closed this as completed Oct 28, 2017
@Bjoe Bjoe reopened this Oct 28, 2017
@Bjoe
Copy link
Contributor Author

Bjoe commented Oct 28, 2017

Sorry, by accident I pressed wrong button ...

@aleks-f
Copy link
Member

aleks-f commented Oct 30, 2017

Let's remove SOO for both IPAddress and SocketAddress in 1.8

should I close my merge request #1959 ?

Either (a) close and create a new one, or (b) modify it in accordance with the above.

I'll take care of develop.

@aleks-f
Copy link
Member

aleks-f commented Oct 30, 2017

the correct related issue mentioned in commit was #234 , not #264

@Bjoe
Copy link
Contributor Author

Bjoe commented Nov 2, 2017

Let's remove SOO for both IPAddress and SocketAddress in 1.8

@aleks-f There is a pull request #1971

@Bjoe Bjoe mentioned this issue Nov 2, 2017
@aleks-f
Copy link
Member

aleks-f commented Nov 2, 2017

@Bjoe I'm ok with it, requested review from @obiltschnig; he is working on 1.8 release and we did not yet hear from him about this issue

aleks-f pushed a commit that referenced this issue Dec 11, 2017
* Workaround bug in SolarisStudio 12.4 on RVO-ed objects.

* HttpClientSession set specific proxysettings for attached socket

If we have a global proxy settings and we attach an external socket to the HTTPClientSession there's no way to use different proxy settings for that connection. For example if you do not need for that connection httpproxy because is already attached to the correct and point

* Fix ".. has no member named ... compile error" (#1938)

* Fix ".. has no member named ... compile error" by renaming apache conn_rec
attributes

 - conn_rec attributes remote_ip and remote_addr were replaced by client_ip
 and client_addr once they have been renamed in Apache 2.4
 - a server_rec pointer must be passed to ap_log_error() since apache 2.4,
 therefore, a change was necessary at the ap_log_error log function.
 A null pointer has been passed for avoiding deeper changes at the function.
 - the smart pointer auto_ptr was replaced by unique_ptr once it was made
 deprecated in C++11 standard, it has been replaced by unique_ptr.

* Add the properly #ifdef directives for backward compatibility purposes

 - Adding proper #ifdef preprocessor directives to keeping backward
 compatibility with older apache versions.

* Update ApacheConnector.cpp

* Add Gradle build.scripts

Signed-off-by: zosrothko <zosrothko@orange.fr>

* New files

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Add distrib directory

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Add PostgreSQL. Remove POCO_NO_WSTRING

Signed-off-by: zosrothko <zosrothko@orange.fr>

* CYgwin: remove -DPOCO_NO_WSTRING & build Data/PostgreSQL (#1942)

* Upgrade to mysql-5.7.19-win32 (#1944)

* fix -Woverloaded-virtual

* remove return

* SyntaxException for DateTimeParser::parse not working #569

* remove leftover comment

* fix some warnings

* purge trailing whitespace (#1947)

* add Poco::makeUnique()

* NTP Packet impl not according to RFC958? #749

* Poco::Data ODBC impl doesn't bind to unsigned numeric types properly #1683

* Remove useless windows commands (#1948)

* Remove useless Windows commands

* Generate build_cmd only for VS140 & VS150

* Display target configuration

* Upgrade to mysql-5.7.19 (#1951)

* Travis & AppVeyor: Unbind PDF module (#1953)

* Unbind PDF

* Upgrade to mysql-5.7.19

* Put Cygwin ahead

* Add --omit=PDF

* Display target configuration (#1952)

* #1878 Add OrangePi on Build Support (#1949)

- Created the configuration `OrangePi`, based on ARM-Linux,
  with fine tune for OrangePi
- I tested using Poco samples on OrangePi Zero

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* fix mysql odbc tests

* Renamed directory distrib to packaging

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Update .gradle/

* Restore lost changes by git

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Update openssl path

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Comment out displaying the compiler log

* Create issue_template.md

* Compile all C source as C++ source

* Add gradle submodule

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Remove /TP for compiling C code

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Reinsert SemiStaticLibrary build

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Fixed invalid merge

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Missing files

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Oracle ODBC fixes

* restore deleted documentation

* wrong field size calculation in ODBC code #1659; other max size excession checks and testcase

* Rebuild PocoDoc

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Remove deleted includes

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Align with develop branch

* Add task pocoTasks and dependency with nuget & candle

* some fixes (mostly unicode/bulk)

* #264, #1684, #1950

* Buffer<> swap miss ownMem #1964

* speling fix

* speling fix

* make uninstall does not remove .so symlinks #1017

* add uninstall to phony

* Base64Encoder/Decoder: added support for 'base64url' encoding

* removed $ tags

* remove remaining $Id$ tags from file headers

* Fix/tcp dispatcher (#1965)

* TCPServerDispatcher::run() issue #1884; make integral members atomic and minimize locking

* Update TCPServerDispatcher.cpp

* fix test

* fix test with gcc

* fixed GH #1934: File::setExecutable() on POSIX should set executable bit for group and other if corresponding readable bit is set

* Implement MailMessage::decode #1543 (wip)

* added PollSet class

* updated VS project files for PollSet

* PollSet: on Windows, use WSAPoll if available

* GH #1412: added Poco::DigestEngine::constantTimeEquals()

* - fix Zip Decompress Parent Path Injection #1968 bug
- add valid patch check test
- add vulnearbility triggering zip archive and test
- remove temporary test output files
- if possible, redirect temporary file generation to temp directory or
- delete temporary files after tests

* fix relative path check, eliminate unused warnings

* minor fixes

* minor fixes

* Implement MailMessage::decode #1543 (wip 2)

* fix warning

* only convert encoded-word if explicitly requested

* Add kit version 10 for message compiler (#1978)

* Restore _ostr(std::cout) to avoid timeouts on AppVeyor (#1980)

* additional fix for GH #1212: WebSocketImpl::available() now reports number of bytes in internal buffer.

* fixed GH #1828: DeflatingStreamBuf::sync() should also flush underlying stream.

* Implement MailMessage::decode #1543 (tentatively done); add encode 'B', decode 'Q' and 'B'

* TextEncodingRegistry documentation

* merged connection string URI support from 1.8

* fixed GH #1425: Workaround bug in SolarisStudio 12.4 on RVO-ed objects.

* Remove Cygwin build (#1985)

* fixed GH #1404: Add Poco::Data::Statement::bind() method

* GH #1988: Remove OpenVMS support

* replace strerror() with Poco::Error::getMessage()

* replace strerror() with Poco::Error::getMessage()

* upgraded bundled SQLite to 3.21.0

* Fix writing into closed socket from streambuf

In case of error occured in writeToDevice pptr may become one byte
farther than epptr. This can lead to crash in streambuf::xsputn from
libstdc++.

* CMake patches for FreeBSD (#1989)

* Switch FreeBSD to poll

* Link against dl and rt on FreeBSD

* pd_json strerror deprecation warning on Windows #1984

* revert #1828

* Backport from poco-1.8.0

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Add coverage directory

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Backport from poco-1.8.0

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Add coverage task & tools

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Removed

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Backport from poco-1.8.0

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Added

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Add OpenCppCoverage & ReportGenerator tasks

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Add CPPUNIT_IGNORE variable

Signed-off-by: zosrothko <zosrothko@orange.fr>

* style fix

* updated README.md

* Add mechanism to start a task from within a task (#1287)

* Add mechanism to start a task from within a task

Staying in the same thread.

* Provide seeds for a task queue creation

TaskManager::taskFinished removes the finished task from the task list
before dispatching the taskFinished notification

* fixup! Add mechanism to start a task from within a task

* fixup! Add mechanism to start a task from within a task

* Add Task::yield

on the same model as Task::sleep

* implement Poco::SharedPtr using std::shared_ptr (#1993)

* added additional move constructor and assignment operators

* Fix building XMLStreamParser with unbundled expat

* Add Directory for coverage task

* Remove Cygwin build that exceeds 2 hours and reaches the timeout

* WiX Poco wxs should not port the Poco version

* Harden RecursiveDirectoryIterator when walking the filesystem. (#2001)

* In the implementation for the *Traverse strategies the next method performs an unguarded list directory.  If the directory is not accessible an unrecoverable error is raised thus ruining the walk.  This changeset adopts and adapts the error handling protocol as defined in Python's os.walk function where errors from listdir are ignored or are reported to an optional on error callback function.

* Expand DirectoryIteratorsTest testsuite to confirm the hardened iterator behaviour over unreadable directories.

* Expand DirectoryIteratorsTest testsuite to confirm the hardened iterator behaviour over
  unreadable directories.  Correct bad formatting

* fix clang compile

* SharePtr fix for gcc 7.2 (#2004)

* Fix EVPTest on RHEL/Fedora by removing hard-coded EC curve name (#2002)

RHEL/Fedora seem to have a much more limited set of EC curves available by
default.  This change will instead use the first curve name as used in other
places.

* Parallel C++ compiler jobs limited to 2

* Add missing '\''

* Removed

* Cleanup

* Cleanup

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Remove removed XXXX_WIN32.h includes

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Update for VisualStudio 2017

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Add debug log

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Refactoring

Signed-off-by: zosrothko <zosrothko@orange.fr>

* dos2unix

Signed-off-by: zosrothko <zosrothko@orange.fr>

* SQLToMongoDB does not build

* Merge

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Exclude Crypto testsuite for now

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Update for VS2017

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Update for VS2017

Signed-off-by: zosrothko <zosrothko@orange.fr>
aleks-f pushed a commit that referenced this issue Dec 21, 2017
* Workaround bug in SolarisStudio 12.4 on RVO-ed objects.

* HttpClientSession set specific proxysettings for attached socket

If we have a global proxy settings and we attach an external socket to the HTTPClientSession there's no way to use different proxy settings for that connection. For example if you do not need for that connection httpproxy because is already attached to the correct and point

* Fix ".. has no member named ... compile error" (#1938)

* Fix ".. has no member named ... compile error" by renaming apache conn_rec
attributes

 - conn_rec attributes remote_ip and remote_addr were replaced by client_ip
 and client_addr once they have been renamed in Apache 2.4
 - a server_rec pointer must be passed to ap_log_error() since apache 2.4,
 therefore, a change was necessary at the ap_log_error log function.
 A null pointer has been passed for avoiding deeper changes at the function.
 - the smart pointer auto_ptr was replaced by unique_ptr once it was made
 deprecated in C++11 standard, it has been replaced by unique_ptr.

* Add the properly #ifdef directives for backward compatibility purposes

 - Adding proper #ifdef preprocessor directives to keeping backward
 compatibility with older apache versions.

* Update ApacheConnector.cpp

* Add Gradle build.scripts

Signed-off-by: zosrothko <zosrothko@orange.fr>

* New files

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Add distrib directory

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Add PostgreSQL. Remove POCO_NO_WSTRING

Signed-off-by: zosrothko <zosrothko@orange.fr>

* CYgwin: remove -DPOCO_NO_WSTRING & build Data/PostgreSQL (#1942)

* Upgrade to mysql-5.7.19-win32 (#1944)

* fix -Woverloaded-virtual

* remove return

* SyntaxException for DateTimeParser::parse not working #569

* remove leftover comment

* fix some warnings

* purge trailing whitespace (#1947)

* add Poco::makeUnique()

* NTP Packet impl not according to RFC958? #749

* Poco::Data ODBC impl doesn't bind to unsigned numeric types properly #1683

* Remove useless windows commands (#1948)

* Remove useless Windows commands

* Generate build_cmd only for VS140 & VS150

* Display target configuration

* Upgrade to mysql-5.7.19 (#1951)

* Travis & AppVeyor: Unbind PDF module (#1953)

* Unbind PDF

* Upgrade to mysql-5.7.19

* Put Cygwin ahead

* Add --omit=PDF

* Display target configuration (#1952)

* #1878 Add OrangePi on Build Support (#1949)

- Created the configuration `OrangePi`, based on ARM-Linux,
  with fine tune for OrangePi
- I tested using Poco samples on OrangePi Zero

Signed-off-by: Uilian Ries <uilianries@gmail.com>

* fix mysql odbc tests

* Renamed directory distrib to packaging

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Update .gradle/

* Restore lost changes by git

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Update openssl path

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Comment out displaying the compiler log

* Create issue_template.md

* Compile all C source as C++ source

* Add gradle submodule

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Remove /TP for compiling C code

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Reinsert SemiStaticLibrary build

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Fixed invalid merge

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Missing files

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Oracle ODBC fixes

* restore deleted documentation

* wrong field size calculation in ODBC code #1659; other max size excession checks and testcase

* Rebuild PocoDoc

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Remove deleted includes

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Align with develop branch

* Add task pocoTasks and dependency with nuget & candle

* some fixes (mostly unicode/bulk)

* #264, #1684, #1950

* Buffer<> swap miss ownMem #1964

* speling fix

* speling fix

* make uninstall does not remove .so symlinks #1017

* add uninstall to phony

* Base64Encoder/Decoder: added support for 'base64url' encoding

* removed $ tags

* remove remaining $Id$ tags from file headers

* Fix/tcp dispatcher (#1965)

* TCPServerDispatcher::run() issue #1884; make integral members atomic and minimize locking

* Update TCPServerDispatcher.cpp

* fix test

* fix test with gcc

* fixed GH #1934: File::setExecutable() on POSIX should set executable bit for group and other if corresponding readable bit is set

* Implement MailMessage::decode #1543 (wip)

* added PollSet class

* updated VS project files for PollSet

* PollSet: on Windows, use WSAPoll if available

* GH #1412: added Poco::DigestEngine::constantTimeEquals()

* - fix Zip Decompress Parent Path Injection #1968 bug
- add valid patch check test
- add vulnearbility triggering zip archive and test
- remove temporary test output files
- if possible, redirect temporary file generation to temp directory or
- delete temporary files after tests

* fix relative path check, eliminate unused warnings

* minor fixes

* minor fixes

* Implement MailMessage::decode #1543 (wip 2)

* fix warning

* only convert encoded-word if explicitly requested

* Add kit version 10 for message compiler (#1978)

* Restore _ostr(std::cout) to avoid timeouts on AppVeyor (#1980)

* additional fix for GH #1212: WebSocketImpl::available() now reports number of bytes in internal buffer.

* fixed GH #1828: DeflatingStreamBuf::sync() should also flush underlying stream.

* Implement MailMessage::decode #1543 (tentatively done); add encode 'B', decode 'Q' and 'B'

* TextEncodingRegistry documentation

* merged connection string URI support from 1.8

* fixed GH #1425: Workaround bug in SolarisStudio 12.4 on RVO-ed objects.

* Remove Cygwin build (#1985)

* fixed GH #1404: Add Poco::Data::Statement::bind() method

* GH #1988: Remove OpenVMS support

* replace strerror() with Poco::Error::getMessage()

* replace strerror() with Poco::Error::getMessage()

* upgraded bundled SQLite to 3.21.0

* Fix writing into closed socket from streambuf

In case of error occured in writeToDevice pptr may become one byte
farther than epptr. This can lead to crash in streambuf::xsputn from
libstdc++.

* CMake patches for FreeBSD (#1989)

* Switch FreeBSD to poll

* Link against dl and rt on FreeBSD

* pd_json strerror deprecation warning on Windows #1984

* revert #1828

* Backport from poco-1.8.0

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Add coverage directory

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Backport from poco-1.8.0

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Add coverage task & tools

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Removed

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Backport from poco-1.8.0

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Added

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Add OpenCppCoverage & ReportGenerator tasks

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Add CPPUNIT_IGNORE variable

Signed-off-by: zosrothko <zosrothko@orange.fr>

* style fix

* updated README.md

* Add mechanism to start a task from within a task (#1287)

* Add mechanism to start a task from within a task

Staying in the same thread.

* Provide seeds for a task queue creation

TaskManager::taskFinished removes the finished task from the task list
before dispatching the taskFinished notification

* fixup! Add mechanism to start a task from within a task

* fixup! Add mechanism to start a task from within a task

* Add Task::yield

on the same model as Task::sleep

* implement Poco::SharedPtr using std::shared_ptr (#1993)

* added additional move constructor and assignment operators

* Fix building XMLStreamParser with unbundled expat

* Add Directory for coverage task

* Remove Cygwin build that exceeds 2 hours and reaches the timeout

* WiX Poco wxs should not port the Poco version

* Harden RecursiveDirectoryIterator when walking the filesystem. (#2001)

* In the implementation for the *Traverse strategies the next method performs an unguarded list directory.  If the directory is not accessible an unrecoverable error is raised thus ruining the walk.  This changeset adopts and adapts the error handling protocol as defined in Python's os.walk function where errors from listdir are ignored or are reported to an optional on error callback function.

* Expand DirectoryIteratorsTest testsuite to confirm the hardened iterator behaviour over unreadable directories.

* Expand DirectoryIteratorsTest testsuite to confirm the hardened iterator behaviour over
  unreadable directories.  Correct bad formatting

* fix clang compile

* SharePtr fix for gcc 7.2 (#2004)

* Fix EVPTest on RHEL/Fedora by removing hard-coded EC curve name (#2002)

RHEL/Fedora seem to have a much more limited set of EC curves available by
default.  This change will instead use the first curve name as used in other
places.

* Parallel C++ compiler jobs limited to 2

* Updated to PCRE version 8.41

Testing Done: Built on Windows OS for all configurations.

* Add missing '\''

* Removed

* Cleanup

* Cleanup

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Remove removed XXXX_WIN32.h includes

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Update for VisualStudio 2017

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Add debug log

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Refactoring

Signed-off-by: zosrothko <zosrothko@orange.fr>

* dos2unix

Signed-off-by: zosrothko <zosrothko@orange.fr>

* SQLToMongoDB does not build

* Merge

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Exclude Crypto testsuite for now

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Update for VS2017

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Update for VS2017

Signed-off-by: zosrothko <zosrothko@orange.fr>

* Fixed performance issue: destructor of Poco::Timespan was not inlined [#CLICKHOUSE-3458].

* fixed GH #2038: Poco::Net::MultipartWriter::createBoundary() always returns the same string.

* GH #2039: support for nested multi-part content

* Small code style change (#2043)

Making operator precedence explicit.

* Add JSON in the includes path (#2027)

* merge File::linkTo() from 1.8.1

* remove volatile

* # 2042

* SQLite not handling parameter count mismatch correctly #2020

* Data/SQLite: Exception messages contain duplicate text #2012

* Travis CI (#2050)

* Factorize info into new verbose file. Refactor Makefile, global, cpp11*. Add Linux32-clang

* Display used config with POCO_VERBOSE

* Add cross compilation toward x86 with host amd64

* Refactor config names

* Add lib32gcc runtime

* Add g++-5-multilib

* Use OSARCH=i386 for OSX x86

* Avoid building Crypto since OpenSSL is only x64 on OSX

* Avoid building Crypto since OpenSSL is only x64

* Avoid Data/* on cross compilation to x86

* Add gcc-5-multilib to clang 4.0 x86

* Ignore TimerTest on OSX for now.

* Cleanup

* Add other set of TimerTest.

* New test that fails on OSX

* Add TimerTest.testScheduleInterval() (#2053)

* Poco::Net::NetworkInterface::list does not list inactive interfaces even when explicitly being asked for it #2044

* remove deprecated NetworkInterface typedef

* move upgraded PDF from 1.8

* Update for VS2017

* Add Util::TimerTest

* fix OSX NetworkInterface test

* fix NetworkInterface test
@plainwu
Copy link

plainwu commented Apr 11, 2019

I'm using 1.9.0 release and I still got this exception.

Using Clang 4.0, and build on Linux aarch64 platform.

nvidia@tegra-ubuntu:~$ uname -a
Linux tegra-ubuntu 4.4.38-tegra #1 SMP PREEMPT Thu May 17 00:15:19 PDT 2018 aarch64 aarch64 aarch64 GNU/Linux

http://192.168.0.21:8800/media/memberFace/plain_Pig7hP1.jpg
Net Exception: Address family not supported

I tried to apply patch of #1950, but it didn't work.
Is there anyone seeing this issue?

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

No branches or pull requests

4 participants