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

adding context to HTTPSClientSession leads to free(): invalid pointer #4829

Closed
omerbrandis opened this issue Dec 24, 2024 · 1 comment
Closed
Labels

Comments

@omerbrandis
Copy link
Contributor

omerbrandis commented Dec 24, 2024

using poco v 1.14, build on ubuntu 16.04 using openssl 1.1.1

when adding context to HTTPSClientSession like :

Poco::Net::Context::Params ContextParameters;
Poco::Net::Context  Con(Poco::Net::Context::TLS_CLIENT_USE,ContextParameters);
Poco::Net::HTTPSClientSession  CSession("....","....",&Con);

leads to a crash at the end of execution :
*** Error in `./myExecutable': free(): invalid pointer: 0x00007ffd5dc107e0 ***

gdb backtrace info :
Program terminated with signal SIGABRT, Aborted.
#0 0x00007f487619f428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
54 ../sysdeps/unix/sysv/linux/raise.c: No such file or directory.
(gdb) bt
#0 0x00007f487619f428 in __GI_raise (sig=sig@entry=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#1 0x00007f48761a102a in __GI_abort () at abort.c:89
#2 0x00007f48761e17ea in __libc_message (do_abort=do_abort@entry=2, fmt=fmt@entry=0x7f48762faed8 "*** Error in `%s': %s: 0x%s ***\n") at ../sysdeps/posix/libc_fatal.c:175
#3 0x00007f48761ea37a in malloc_printerr (ar_ptr=, ptr=, str=0x7f48762f7caf "free(): invalid pointer", action=3) at malloc.c:5006
#4 _int_free (av=, p=, have_lock=0) at malloc.c:3867
#5 0x00007f48761ee53c in __GI___libc_free (mem=) at malloc.c:2968
#6 0x00007f4877c76886 in Poco::RefCountedObject::release (this=) at pocoBuildDir/Foundation/include/Poco/RefCountedObject.h:82
#7 Poco::AutoPtrPoco::Net::Context::~AutoPtr (this=0x20384c0, __in_chrg=) at pocoBuildDir/Foundation/include/Poco/AutoPtr.h:96
#8 Poco::Net::SecureSocketImpl::~SecureSocketImpl() () at pocoBuildDir/NetSSL_OpenSSL/src/SecureSocketImpl.cpp:53
#9 0x00007f4877c78895 in Poco::Net::SecureStreamSocketImpl::~SecureStreamSocketImpl() () at pocoBuildDir/NetSSL_OpenSSL/src/SecureStreamSocketImpl.cpp:44
#10 0x00007f4877c788b9 in Poco::Net::SecureStreamSocketImpl::~SecureStreamSocketImpl (this=0x2038480, __in_chrg=)
at pocoBuildDir/NetSSL_OpenSSL/src/SecureStreamSocketImpl.cpp:40
#11 0x000000000083a341 in myFunction ()

please advise.
:-)

@omerbrandis
Copy link
Contributor Author

my bad,
HTTPSClientSession expects poco::Ptr not a simple pointer/address.

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

1 participant