Executing the following dumps core: my $vmm = Sys::Virt->new( uri => 'esx://yellow.rhev.marston/?no_verify=1', readonly => 1, auth => 1, credlist => [ Sys::Virt::CRED_AUTHNAME, Sys::Virt::CRED_PASSPHRASE ], callback => sub { my $creds = shift; foreach my $cred (@$creds) { if ($cred->{type} == Sys::Virt::CRED_AUTHNAME) { $cred->{result} = "root"; } elsif ($cred->{type} == Sys::Virt::CRED_PASSPHRASE) { $cred->{result} = "s3cr3t"; } else { die($cred->{type}, "\n"); } } } ); Stack track: #0 0x0000003ba6e797e0 in strlen () from /lib64/libc.so.6 #1 0x0000003ba9299330 in Perl_newSVpv (my_perl=0x171a2010, s=0x0, len=0) at sv.c:6908 #2 0x00002ae7745030c5 in _open_auth_callback (cred=0x7ffffc405810, ncred=1, cbdata=0x17251bc0) at Virt.xs:375 #3 0x00002ae774758140 in virRequestPassword (auth=0x7ffffc406350, username=0x172c59e0 "root", hostname=0x172bb190 "yellow.rhev.marston") at util/authhelper.c:105 #4 0x00002ae7747f850e in esxOpen (conn=0x172c0700, auth=0x7ffffc406350, flags=<value optimized out>) at esx/esx_driver.c:422 #5 0x00002ae7747aa138 in do_open ( name=0x171bb200 "esx://yellow.rhev.marston/?no_verify=1", auth=0x7ffffc406350, flags=1) at libvirt.c:1243 #6 0x00002ae7747aace6 in virConnectOpenAuth ( name=0x171bb200 "esx://yellow.rhev.marston/?no_verify=1", auth=0x7ffffc406350, flags=1) at libvirt.c:1498 #7 0x00002ae77451eeb3 in XS_Sys__Virt__open_auth ( my_perl=<value optimized out>, cv=<value optimized out>) at Virt.xs:469 #8 0x0000003ba9290a96 in Perl_pp_entersub (my_perl=0x171a2010) at pp_hot.c:2877 #9 0x0000003ba928a33e in Perl_runops_standard (my_perl=0x171a2010) at run.c:37 #10 0x0000003ba923808a in S_run_body (my_perl=0x171a2010) at perl.c:2372 #11 perl_run (my_perl=0x171a2010) at perl.c:2289 #12 0x00000000004017bc in main (argc=2, argv=0x7ffffc406638, env=<value optimized out>) at perlmain.c:99 Interesting gdb output: #2 0x00002ae7745030c5 in _open_auth_callback (cred=0x7ffffc405810, ncred=1, cbdata=0x17251bc0) at Virt.xs:375 375 (void)hv_store(credrec, "result", 6, newSVpv(cred[i].defresult, 0), 0); (gdb) print cred[i] $8 = {type = 388761808, prompt = 0x172c5860 "Enter root's password for yellow.rhev.marston", challenge = 0x172bb110 "p\261+\027", defresult = 0x7ffffc405d70 "192.168.1.201", result = 0x172c0700 "\255\336#O\001", resultlen = 4232078160} (gdb) down #1 0x0000003ba9299330 in Perl_newSVpv (my_perl=0x171a2010, s=0x0, len=0) at sv.c:6908 6908 sv_setpvn(sv,s,len ? len : strlen(s)); (gdb) print s $1 = 0x0 I didn't experience this issue with Sys::Virt 0.2.3, which was embedded in v2v-libvirt, so I suspect this is already fixed upstream. Version-Release number of selected component (if applicable): libvirt-0.8.2-4.el5 perl-Sys-Virt-0.2.0-6.el5 perl-5.8.8-32.el5_5.1 (all x86_64)
I've confirmed this is fixed upstream. I built upstream Sys::Virt 0.2.4 for RHEL 5 and re-ran the above test. It works fine.
Setting the exception flag on this as would block virt-v2v, which is approved.
This fixes my crasher, and virt-v2v works too.
(In reply to comment #4) > This fixes my crasher, and virt-v2v works too. By 'this', I mean perl-Sys-Virt-0.2.4-1.el5.x86_64.
Reproduce the bug with perl-Sys-Virt-0.2.0-6.el5 on Server-x86_64-KVM and Server-x86_64-Xen. related package: libvirt-0.8.2-8.el5 perl-5.8.8-32.el5_5.2 # cat test.pl use Sys::Virt; my $vmm = Sys::Virt->new( uri => 'esx://10.66.72.124/?no_verify=1', readonly => 1, auth => 1, credlist => [ Sys::Virt::CRED_AUTHNAME, Sys::Virt::CRED_PASSPHRASE ], callback => sub { my $creds = shift; foreach my $cred (@$creds) { if ($cred->{type} == Sys::Virt::CRED_AUTHNAME) { $cred->{result} = "root"; } elsif ($cred->{type} == Sys::Virt::CRED_PASSPHRASE) { $cred->{result} = "123qwe!"; } else { die($cred->{type}, "\n"); } } } ); # perl test.pl Segmentation fault ################################# Verify the bug passed on Server-x86_64-KVM, Server-x86_64-Xen # rpm -Uvh perl-Sys-Virt-0.2.4-1.el5.x86_64.rpm Preparing... ########################################### [100%] 1:perl-Sys-Virt ########################################### [100%] # perl test.pl # no segmentation fault after upgrade package to perl-Sys-Virt-0.2.4-1.el5
Technical note added. If any revisions are required, please edit the "Technical Notes" field accordingly. All revisions will be proofread by the Engineering Content Services team. New Contents: Previously, perl-Sys-Virt was not able to authenticate with libvirt ESX driver connections. This update fixes the compatibility with ESX driver and introduces support for new APIs in the rebased libvirt package.
An advisory has been issued which should help the problem described in this bug report. This report is therefore being closed with a resolution of ERRATA. For more information on therefore solution and/or where to find the updated files, please follow the link below. You may reopen this bug report if the solution does not work for you. http://rhn.redhat.com/errata/RHBA-2011-0117.html