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

RethinkDB doesn't work on Cubietruck (ARM) #4839

Closed
danielmewes opened this issue Sep 14, 2015 · 14 comments
Closed

RethinkDB doesn't work on Cubietruck (ARM) #4839

danielmewes opened this issue Sep 14, 2015 · 14 comments
Assignees
Labels
Milestone

Comments

@danielmewes
Copy link
Member

There have been multiple reports of RethinkDB 2.1.x not working at all on Cubietruck ARM computers.

RethinkDB appears to crash either on startup (during the update check most likely), or when running the first query.

A typical backtrace after the segmentation fault looks like this:

1: backtrace_t::backtrace_t() at backtrace.cc:203 (discriminator 1)
2: format_backtrace(bool) at basic_string.h:275
3: report_fatal_error(char const*, int, char const*, ...) at errors.cc:83
4: generic_crash_handler(int) at errors.cc:104
5: /lib/arm-linux-gnueabihf/libc.so.6(+0x26ac0) [0xb51cbac0] at 0xb51cbac0 (/lib/arm-linux-gnueabihf/libc.so.6)
6: void rapidjson::GenericReader<rapidjson::UTF8<char>, rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::RAllocator> >::ParseValue<16u, rapidjson::GenericStringStream<rapidjson::UTF8<char> >, rapidjson::GenericDocument<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::RAllocator>, rapidjson::RAllocator> >(rapidjson::GenericStringStream<rapidjson::UTF8<char> >&, rapidjson::GenericDocument<rapidjson::UTF8<char>, rapidjson::MemoryPoolAllocator<rapidjson::RAllocator>, rapidjson::RAllocator>&) at allocators.h:183
7: json_to_datum(std::string const&, ql::configured_limits_t const&, reql_version_t, attach_json_to_error_t, http_result_t*) at reader.h:418
8: perform_http(http_opts_t*, http_result_t*) at http_job.cc:669
9: http_job_t::worker_fn(read_stream_t*, write_stream_t*) at intrusive_list.hpp:57
10: spawner_run_t::main_loop() at extproc_spawner.cc:61
11: extproc_spawner_t::fork_spawner() at extproc_spawner.cc:200
12: extproc_spawner_t::extproc_spawner_t() at extproc_spawner.cc:164
13: main_rethinkdb_porcelain(int, char**) at command_line.cc:1721
14: main+0x153 at main.cc:27
15: __libc_start_main+0x99 at 0xb51bc632 (/lib/arm-linux-gnueabihf/libc.so.6)

(This isn't a super high priority issue since our ARM support is still experimental.)

@danielmewes
Copy link
Member Author

Probably related: Tencent/rapidjson#388

@danielmewes
Copy link
Member Author

A suggested work-around is switching RapidJSON to CrtAllocator on ARM, which probably wouldn't be the worst thing (it might cost a little bit of performance).

@danielmewes
Copy link
Member Author

Note if someone wants to try this out:
To change the allocator, open the file src/rapidjson/document.h. Then change the following two lines:

  • line 420 from
    template <typename Encoding, typename Allocator = MemoryPoolAllocator<> > class GenericValue {
    to
    template <typename Encoding, typename Allocator = RAllocator > class GenericValue {
  • and line 1626 from
    template <typename Encoding, typename Allocator = MemoryPoolAllocator<>, typename StackAllocator = RAllocator> class GenericDocument : public GenericValue<Encoding, Allocator> {
    to
    template <typename Encoding, typename Allocator = RAllocator, typename StackAllocator = RAllocator> class GenericDocument : public GenericValue<Encoding, Allocator> {

@paulscliu
Copy link

After making the changes, do I need to do anything else beside recompile? It takes a long to recompile on Cubietruck so I want to make sure I do not miss any step.

@danielmewes
Copy link
Member Author

@paulscliu That should be all.

@paulscliu
Copy link

I made the modification and recompile. RethinkDB 2.1.4 now run fine on the Cubietruck. I will let it run for few days to see if there is any problem but I don't anticipate any

@chrj
Copy link

chrj commented Sep 19, 2015

This solved the problem for me as well. I'm testing on a couple of https://www.scaleway.com/ C1 servers.

@danielmewes
Copy link
Member Author

Thanks for the feedback @pauliusuza and @chrj .
Scheduling this for 2.2. We'll try to incorporate this work-around into our codebase, so that everything runs out of the box again.

@danielmewes danielmewes added this to the 2.2 milestone Sep 21, 2015
@pauliusuza
Copy link
Contributor

I think you meant @paulscliu

@danielmewes
Copy link
Member Author

Oh sorry, yes I meant @paulscliu

@10man
Copy link

10man commented Sep 23, 2015

The server does run on the beaglebone black.

It now ignores the --server-name switch from the command line as well as the same setting line from the config file.

WARNING: ignoring --server-name because this server already has a name.

I'm not sure what the reason could be, it seems like all 2.1.x versions do it.

@larkost
Copy link
Collaborator

larkost commented Sep 23, 2015

@10man: --server-name only sets a name if the server does not have one (i.e.: is starting for the first time). Once there is a data folder created and populated that then directs what the server name is. You can change it through the admin interface (WebGUI: "Operations" drop-down(s) on the "Servers" page) or with a ReQL command like:

r.db('rethinkdb').table('server_config').get(UUID_HERRE).update({'name':'NEW NAME'}).run(conn)

There was some in-person conversation in the office about whether a server should refuse to start when given a --server-name that does not match what it has, but a number of good arguments about cases where that would cause outsized problems convinced me that that was not a good idea (e.g.: settings files used for cluster setup).

@danielmewes danielmewes modified the milestones: 2.1.x, 2.2, 2.1.5 Oct 1, 2015
@danielmewes danielmewes self-assigned this Oct 1, 2015
@danielmewes
Copy link
Member Author

A fix for this is in code review 3260 by @encryptio and will probably be included in RethinkDB 2.1.5.

@danielmewes
Copy link
Member Author

The work-around has been merged into v2.1.x 9b8dbc2 and will ship with RethinkDB 2.1.5.
Also forward-ported to next (including changing term_storage to not use the MemoryPoolAllocator on ARM) with 851b2f7.

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

6 participants