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

crash in server, probably due to r.js #3745

Closed
larkost opened this issue Feb 6, 2015 · 4 comments
Closed

crash in server, probably due to r.js #3745

larkost opened this issue Feb 6, 2015 · 4 comments
Assignees
Labels
Milestone

Comments

@larkost
Copy link
Collaborator

larkost commented Feb 6, 2015

The following code is crashing the server when run from the Python:

r.table_create('alpha').run()
r.table('alpha').insert([{'step':1, 'date':r.iso8601('2015-02-06T00:00:00+00:00')}, {'step':3,  'date':r.iso8601('2015-02-06T11:11:11+00:00')}, {'step':2, 'date':r.iso8601('2015-02-06T22:22:22+00:00')}]).run()
r.table('alpha').reduce(r.js('''(function(left, right) {
    var returnValue = {};
    var sources = [left, right];
    for (var i in sources) {
        var source = sources[i];
        var stepStr = 'step_' + source.step;
        if (source.date) {
            if (!returnValue[stepStr] || returnValue[stepStr] > source.date) {
                returnValue[stepStr] = source.date;
            }
        } else {
            for (key in source) {
                if (!returnValue[stepStr] || returnValue[stepStr] > source(key)) {
                    returnValue[stepStr] = source(key);
                }
            }
        }
    }
    return returnValue;
})''')).run()

The backtrace is:

error: Error in src/errors.cc at line 123:
error: Uncaught exception of type "ql::exc_t"
         what(): TypeError: object is not a function
error: Backtrace:
error: Fri Feb  6 11:20:59 2015

       1: 0   rethinkdb                           0x000000010b1e0120 _Z19rethinkdb_backtracePPvi + 272 at 0x10b1e0120 ()
       2: 0   rethinkdb                           0x000000010a3bcf90 _ZN11backtrace_tC2Ev + 304 at 0x10a3bcf90 ()
       3: 0   rethinkdb                           0x000000010a3beeab _ZN26lazy_backtrace_formatter_tC2Ev + 43 at 0x10a3beeab ()
       4: 0   rethinkdb                           0x000000010a3bbdf5 _ZN26lazy_backtrace_formatter_tC1Ev + 21 at 0x10a3bbdf5 ()
       5: 0   rethinkdb                           0x000000010a3bbd60 _Z16format_backtraceb + 48 at 0x10a3bbd60 ()
       6: 0   rethinkdb                           0x000000010ab926cd _Z18report_fatal_errorPKciS0_z + 733 at 0x10ab926cd ()
       7: 0   rethinkdb                           0x000000010ab930b2 _Z17terminate_handlerv + 1858 at 0x10ab930b2 ()
       8: 0   libc++abi.dylib                     0x00007fff8e9080a1 _ZSt11__terminatePFvvE + 8 at 0x7fff8e9080a1 ()
       9: 0   libc++abi.dylib                     0x00007fff8e908113 _ZSt9terminatev + 51 at 0x7fff8e908113 ()
       10: 0   libc++abi.dylib                     0x00007fff8e908065 _ZSt12__unexpectedPFvvE + 6 at 0x7fff8e908065 ()
       11: 0   libc++abi.dylib                     0x00007fff8e908a6e __cxa_call_unexpected + 133 at 0x7fff8e908a6e ()
       12: 0   rethinkdb                           0x000000010af17366 _ZNK6read_t7unshardEP15read_response_tmS1_P13rdb_context_tP8signal_t + 1254 at 0x10af17366 ()
       13: 0   rethinkdb                           0x000000010aaa30fd _ZN29cluster_namespace_interface_t21dispatch_immediate_opI6read_tN20fifo_enforcer_sink_t11exit_read_tE15read_response_tEEvM15master_access_tFvPT0_EMS5_FvRKT_PT1_13order_token_tS7_P8signal_tESC_SE_SF_SH_ + 8989 at 0x10aaa30fd ()
       14: 0   rethinkdb                           0x000000010aa97015 _ZN29cluster_namespace_interface_t4readERK6read_tP15read_response_t13order_token_tP8signal_t + 229 at 0x10aa97015 ()
       15: 0   rethinkdb                           0x000000010b03e41a _ZN12real_table_t17read_with_profileEPN2ql5env_tERK6read_tP15read_response_tb + 682 at 0x10b03e41a ()
       16: 0   rethinkdb                           0x000000010ada60fb _ZN2ql22rget_response_reader_t7do_readEPNS_5env_tERK6read_t + 203 at 0x10ada60fb ()
       17: 0   rethinkdb                           0x000000010ada5f43 _ZN2ql22rget_response_reader_t10accumulateEPNS_5env_tEPNS_11eager_acc_tERKN5boost7variantINS_17count_wire_func_tENS_15sum_wire_func_tENS_15avg_wire_func_tENS_15min_wire_func_tENS_15max_wire_func_tENS_18reduce_wire_func_tENS_12limit_read_tENS5_6detail7variant5void_ESG_SG_SG_SG_SG_SG_SG_SG_SG_SG_SG_SG_EE + 339 at 0x10ada5f43 ()
       18: 0   rethinkdb                           0x000000010adb1417 _ZN2ql19lazy_datum_stream_t10accumulateEPNS_5env_tEPNS_11eager_acc_tERKN5boost7variantINS_17count_wire_func_tENS_15sum_wire_func_tENS_15avg_wire_func_tENS_15min_wire_func_tENS_15max_wire_func_tENS_18reduce_wire_func_tENS_12limit_read_tENS5_6detail7variant5void_ESG_SG_SG_SG_SG_SG_SG_SG_SG_SG_SG_SG_EE + 87 at 0x10adb1417 ()
       19: 0   rethinkdb                           0x000000010adaef12 _ZN2ql14datum_stream_t12run_terminalEPNS_5env_tERKN5boost7variantINS_17count_wire_func_tENS_15sum_wire_func_tENS_15avg_wire_func_tENS_15min_wire_func_tENS_15max_wire_func_tENS_18reduce_wire_func_tENS_12limit_read_tENS3_6detail7variant5void_ESE_SE_SE_SE_SE_SE_SE_SE_SE_SE_SE_SE_EE + 130 at 0x10adaef12 ()
       20: 0   rethinkdb                           0x000000010b15099a _ZNK2ql13reduce_term_t9eval_implEPNS_11scope_env_tEPNS_6args_tENS_12eval_flags_tE + 330 at 0x10b15099a ()
       21: 0   rethinkdb                           0x000000010aeeaf37 _ZNK2ql9op_term_t9term_evalEPNS_11scope_env_tENS_12eval_flags_tE + 1943 at 0x10aeeaf37 ()
       22: 0   rethinkdb                           0x000000010b0d6c87 _ZNK2ql14runtime_term_t4evalEPNS_11scope_env_tENS_12eval_flags_tE + 391 at 0x10b0d6c87 ()
       23: 0   rethinkdb                           0x000000010b0d478e _ZN2ql3runENS_8protob_tI5QueryEEP13rdb_context_tP8signal_tPNS_14stream_cache_tERK13ip_and_port_tP8Response + 4318 at 0x10b0d478e ()
       24: 0   rethinkdb                           0x000000010b039640 _ZN18rdb_query_server_t9run_queryERKN2ql8protob_tI5QueryEEP8ResponseP16client_context_tRK13ip_and_port_t + 928 at 0x10b039640 ()
       25: 0   rethinkdb                           0x000000010ac1e82e _ZN14query_server_t15connection_loopI15json_protocol_tEEvP16linux_tcp_conn_tP16client_context_t + 302 at 0x10ac1e82e ()
       26: 0   rethinkdb                           0x000000010ac1b161 _ZN14query_server_t11handle_connERK12scoped_ptr_tI27linux_tcp_conn_descriptor_tEN14auto_drainer_t6lock_tE + 2769 at 0x10ac1b161 ()
       27: 0   rethinkdb                           0x000000010ac23f0c _ZNSt3__110__function6__funcINS_6__bindIM14query_server_tFvRK12scoped_ptr_tI27linux_tcp_conn_descriptor_tEN14auto_drainer_t6lock_tEEJPS3_RNS_12placeholders4__phILi1EEESA_EEENS_9allocatorISI_EEFvRS6_EEclESL_ + 716 at 0x10ac23f0c ()
       28: 0   rethinkdb                           0x000000010a37d390 _ZNKSt3__18functionIFvR12scoped_ptr_tI27linux_tcp_conn_descriptor_tEEEclES4_ + 160 at 0x10a37d390 ()
       29: 0   rethinkdb                           0x000000010a3795dc _ZN32linux_nonthrowing_tcp_listener_t6handleEi + 108 at 0x10a3795dc ()
       30: 0   rethinkdb                           0x000000010a38052e _ZN26callable_action_instance_tINSt3__16__bindIM32linux_nonthrowing_tcp_listener_tFviEJPS2_RiEEEE10run_actionEv + 302 at 0x10a38052e ()
       31: 0   rethinkdb                           0x000000010a3abd9c _ZN25callable_action_wrapper_t3runEv + 108 at 0x10a3abd9c ()
       32: 0   rethinkdb                           0x000000010a38c155 _ZN6coro_t3runEv + 917 at 0x10a38c155 ()
@mlucy mlucy added this to the 1.16.x milestone Feb 6, 2015
@mlucy mlucy added the tp:bug label Feb 6, 2015
@mlucy
Copy link
Member

mlucy commented Feb 6, 2015

@Tryneus, you know the most about the r.js code, right?

@timmaxw
Copy link
Member

timmaxw commented Feb 6, 2015

I suspect that the solution is for read_t::unshard() to catch ql::base_exc_t and convert it into an error response.

@Tryneus
Copy link
Member

Tryneus commented Feb 6, 2015

Working on this.

@Tryneus Tryneus self-assigned this Feb 6, 2015
@Tryneus
Copy link
Member

Tryneus commented Feb 7, 2015

The fix has been approved (OTS by @mlucy) and merged to next in commit e815923, and cherry-picked into v1.16.x in commit 39e16a0. Will be in release 1.16.1.

@Tryneus Tryneus closed this as completed Feb 7, 2015
@AtnNn AtnNn modified the milestones: 1.16.x, 1.16.1 Feb 11, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants