yuki-kimoto / SPVM

SPVM Language
https://metacpan.org/pod/SPVM
MIT License
59 stars 14 forks source link

segfault: class IO::Socket::IP extends IO::Socket::INET #521

Open yuki-kimoto opened 1 month ago

yuki-kimoto commented 1 month ago
use Test::More;

use strict;
use warnings;
use FindBin;
use lib "$FindBin::Bin/lib";
BEGIN { $ENV{SPVM_BUILD_DIR} = "$FindBin::Bin/.spvm_build"; }

use SPVM 'TestCase::IO::Socket::IP';

unless ($] >= 5.032000) {
  plan skip_all => 'This test is skipped because it needs Perl v.5.32.0+';
}

require Test::TCP;
require HTTP::Tiny;

require Mojolicious::Command::daemon;

my $server = Test::TCP->new(
  code => sub {
    my $port = shift;

    my $app = Mojo::Server->new->load_app('t/webapp/basic.pl');

    my $daemon_command = Mojolicious::Command::daemon->new(app => $app);

    my @args = ("--listen", "http://*:$port");
    $daemon_command->run(@args);

    exit 0;
  },
);

my $port = $server->port;

ok(SPVM::TestCase::IO::Socket::IP->basic($port));

done_testing;
class IO::Socket::IP extends IO::Socket::INET {

}
kimoto@tk2-259-39003:~/labo/modules/SPVM-IO$ make && perl -Mblib t/IO-Socket-IP.t
Manifying 8 pod documents
perl: lib/SPVM/Builder/src/spvm_compiler.c:250: SPVM_COMPILER_compile_common: Assertion `compiler->current_each_compile_allocator->memory_blocks_count_tmp == compile_start_memory_blocks_count_tmp' failed.
Aborted (core dumped)
yuki-kimoto commented 1 month ago

This may be caused by unexistant method attribute.


interface method peeraddr : Sys::Socket::In_addr () {