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

Exception at hb_codec_converge.erl encoding values #68

Open
oltarasenko opened this issue Jan 13, 2025 · 0 comments
Open

Exception at hb_codec_converge.erl encoding values #68

oltarasenko opened this issue Jan 13, 2025 · 0 comments

Comments

@oltarasenko
Copy link
Collaborator

Steps to reproduce:

It's possible to reproduce the problem by running the following test with HB_PRINT on:

HB_PRINT=hb_converge rebar3 eunit --test=hb_http_benchmark_tests:parallel_wasm_signed_benchmark_test

=======================================================
=CRASH REPORT==== 13-Jan-2025::08:05:23.404017 ===
  crasher:
    initial call: cowboy_stream_h:request_process/3
    pid: <0.1973.0>
    registered_name: []
    exception error: construction of binary failed
      in function  hb_codec_converge:'-encode_value/1-fun-0-'/1 (/Users/oleg/repos/arweave/HyperBEAM/src/hb_codec_converge.erl, line 121)
         *** segment 2 of type 'binary': expected a binary but got: hb_store_fs
      in call from lists:map/2 (lists.erl, line 2077)
      in call from hb_codec_converge:encode_value/1 (/Users/oleg/repos/arweave/HyperBEAM/src/hb_codec_converge.erl, line 113)
      in call from hb_codec_converge:'-from/1-fun-1-'/2 (/Users/oleg/repos/arweave/HyperBEAM/src/hb_codec_converge.erl, line 31)
      in call from lists:map_1/2 (lists.erl, line 2082)
      in call from lists:map/2 (lists.erl, line 2077)
      in call from hb_codec_converge:from/1 (/Users/oleg/repos/arweave/HyperBEAM/src/hb_codec_converge.erl, line 14)
      in call from hb_message:convert_to_tabm/3 (/Users/oleg/repos/arweave/HyperBEAM/src/hb_message.erl, line 87)
    ancestors: [<0.1970.0>,<0.1586.0>,<0.1585.0>,ranch_sup,<0.513.0>]
    message_queue_len: 1
    messages: [{resolve,<0.1971.0>,24692321,
                      #{path => <<"Init">>,
                        priv =>
                            #{<<"Converge">> =>
                                  #{<<"Original-Path">> =>
                                        [<<"Init">>,<<"Compute">>,
                                         <<"Results">>],
                                    <<"Remaining-Path">> =>
                                        [<<"Compute">>,<<"Results">>]}}},
                      #{port => 47529,
                        store =>
                            [{hb_store_fs,#{prefix => "TEST-cache-47529"}}],
                        force_signed => true,
                        wallet =>
                            {{{rsa,65537},
                              <<134,238,244,183,222,94,196,90,17,58,185,130,
                                241,166,19,207,83,215,36,195,33,232,204,17,79,
                                4,109,5,135,210,218,183,42,84,30,170,76,207,42,
                                191,138,81,3,207,11,129,106,144,52,65,76,141,
                                142,106,95,56,186,173,253,66,29,162,237,156,
                                174,111,178,64,236,212,142,223,206,110,139,140,
                                60,57,198,141,24,106,14,99,52,183,104,169,180,
                                41,18,171,55,234,205,241,193,227,6,145,253,119,
                                236,201,220,55,186,181,225,138,7,238,160,247,
                                58,74,219,143,94,85,117,5,101,183,254,90,99,
                                166,75,125,130,17,33,98,49,237,248,95,73,221,
                                41,56,247,176,197,221,155,22,218,117,92,168,
                                172,151,25,44,31,185,104,235,19,32,244,130,50,
                                104,252,62,184,161,153,58,195,195,169,240,62,
                                204,74,195,36,170,7,191,105,70,45,236,157,191,
                                21,62,204,240,139,97,103,61,237,153,107,31,132,
                                53,186,140,92,22,60,104,14,178,245,160,71,189,
                                98,82,85,79,203,40,221,100,234,46,125,127,111,
                                241,43,36,239,66,18,119,77,72,78,145,122,245,
                                252,173,42,237,170,2,214,81,108,32,16,251,167,
                                93,220,4,246,201,56,209,8,240,167,156,250,179,
                                213,135,225,174,30,66,115,224,219,29,155,80,
                                222,218,145,151,146,94,11,248,233,28,172,85,10,
                                213,91,129,46,76,114,46,221,51,17,42,139,30,
                                234,4,240,122,81,156,138,52,85,228,68,51,185,
                                237,85,232,46,26,126,78,71,32,188,62,40,245,
                                199,127,20,175,181,196,194,208,236,85,132,84,
                                195,139,45,202,192,171,123,184,7,207,18,196,1,
                                244,185,57,136,252,133,119,106,254,255,88,10,
                                166,25,238,0,120,6,147,204,175,244,209,88,184,
                                120,35,61,199,88,72,117,41,236,50,242,47,108,
                                55,184,152,218,164,246,36,64,72,69,167,151,193,
                                225,34,242,108,187,225,11,185,182,152,164,124,
                                90,158,57,101,245,89,33,156,212,205,44,15,67,
                                97,192,19,76,92,136,195,120,100,71,134,240,4,
                                196,2,15,38,47,210,49,144,112,59,153,58,122,
                                162,92,30,70,139,6,39,52,35,0,118,16,174,7,118,
                                47,59,2,176,144,232,34,35,239,177,56,28,222,67,
                                15,136,119,216,184,234,56,45,200,38,142,12,3,
                                146,207,190,14,123,51,184,201,243,249,81>>,
                              <<210,246,111,30,101,88,155,107,142,136,165,106,
                                163,92,80,3,44,112,71,25,236,66,223,143,53,20,
                                242,163,35,192,240,212,118,90,56,151,110,18,
                                125,98,100,147,125,28,150,236,73,88,61,195,
                                201,207,109,247,17,177,108,182,60,193,51,12,
                                206,232,131,28,96,202,67,123,33,123,79,194,
                                253,68,205,73,68,41,71,49,46,4,225,88,134,143,
                                77,176,22,53,25,103,235,42,113,153,21,188,72,
                                182,26,219,164,228,15,46,22,14,251,214,197,26,
                                6,49,116,115,230,172,43,78,20,22,190,86,144,
                                27,215,233,80,183,85,105,31,222,64,240,100,59,
                                197,117,32,243,225,116,76,100,36,121,41,35,87,
                                250,119,40,126,247,13,2,222,227,28,100,163,
                                176,253,82,193,228,97,239,201,19,38,118,92,
                                125,121,157,84,70,22,154,245,7,111,2,53,114,
                                178,212,70,27,48,231,228,137,194,30,69,129,85,
                                89,93,87,167,99,131,90,200,154,31,80,25,0,43,
                                223,67,108,128,177,178,133,240,142,181,207,76,
                                78,123,209,53,154,67,229,70,5,183,35,232,64,
                                137,203,253,46,254,134,110,207,87,65,137,95,
                                110,195,125,22,31,116,77,201,6,159,27,66,63,
                                70,141,83,247,89,39,72,26,235,115,59,42,247,
                                245,63,40,240,229,84,196,48,248,168,170,205,
                                83,172,164,180,247,18,190,134,241,246,142,9,
                                54,224,20,137,119,194,92,227,132,119,122,199,
                                103,78,114,168,43,211,78,25,0,102,16,105,118,
                                113,33,144,28,126,45,50,185,95,132,190,208,
                                141,237,228,199,251,3,152,99,121,37,82,32,30,
                                173,77,202,192,165,245,126,180,146,69,55,150,
                                22,132,250,57,150,83,201,75,212,200,255,135,
                                225,183,185,205,19,79,59,164,222,191,226,223,
                                77,170,223,22,65,215,203,22,120,151,12,239,
                                200,68,41,111,251,213,180,37,93,89,198,158,
                                109,53,232,168,168,28,232,167,40,42,252,47,
                                198,217,109,38,39,5,71,155,74,234,16,188,212,
                                219,107,227,175,131,143,185,17,245,199,63,211,
                                204,235,218,125,248,231,144,89,80,154,235,135,
                                129,136,135,101,178,102,83,37,160,244,195,171,
                                60,221,202,84,167,1,99,117,58,88,179,158,138,
                                253,63,64,242,206,187,240,75,107,55,147,97,
                                168,94,141,22,204,41,153,145,91,154,254,223>>},
                             {{rsa,65537},
                              <<210,246,111,30,101,88,155,107,142,136,165,
                                106,163,92,80,3,44,112,71,25,236,66,223,
                                143,53,20,242,163,35,192,240,212,118,90,
                                56,151,110,18,125,98,100,147,125,28,150,
                                236,73,88,61,195,201,207,109,247,17,177,
                                108,182,60,193,51,12,206,232,131,28,96,
                                202,67,123,33,123,79,194,253,68,205,73,68,
                                41,71,49,46,4,225,88,134,143,77,176,22,53,
                                25,103,235,42,113,153,21,188,72,182,26,
                                219,164,228,15,46,22,14,251,214,197,26,6,
                                49,116,115,230,172,43,78,20,22,190,86,144,
                                27,215,233,80,183,85,105,31,222,64,240,
                                100,59,197,117,32,243,225,116,76,100,36,
                                121,41,35,87,250,119,40,126,247,13,2,222,
                                227,28,100,163,176,253,82,193,228,97,239,
                                201,19,38,118,92,125,121,157,84,70,22,154,
                                245,7,111,2,53,114,178,212,70,27,48,231,
                                228,137,194,30,69,129,85,89,93,87,167,99,
                                131,90,200,154,31,80,25,0,43,223,67,108,
                                128,177,178,133,240,142,181,207,76,78,123,
                                209,53,154,67,229,70,5,183,35,232,64,137,
                                203,253,46,254,134,110,207,87,65,137,95,
                                110,195,125,22,31,116,77,201,6,159,27,66,
                                63,70,141,83,247,89,39,72,26,235,115,59,
                                42,247,245,63,40,240,229,84,196,48,248,
                                168,170,205,83,172,164,180,247,18,190,134,
                                241,246,142,9,54,224,20,137,119,194,92,
                                227,132,119,122,199,103,78,114,168,43,211,
                                78,25,0,102,16,105,118,113,33,144,28,126,
                                45,50,185,95,132,190,208,141,237,228,199,
                                251,3,152,99,121,37,82,32,30,173,77,202,
                                192,165,245,126,180,146,69,55,150,22,132,
                                250,57,150,83,201,75,212,200,255,135,225,
                                183,185,205,19,79,59,164,222,191,226,223,
                                77,170,223,22,65,215,203,22,120,151,12,
                                239,200,68,41,111,251,213,180,37,93,89,
                                198,158,109,53,232,168,168,28,232,167,40,
                                42,252,47,198,217,109,38,39,5,71,155,74,
                                234,16,188,212,219,107,227,175,131,143,
                                185,17,245,199,63,211,204,235,218,125,248,
                                231,144,89,80,154,235,135,129,136,135,101,
                                178,102,83,37,160,244,195,171,60,221,202,
                                84,167,1,99,117,58,88,179,158,138,253,63,
                                64,242,206,187,240,75,107,55,147,97,168,
                                94,141,22,204,41,153,145,91,154,254,223>>}}}}]
    links: [<0.1970.0>]
    dictionary: [{last_debug_print,1736751923399}]
    trap_exit: false
    status: running
    heap_size: 17731
    stack_size: 29
    reductions: 615017
  neighbours:

  Failed: 3.  Skipped: 0.  Passed: 3.
=ERROR REPORT==== 13-Jan-2025::08:05:23.406783 ===
Ranch listener {hb_http_server,47529}, connection process <0.1970.0>, stream 1 had its request process <0.1973.0> exit with reason badarg and stacktrace [{hb_codec_converge,'-encode_value/1-fun-0-',1,[{file,"/Users/oleg/repos/arweave/HyperBEAM/src/hb_codec_converge.erl"},{line,121},{error_info,#{cause => {2,binary,type,hb_store_fs},function => format_bs_fail,module => erl_erts_errors}}]},{lists,map,2,[{file,"lists.erl"},{line,2077}]},{hb_codec_converge,encode_value,1,[{file,"/Users/oleg/repos/arweave/HyperBEAM/src/hb_codec_converge.erl"},{line,113}]},{hb_codec_converge,'-from/1-fun-1-',2,[{file,"/Users/oleg/repos/arweave/HyperBEAM/src/hb_codec_converge.erl"},{line,31}]},{lists,map_1,2,[{file,"lists.erl"},{line,2082}]},{lists,map,2,[{file,"lists.erl"},{line,2077}]},{hb_codec_converge,from,1,[{file,"/Users/oleg/repos/arweave/HyperBEAM/src/hb_codec_converge.erl"},{line,14}]},{hb_message,convert_to_tabm,3,[{file,"/Users/oleg/repos/arweave/HyperBEAM/src/hb_message.erl"},{line,87}]}]

=CRASH REPORT==== 13-Jan-2025::08:05:23.412365 ===
  crasher:
    initial call: cowboy_stream_h:request_process/3
    pid: <0.1971.0>
    registered_name: []
    exception error: construction of binary failed
      in function  hb_codec_converge:'-encode_value/1-fun-0-'/1 (/Users/oleg/repos/arweave/HyperBEAM/src/hb_codec_converge.erl, line 121)
         *** segment 2 of type 'binary': expected a binary but got: hb_store_fs
      in call from lists:map/2 (lists.erl, line 2077)
      in call from hb_codec_converge:encode_value/1 (/Users/oleg/repos/arweave/HyperBEAM/src/hb_codec_converge.erl, line 113)
      in call from hb_codec_converge:'-from/1-fun-1-'/2 (/Users/oleg/repos/arweave/HyperBEAM/src/hb_codec_converge.erl, line 31)
      in call from lists:map_1/2 (lists.erl, line 2082)
      in call from lists:map/2 (lists.erl, line 2077)
      in call from hb_codec_converge:from/1 (/Users/oleg/repos/arweave/HyperBEAM/src/hb_codec_converge.erl, line 14)
      in call from hb_message:convert_to_tabm/3 (/Users/oleg/repos/arweave/HyperBEAM/src/hb_message.erl, line 87)
    ancestors: [<0.1967.0>,<0.1586.0>,<0.1585.0>,ranch_sup,<0.513.0>]
    message_queue_len: 0
    messages: []
    links: [<0.1967.0>]
    dictionary: [{last_debug_print,1736751923406}]
    trap_exit: false
    status: running
    heap_size: 10958
    stack_size: 29
    reductions: 482164
  neighbours:

=ERROR REPORT==== 13-Jan-2025::08:05:23.413022 ===
Ranch listener {hb_http_server,47529}, connection process <0.1967.0>, stream 1 had its request process <0.1971.0> exit with reason badarg and stacktrace [{hb_codec_converge,'-encode_value/1-fun-0-',1,[{file,"/Users/oleg/repos/arweave/HyperBEAM/src/hb_codec_converge.erl"},{line,121},{error_info,#{cause => {2,binary,type,hb_store_fs},function => format_bs_fail,module => erl_erts_errors}}]},{lists,map,2,[{file,"lists.erl"},{line,2077}]},{hb_codec_converge,encode_value,1,[{file,"/Users/oleg/repos/arweave/HyperBEAM/src/hb_codec_converge.erl"},{line,113}]},{hb_codec_converge,'-from/1-fun-1-',2,[{file,"/Users/oleg/repos/arweave/HyperBEAM/src/hb_codec_converge.erl"},{line,31}]},{lists,map_1,2,[{file,"lists.erl"},{line,2082}]},{lists,map,2,[{file,"lists.erl"},{line,2077}]},{hb_codec_converge,from,1,[{file,"/Users/oleg/repos/arweave/HyperBEAM/src/hb_codec_converge.erl"},{line,14}]},{hb_message,convert_to_tabm,3,[{file,"/Users/oleg/repos/arweave/HyperBEAM/src/hb_message.erl"},{line,87}]}]

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