Skip to content
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

"Bus error" in rakudo 2017.09 and onwards on ARM #762

Closed
patrickbkr opened this issue Dec 9, 2017 · 2 comments
Closed

"Bus error" in rakudo 2017.09 and onwards on ARM #762

patrickbkr opened this issue Dec 9, 2017 · 2 comments

Comments

@patrickbkr
Copy link
Member

I can get a Bus error reliably when running the following program on a raspberry pi 3 and rakudo/moar checkout from today (I got this the first time on the 2017.09 release of rakudo, 2017.08 didn't have it).

Three files:
main.p6

#!/usr/bin/env perl6
use lib '.';
use Bar;

Bar.pm6

unit module Bar;
use NativeCall;
sub a() returns int32 is native('foo') {*}

foo.c

int a() {
    return 15;
}
(gdb) bt full
#0  get_num (tc=0x23610, st=0x4ef20, root=0x76510266, data=0x76510276) at src/6model/reprs/P6num.c:62
        repr_data = 0x5aba8
#1  0x76b65564 in MVM_coerce_smart_stringify (tc=0x23610, obj=0x76510266, res_reg=0x1e938e8) at src/core/coerce.c:244
        strmeth = 0x0
        ss = 0x5abaa
#2  0x76b2e868 in MVM_interp_run (tc=0x23610, initial_invoke=0x76c635dc <toplevel_initial_invoke>, invoke_data=0x67450) at src/core/interp.c:858
        obj = 0x76510266
        res = 0x1e938e8
        op = 126
        LABELS = {0x76b298f0 <MVM_interp_run+188>, 0x76b29920 <MVM_interp_run+236>, 0x76b29924 <MVM_interp_run+240>, 0x76b29924 <MVM_interp_run+240>, 
          0x76b29938 <MVM_interp_run+260>, 0x76b299a0 <MVM_interp_run+364>, 0x76b299b4 <MVM_interp_run+384>, 0x76b29a18 <MVM_interp_run+484>, 
          0x76b29a8c <MVM_interp_run+600>, 0x76b29af8 <MVM_interp_run+708>, 0x76b29b6c <MVM_interp_run+824>, 0x76b29be0 <MVM_interp_run+940>, 
          0x76b29c54 <MVM_interp_run+1056>, 0x76b29cc8 <MVM_interp_run+1172>, 0x76b29d3c <MVM_interp_run+1288>, 0x76b29db0 <MVM_interp_run+1404>, 
          0x76b29e20 <MVM_interp_run+1516>, 0x76b29e90 <MVM_interp_run+1628>, 0x76b29f00 <MVM_interp_run+1740>, 0x76b29f70 <MVM_interp_run+1852>, 
          0x76b29fe0 <MVM_interp_run+1964>, 0x76b2a050 <MVM_interp_run+2076>, 0x76b2a0c0 <MVM_interp_run+2188>, 0x76b2a130 <MVM_interp_run+2300>, 
          0x76b2a188 <MVM_interp_run+2388>, 0x76b2a214 <MVM_interp_run+2528>, 0x76b2a2a0 <MVM_interp_run+2668>, 0x76b2a330 <MVM_interp_run+2812>, 
          0x76b2a3c0 <MVM_interp_run+2956>, 0x76b2a46c <MVM_interp_run+3128>, 0x76b2a518 <MVM_interp_run+3300>, 0x76b2a5bc <MVM_interp_run+3464>, 
          0x76b2a660 <MVM_interp_run+3628>, 0x76b2a6f4 <MVM_interp_run+3776>, 0x76b2a864 <MVM_interp_run+4144>, 0x76b2a97c <MVM_interp_run+4424>, 
          0x76b2ab88 <MVM_interp_run+4948>, 0x76b2ad58 <MVM_interp_run+5412>, 0x76b2ade4 <MVM_interp_run+5552>, 0x76b2ae70 <MVM_interp_run+5692>, 
          0x76b2aefc <MVM_interp_run+5832>, 0x76b2afec <MVM_interp_run+6072>, 0x76b2b068 <MVM_interp_run+6196>, 0x76b2b0e4 <MVM_interp_run+6320>, 
          0x76b2b160 <MVM_interp_run+6444>, 0x76b2b1dc <MVM_interp_run+6568>, 0x76b2b1dc <MVM_interp_run+6568>, 0x76b2b1f0 <MVM_interp_run+6588>, 
          0x76b2b27c <MVM_interp_run+6728>, 0x76b2b2fc <MVM_interp_run+6856>, 0x76b2b744 <MVM_interp_run+7952>, 0x76b2b838 <MVM_interp_run+8196>, 
          0x76b2b8c8 <MVM_interp_run+8340>, 0x76b2b958 <MVM_interp_run+8484>, 0x76b2b9e8 <MVM_interp_run+8628>, 0x76b2baa8 <MVM_interp_run+8820>, 
          0x76b2bb1c <MVM_interp_run+8936>, 0x76b2bbc0 <MVM_interp_run+9100>, 0x76b2bc64 <MVM_interp_run+9264>, 0x76b2bd08 <MVM_interp_run+9428>, 
          0x76b2bdac <MVM_interp_run+9592>, 0x76b2be50 <MVM_interp_run+9756>, 0x76b2bef4 <MVM_interp_run+9920>, 0x76b2c00c <MVM_interp_run+10200>, 
          0x76b2c09c <MVM_interp_run+10344>, 0x76b2c12c <MVM_interp_run+10488>, 0x76b2c1cc <MVM_interp_run+10648>, 0x76b2c388 <MVM_interp_run+11092>, 
          0x76b2c41c <MVM_interp_run+11240>, 0x76b2c500 <MVM_interp_run+11468>, 0x76b2c58c <MVM_interp_run+11608>, 0x76b2c6b0 <MVM_interp_run+11900>, 
          0x76b2c79c <MVM_interp_run+12136>, 0x76b2c7f8 <MVM_interp_run+12228>, 0x76b2c854 <MVM_interp_run+12320>, 0x76b2c8b0 <MVM_interp_run+12412>, 
          0x76b2c90c <MVM_interp_run+12504>, 0x76b2c99c <MVM_interp_run+12648>, 0x76b2ca2c <MVM_interp_run+12792>, 0x76b2cabc <MVM_interp_run+12936>, 
          0x76b2cb30 <MVM_interp_run+13052>, 0x76b2cbf8 <MVM_interp_run+13252>, 0x76b2ccc4 <MVM_interp_run+13456>, 0x76b2ce30 <MVM_interp_run+13820>, 
          0x76b2ceb8 <MVM_interp_run+13956>, 0x76b2cfc0 <MVM_interp_run+14220>, 0x76b2d12c <MVM_interp_run+14584>, 0x76b2d1d0 <MVM_interp_run+14748>, 
          0x76b2d274 <MVM_interp_run+14912>, 0x76b2d318 <MVM_interp_run+15076>, 0x76b2d3bc <MVM_interp_run+15240>, 0x76b2d460 <MVM_interp_run+15404>, 
          0x76b2d504 <MVM_interp_run+15568>, 0x76b2d61c <MVM_interp_run+15848>, 0x76b2d6a8 <MVM_interp_run+15988>, 0x76b2d734 <MVM_interp_run+16128>, 
          0x76b2d7c0 <MVM_interp_run+16268>, 0x76b2d84c <MVM_interp_run+16408>, 0x76b2d968 <MVM_interp_run+16692>, 0x76b2d9d8 <MVM_interp_run+16804>, 
          0x76b2da90 <MVM_interp_run+16988>, 0x76b2db28 <MVM_interp_run+17140>, 0x76b2dba0 <MVM_interp_run+17260>, 0x76b2dc18 <MVM_interp_run+17380>, 
          0x76b2dc90 <MVM_interp_run+17500>, 0x76b2dd08 <MVM_interp_run+17620>, 0x76b2dd80 <MVM_interp_run+17740>, 0x76b2de48 <MVM_interp_run+17940>, 
          0x76b2dec0 <MVM_interp_run+18060>, 0x76b2df38 <MVM_interp_run+18180>, 0x76b2dfd0 <MVM_interp_run+18332>, 0x76b2e050 <MVM_interp_run+18460>, 
          0x76b2e0d0 <MVM_interp_run+18588>, 0x76b2e148 <MVM_interp_run+18708>, 0x76b2e1c0 <MVM_interp_run+18828>, 0x76b2e238 <MVM_interp_run+18948>, 
          0x76b2e2b8 <MVM_interp_run+19076>, 0x76b2e330 <MVM_interp_run+19196>, 0x76b2e42c <MVM_interp_run+19448>, 0x76b2e4a4 <MVM_interp_run+19568>, 
          0x76b2e524 <MVM_interp_run+19696>, 0x76b2e5a4 <MVM_interp_run+19824>, 0x76b2e61c <MVM_interp_run+19944>, 0x76b2e698 <MVM_interp_run+20068>, 
          0x76b2e718 <MVM_interp_run+20196>, 0x76b2e794 <MVM_interp_run+20320>, 0x76b2e814 <MVM_interp_run+20448>, 0x76b2e894 <MVM_interp_run+20576>, 
          0x76b2e8fc <MVM_interp_run+20680>, 0x76b2e970 <MVM_interp_run+20796>, 0x76b2e9e4 <MVM_interp_run+20912>, 0x76b2ea58 <MVM_interp_run+21028>, 
          0x76b2eacc <MVM_interp_run+21144>, 0x76b2eb3c <MVM_interp_run+21256>, 0x76b2eba8 <MVM_interp_run+21364>, 0x76b2ec24 <MVM_interp_run+21488>, 
          0x76b2ed80 <MVM_interp_run+21836>, 0x76b2eeec <MVM_interp_run+22200>, 0x76b2f05c <MVM_interp_run+22568>, 0x76b2f1c8 <MVM_interp_run+22932>, 
          0x76b2f338 <MVM_interp_run+23300>, 0x76b2f398 <MVM_interp_run+23396>, 0x76b2f418 <MVM_interp_run+23524>, 0x76b2f4b0 <MVM_interp_run+23676>, 
          0x76b2f52c <MVM_interp_run+23800>, 0x76b2f600 <MVM_interp_run+24012>, 0x76b2f6b8 <MVM_interp_run+24196>, 0x76b2f778 <MVM_interp_run+24388>, 
          0x76b2f828 <MVM_interp_run+24564>, 0x76b2f920 <MVM_interp_run+24812>, 0x76b2f9d0 <MVM_interp_run+24988>, 0x76b2fa80 <MVM_interp_run+25164>, 
          0x76b2fb28 <MVM_interp_run+25332>, 0x76b2fc04 <MVM_interp_run+25552>, 0x76b2fcdc <MVM_interp_run+25768>, 0x76b2fdb4 <MVM_interp_run+25984>, 
          0x76b2fe84 <MVM_interp_run+26192>, 0x76b2ff88 <MVM_interp_run+26452>, 0x76b30004 <MVM_interp_run+26576>, 0x76b30070 <MVM_interp_run+26684>, 
          0x76b300e0 <MVM_interp_run+26796>, 0x76b301b8 <MVM_interp_run+27012>, 0x76b30214 <MVM_interp_run+27104>, 0x76b30290 <MVM_interp_run+27228>, 
          0x76b303e8 <MVM_interp_run+27572>, 0x76b304e8 <MVM_interp_run+27828>, 0x76b305e8 <MVM_interp_run+28084>, 0x76b306c8 <MVM_interp_run+28308>, 
          0x76b307a8 <MVM_interp_run+28532>, 0x76b308d0 <MVM_interp_run+28828>, 0x76b30954 <MVM_interp_run+28960>, 0x76b309d8 <MVM_interp_run+29092>, 
          0x76b30a5c <MVM_interp_run+29224>, 0x76b30ae0 <MVM_interp_run+29356>, 0x76b30b64 <MVM_interp_run+29488>, 0x76b30be8 <MVM_interp_run+29620>, 
          0x76b30c6c <MVM_interp_run+29752>, 0x76b30cec <MVM_interp_run+29880>, 0x76b30d44 <MVM_interp_run+29968>, 0x76b30d94 <MVM_interp_run+30048>, 
          0x76b4cfa4 <MVM_interp_run+145264>, 0x76b4cfb8 <MVM_interp_run+145284>, 0x76b30e18 <MVM_interp_run+30180>, 0x76b30e94 <MVM_interp_run+30304>, 
          0x76b30efc <MVM_interp_run+30408>, 0x76b30f64 <MVM_interp_run+30512>, 0x76b31034 <MVM_interp_run+30720>, 0x76b31128 <MVM_interp_run+30964>, 
          0x76b31220 <MVM_interp_run+31212>, 0x76b31334 <MVM_interp_run+31488>, 0x76b31428 <MVM_interp_run+31732>, 0x76b31640 <MVM_interp_run+32268>, 
          0x76b31734 <MVM_interp_run+32512>, 0x76b31820 <MVM_interp_run+32748>, 0x76b31a00 <MVM_interp_run+33228>, 0x76b31ab4 <MVM_interp_run+33408>, 
          0x76b31b4c <MVM_interp_run+33560>, 0x76b31ba0 <MVM_interp_run+33644>, 0x76b31c24 <MVM_interp_run+33776>, 0x76b31cc0 <MVM_interp_run+33932>...}
        cur_op = 0x75aed548 "\r\001\002"
        bytecode_start = 0x75aed426 "\214"
        reg_base = 0x1e93878
        cu = 0x197928
        cur_callsite = 0x76f608a4 <inv_arg_callsite>
#3  0x76c63730 in MVM_vm_run_file (instance=0x23008, filename=0x7efff7ea "/home/pi/repos/rakudo/install/share/perl6/runtime/perl6.moarvm") at src/moar.c:401
        tc = 0x23610
        cu = 0x66f90
#4  0x00011210 in main (argc=7, argv=0x7efff5b4) at src/main.c:256
        instance = 0x23008
        input_file = 0x7efff7ea "/home/pi/repos/rakudo/install/share/perl6/runtime/perl6.moarvm"
        executable_name = 0x7efff712 "/home/pi/repos/rakudo/install/bin/perl6-gdb-m"
        lib_path = {0x7efff74a "/home/pi/repos/rakudo/install/share/nqp/lib", 0x7efff780 "/home/pi/repos/rakudo/install/share/perl6/lib", 
          0x7efff7b8 "/home/pi/repos/rakudo/install/share/perl6/runtime", 0x0, 0x3721d18 <error: Cannot access memory at address 0x3721d18>, 
          0x76a5c944 "__vdso_clock_gettime", 0x76ffa2f0 "", 0x7efff490 ""}
        dump = 0
        full_cleanup = 0
        argi = 6
        lib_path_i = 3
        flag = -2
        interval_id = 1989376656
        telemeh_inited = 0 '\000'

call MVM_dump_backtrace(tc)

   at gen/moar/stage2/QASTNode.nqp:904  (/home/pi/repos/rakudo/install/share/nqp/lib/QASTNode.moarvm:cuid)
 from src/Perl6/World.nqp:2228  (/home/pi/repos/rakudo/install/share/nqp/lib/Perl6/World.moarvm:finish_code_object)
 from gen/moar/Perl6-Actions.nqp:916  (/home/pi/repos/rakudo/install/share/nqp/lib/Perl6/Actions.moarvm:comp_unit)
 from gen/moar/stage2/QRegex.nqp:1683  (/home/pi/repos/rakudo/install/share/nqp/lib/QRegex.moarvm:!reduce)
 from gen/moar/stage2/QRegex.nqp:1629  (/home/pi/repos/rakudo/install/share/nqp/lib/QRegex.moarvm:!cursor_pass)
 from src/Perl6/Grammar.nqp:1243  (/home/pi/repos/rakudo/install/share/nqp/lib/Perl6/Grammar.moarvm:comp_unit)
 from src/Perl6/Grammar.nqp:531  (/home/pi/repos/rakudo/install/share/nqp/lib/Perl6/Grammar.moarvm:TOP)
 from gen/moar/stage2/QRegex.nqp:2330  (/home/pi/repos/rakudo/install/share/nqp/lib/QRegex.moarvm:parse)
 from gen/moar/stage2/NQPHLL.nqp:1886  (/home/pi/repos/rakudo/install/share/nqp/lib/NQPHLL.moarvm:parse)
 from gen/moar/stage2/NQPHLL.nqp:1802  (/home/pi/repos/rakudo/install/share/nqp/lib/NQPHLL.moarvm:execute_stage)
 from gen/moar/stage2/NQPHLL.nqp:1835  (/home/pi/repos/rakudo/install/share/nqp/lib/NQPHLL.moarvm:run)
 from gen/moar/stage2/NQPHLL.nqp:1838  (/home/pi/repos/rakudo/install/share/nqp/lib/NQPHLL.moarvm:)
 from gen/moar/stage2/NQPHLL.nqp:1824  (/home/pi/repos/rakudo/install/share/nqp/lib/NQPHLL.moarvm:compile)
 from gen/moar/stage2/NQPHLL.nqp:1524  (/home/pi/repos/rakudo/install/share/nqp/lib/NQPHLL.moarvm:eval)
 from gen/moar/stage2/NQPHLL.nqp:1779  (/home/pi/repos/rakudo/install/share/nqp/lib/NQPHLL.moarvm:evalfiles)
 from gen/moar/stage2/NQPHLL.nqp:1671  (/home/pi/repos/rakudo/install/share/nqp/lib/NQPHLL.moarvm:command_eval)
 from src/Perl6/Compiler.nqp:42  (/home/pi/repos/rakudo/install/share/nqp/lib/Perl6/Compiler.moarvm:command_eval)
 from gen/moar/stage2/NQPHLL.nqp:1630  (/home/pi/repos/rakudo/install/share/nqp/lib/NQPHLL.moarvm:command_line)
 from gen/moar/main.nqp:47  (/home/pi/repos/rakudo/install/share/perl6/runtime/perl6.moarvm:MAIN)
 from gen/moar/main.nqp:38  (/home/pi/repos/rakudo/install/share/perl6/runtime/perl6.moarvm:<mainline>)
 from <unknown>:1  (/home/pi/repos/rakudo/install/share/perl6/runtime/perl6.moarvm:<main>)
 from <unknown>:1  (/home/pi/repos/rakudo/install/share/perl6/runtime/perl6.moarvm:<entry>)

gen/moar/stage2/QASTNode.nqp

    my $cur_cuid := 0;
    method cuid($value = NO_VALUE) {
        if !($value =:= NO_VALUE) {
            # Set ID if we are provided one.
            $!cuid := $value;
        }
        elsif $!cuid {
            # If we already have an ID, return it.
            $!cuid
        }
        else {
            # Otherwise, generate one.
            $cur_cuid := $cur_cuid + 1;
            $!cuid := ~$cur_cuid; ########## This is line 904
        }
    }

    my %NOSYMS := nqp::hash();
    method symbol(str $name, *%attrs) {
        %!symbol := nqp::hash() if nqp::isnull(%!symbol);
        if %attrs {
            my %syms
@patrickbkr
Copy link
Member Author

Just a quick note: The piece of code is actually a golf of a much larger code base. I found no way to circumvent the error (as I use multiple files and nativecall, the two ingredients to make this blow up). So currently I am locked to 2017.08 in my software.

@patrickbkr
Copy link
Member Author

I just tried this again on the 2020.01 release and I can't reproduce the problem.
My first guess would be that the work on Raku/nqp#431 also fixed this bug, but I didn't bisect to make sure.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant