Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at

Bug 1390468

Summary: perl-AnyEvent-7.13-2.fc26 FTBFS: t/80_ssltest.t segfaults
Product: [Fedora] Fedora Reporter: Petr Pisar <ppisar>
Component: perl-AnyEventAssignee: Paul Howarth <paul>
Status: CLOSED RAWHIDE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: rawhideCC: paul, perl-devel
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Fixed In Version: perl-AnyEvent-7.13-4.fc26 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-11-25 09:43:06 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Bug Depends On:    
Bug Blocks: 1383740    

Description Petr Pisar 2016-11-01 07:04:27 UTC
perl-AnyEvent-7.13-2.fc26 fails to build if perl-Net-SSLeay is installed:

$ perl -Ilib t/80_ssltest.t 
ok 1 - mode 1
ok 2 - client_connect 1
ok 3 - server_connect 1
Segmentation fault (core dumped)

Not build-requiring perl(Net:SSLeay) is not enough because it does not prevent from running the build if the package has already been installed. One needs to add BuildConflicts directive.

The best solution would be to fix perl-Net-SSLeay.

Comment 1 Petr Pisar 2016-11-01 07:11:32 UTC
This is the back-trace:

#0  internal_find (st=0x300000000, data=data@entry=0x7ffff5ff86f8 <ssl3_ciphers+6552>, ret_val_options=ret_val_options@entry=2) at crypto/stack/stack.c:193
#1  0x00007ffff5ac2b0a in OPENSSL_sk_find (st=<optimized out>, data=data@entry=0x7ffff5ff86f8 <ssl3_ciphers+6552>) at crypto/stack/stack.c:211
#2  0x00007ffff5dccd0e in sk_SSL_CIPHER_find (ptr=0x7ffff5ff86f8 <ssl3_ciphers+6552>, sk=<optimized out>) at include/openssl/ssl.h:826
#3  tls_process_server_hello (s=0xbeafe0, pkt=0x7fffffffdda0) at ssl/statem/statem_clnt.c:1062
#4  0x00007ffff5dcae5f in read_state_machine (s=0xbeafe0) at ssl/statem/statem.c:589
#5  state_machine (s=0xbeafe0, server=0) at ssl/statem/statem.c:385
#6  0x00007ffff5db12da in ssl3_write_bytes (s=0xbeafe0, type=23, buf_=0xf03380, len=2) at ssl/record/rec_layer_s3.c:371
#7  0x00007ffff5dc18d9 in SSL_write (s=<optimized out>, buf=<optimized out>, num=<optimized out>) at ssl/ssl_lib.c:1605
#8  0x00007ffff6045616 in XS_Net__SSLeay_write () from /usr/lib64/perl5/vendor_perl/auto/Net/SSLeay/
#9  0x00007ffff7abf620 in Perl_pp_entersub (my_perl=0x603010) at pp_hot.c:3987
#10 0x00007ffff7ab7ac6 in Perl_runops_standard (my_perl=0x603010) at run.c:41
#11 0x00007ffff7a37b7e in Perl_call_sv (my_perl=<optimized out>, sv=0xbd4ff8, flags=<optimized out>) at perl.c:2807
#12 0x00007ffff4eca1ff in e_cb () from /usr/lib64/perl5/vendor_perl/auto/EV/
#13 0x00007ffff4ec5a06 in ev_invoke_pending () from /usr/lib64/perl5/vendor_perl/auto/EV/
#14 0x00007ffff4edc1cd in ev_run () from /usr/lib64/perl5/vendor_perl/auto/EV/
#15 0x00007ffff4edd31b in XS_EV_run () from /usr/lib64/perl5/vendor_perl/auto/EV/
#16 0x00007ffff7abf620 in Perl_pp_entersub (my_perl=0x603010) at pp_hot.c:3987
#17 0x00007ffff7ab7ac6 in Perl_runops_standard (my_perl=0x603010) at run.c:41
#18 0x00007ffff7a3f816 in S_run_body (oldscope=<optimized out>, my_perl=<optimized out>) at perl.c:2483
#19 perl_run (my_perl=0x603010) at perl.c:2406
#20 0x0000000000400c59 in main (argc=<optimized out>, argv=<optimized out>, env=<optimized out>) at perlmain.c:116

The DEFINE_STACK_OF OpenSSL manual notes:

    Care should be taken when accessing stacks in multi-threaded environments.
    Any operation which increases the size of a stack such as sk_TYPE_insert()
    or sk_push() can "grow" the size of an internal array and cause race
    conditions if the same stack is accessed in a different thread. Operations
    such as sk_find() and sk_sort() can also reorder the stack.

Comment 2 Paul Howarth 2016-11-01 15:25:42 UTC
I've added a BuildConflict with perl-Net-SSLeay for now, and raised the issue with Net-SSLeay upstream ( Not sure if it's an issue there or with AnyEvent itself really.

Comment 3 Paul Howarth 2016-11-25 09:43:06 UTC
This was a bug in AnyEvent::Handle, in sub starttls:

  Net::SSLeay::CTX_set_mode ($tls, 1|2);
should have been:
  Net::SSLeay::set_mode ($tls, 1|2);

Issue diagnosed by Mike McCauley (upstream of Net::SSLeay)

Comment 4 Petr Pisar 2016-11-25 10:17:35 UTC
Great. Mike's experience with Rawhide installation is quite disappointing.

Comment 5 Paul Howarth 2016-11-25 10:24:15 UTC
I set him up with a VM on my own machine, which I installed using the Fedora Server 25 x86_64 DVD ISO and then switched to Rawhide using dnf system-upgrade. This was not without problems as I had to use --no-gpg-check because not all Rawhide packages are signed with the Fedora 26 key, if at all.