sub list_pools {
my $self = shift;
my @pools = list_pools_c($self->{conn});
return \@pools;
}
__C__
void list_pools_c (rados_t clu) {
int buf_sz = rados_pool_list(clu,NULL,0);
char buf[buf_sz];
int r = rados_pool_list(clu,buf,buf_sz);
if (r != buf_sz) {
printf("buffer size mismatch: got %d the first time, but %d "
"the second.\n", buf_sz, r);
}
Inline_Stack_Vars;
Inline_Stack_Reset;
const char *b = buf;
while(1) {
if(b[0] == '\0') {
Inline_Stack_Done;
break;
}
Inline_Stack_Push(sv_2mortal(newSVpv(b,0)));
b += strlen(b) +1;
}
}
####
write(1, "Testing list_pools\n", 19Testing list_pools
) = 19
--- SIGSEGV {si_signo=SIGSEGV, si_code=SEGV_MAPERR, si_addr=0x7fffd5dd5000} ---
+++ killed by SIGSEGV (core dumped) +++
Segmentation fault (core dumped)
####
Testing list_pools
Program received signal SIGSEGV, Segmentation fault.
__memset_sse2 () at ../sysdeps/x86_64/multiarch/../memset.S:913
913 ../sysdeps/x86_64/multiarch/../memset.S: No such file or directory.