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::DNS::Native and Mojolicious on Linux #716
Comments
Thanks for the detailed explanation, i'm not quite sure yet what to do about this. |
It looks like we have consensus (on IRC) for removing |
And done, wish there was something else we could do. But as long as Perl is not linked with pthreads by default, our options are very limited. |
Don't know will this change something about Net::DNS::Native + Mojolicious, but I found a way to check is non thread safe symbols loaded which will cause crash. I already added this check in master.
Just for the record: next perl release will introduce linking with pthreads by default (http://perl5.git.perl.org/perl.git/commit/237050634b19905cdd9e8e25c2a43d0b24eb59f2) 👏 |
@olegwtf ++ |
I wonder if at least some of this could be fixed by adjusting the code in |
As we noticed yesterday
Net::DNS::Native
with perl not linked with pthreads still may crash on Linux: https://rt.cpan.org/Public/Bug/Display.html?id=100834Today I found a way to reproduce this problem with the following server
and client
where you need to change data-flow.ru to your own domain (but not localhost).
This client segfaults 10 times out of 10
And the fix is as simple as
use strict; +use Net::DNS::Native; use Mojo::UserAgent; use Mojo::IOLoop;
And all the problem caused by ... my favorite
IO::Socket::IP
. Look. Mojolicious loadsIO::Socket::IP
here andIO::Socket::IP
has this construction which executesgetprotobyname()
at compile time. Looks ok, but this loads non thread safe DNS part of libc (because our perl not linked with pthreads). And only after that Mojolicious loadsNet::DNS::Native
, which can't replace non-thread safe DNS part of libc with thread safe even with RTLD_GLOBAL flag.So, you can comment mentioned line of
IO::Socket::IP
and all will work goodOr you can load
IO::Socket::IP
afterNet::DNS::Native
inside Mojolicious and all will work goodBut you can't fix this inside
Net::DNS::Native
The sad part is that if we'll fix this inside Mojolicious where is the warranty that somebody will not write smth like
I can disable non pthreaded perl support on Linux inside
Net::DNS::Native
again, which will fix this problem at all. But this is a big amount of users.Btw [Tux] from #p5p promised to add "linking with pthreads by default" feature few months ago. Looks like I need to remind him about this :)
Thoughts?
The text was updated successfully, but these errors were encountered: