mysql@carbon:~$ valgrind /usr/libexec/mysqld --datadir=/var/lib/mysql --pid-file=/var/run/mysql/mysql.pid --core-file --skip-networking
==1849== Memcheck, a memory error detector
==1849== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==1849== Using Valgrind-3.9.0 and LibVEX; rerun with -h for copyright info
==1849== Command: /usr/libexec/mysqld --datadir=/var/lib/mysql --pid-file=/var/run/mysql/mysql.pid --core-file --skip-networking
==1849==
140612 12:01:53 [Note] InnoDB: Using mutexes to ref count buffer pool pages
2014-06-12 12:01:53 405a040 InnoDB: !!!!!!!! UNIV_DEBUG switched on !!!!!!!!!
2014-06-12 12:01:53 405a040 InnoDB: !!!!!!!! UNIV_SYNC_DEBUG switched on !!!!!!!!!
140612 12:01:53 [Note] InnoDB: The InnoDB memory heap is disabled
140612 12:01:53 [Note] InnoDB: Mutexes and rw_locks use GCC atomic builtins
140612 12:01:53 [Note] InnoDB: Compressed tables use zlib 1.2.8
140612 12:01:53 [Note] InnoDB: Using Linux native AIO
140612 12:01:53 [Note] InnoDB: Not using CPU crc32 instructions
140612 12:01:53 [Note] InnoDB: Initializing buffer pool, size = 128.0M
140612 12:01:54 [Note] InnoDB: Completed initialization of buffer pool
140612 12:01:54 [Note] InnoDB: Highest supported file format is Barracuda.
140612 12:01:57 [Note] InnoDB: 128 rollback segment(s) are active.
140612 12:01:58 [Note] InnoDB: Waiting for purge to start
140612 12:01:58 [Note] InnoDB:  Percona XtraDB (http://www.percona.com) 5.6.17-65.0 started; log sequence number 8834281
140612 12:02:00 [Note] Plugin 'FEEDBACK' is disabled.
Thu Jun 12 12:02:03 2014 Tokudb file system space is low
140612 12:02:04 [Note] Event Scheduler: Loaded 0 events
140612 12:02:04 [Note] /usr/libexec/mysqld: ready for connections.
Version: '10.0.11-MariaDB-debug'  socket: '/var/run/mysql/mysql.sock'  port: 0  MariaDB Server





==1849== Thread 35:
==1849== Invalid read of size 8
==1849==    at 0x73A2E8: handler::ha_index_read_map(unsigned char*, unsigned char const*, unsigned long, ha_rkey_function) (sql_class.h:2479)
==1849==    by 0x7C214E6: oqgraph3::cursor::seek_to(boost::optional<unsigned long long>, boost::optional<unsigned long long>) (oqgraph_thunk.cc:503)
==1849==    by 0x7C14D67: open_query::oqgraph_share::find_vertex(unsigned long long) const (oqgraph_shim.h:480)
==1849==    by 0x7C15BE2: open_query::oqgraph::search(int*, unsigned long long*, unsigned long long*) (graphcore.cc:726)
==1849==    by 0x7C135B6: ha_oqgraph::index_read_idx(unsigned char*, unsigned int, unsigned char const*, unsigned int, ha_rkey_function) (ha_oqgraph.cc:966)
==1849==    by 0x7C13747: ha_oqgraph::index_read(unsigned char*, unsigned char const*, unsigned int, ha_rkey_function) (ha_oqgraph.cc:815)
==1849==    by 0x7C14001: handler::index_read_map(unsigned char*, unsigned char const*, unsigned long, ha_rkey_function) (handler.h:2888)
==1849==    by 0x73A278: handler::ha_index_read_map(unsigned char*, unsigned char const*, unsigned long, ha_rkey_function) (handler.cc:2585)
==1849==    by 0x73F7F6: handler::read_range_first(st_key_range const*, st_key_range const*, bool, bool) (handler.cc:5362)
==1849==    by 0x6C4BB8: handler::multi_range_read_next(void**) (multi_range_read.cc:296)
==1849==    by 0x82D79E: QUICK_RANGE_SELECT::get_next() (opt_range.cc:11673)
==1849==    by 0x732FC8: filesort(THD*, TABLE*, st_sort_field*, unsigned int, SQL_SELECT*, unsigned long long, bool, unsigned long long*, unsigned long long*) (filesort.cc:739)
==1849==  Address 0x5a5a5a5a5a5a6e3a is not stack'd, malloc'd or (recently) free'd
==1849==
140612 12:03:01 [ERROR] mysqld got signal 11 ;
This could be because you hit a bug. It is also possible that this binary
or one of the libraries it was linked against is corrupt, improperly built,
or misconfigured. This error can also be caused by malfunctioning hardware.

To report this bug, see http://kb.askmonty.org/en/reporting-bugs

We will try our best to scrape up some info that will hopefully help
diagnose the problem, but since we have already crashed,
something is definitely wrong and this may fail.

Server version: 10.0.11-MariaDB-debug
key_buffer_size=134217728
read_buffer_size=131072
max_used_connections=2
max_threads=153
thread_count=1
It is possible that mysqld could use up to
key_buffer_size + (read_buffer_size + sort_buffer_size)*max_threads = 467209 K  bytes of memory
Hope that's ok; if not, decrease some variables in the equation.

Thread pointer: 0x0x1d230070
Attempting backtrace. You can use the following information to find out
where mysqld died. If you see no messages after this, something went
terribly wrong...
stack_bottom = 0x417fe18 thread_stack 0x48000
mysys/stacktrace.c:246(my_print_stacktrace)[0xc99ef6]
sql/signal_handler.cc:155(handle_fatal_signal)[0x734627]
/lib64/libpthread.so.0(+0xfc80)[0x4e41c80]
sql/sql_class.h:2479(THD::check_limit_rows_examined())[0x73a2e8]
/usr/lib64/mysql/plugin/ha_oqgraph.so(_ZN8oqgraph36cursor7seek_toEN5boost8optionalIyEES3_+0xb0d)[0x7c214e7]
/usr/lib64/mysql/plugin/ha_oqgraph.so(_ZNK10open_query13oqgraph_share11find_vertexEy+0x62)[0x7c14d68]
/usr/lib64/mysql/plugin/ha_oqgraph.so(_ZN10open_query7oqgraph6searchEPiPyS2_+0xc5)[0x7c15be3]
/usr/lib64/mysql/plugin/ha_oqgraph.so(_ZN10ha_oqgraph14index_read_idxEPhjPKhj16ha_rkey_function+0x473)[0x7c135b7]
/usr/lib64/mysql/plugin/ha_oqgraph.so(_ZN10ha_oqgraph10index_readEPhPKhj16ha_rkey_function+0x72)[0x7c13748]
/usr/lib64/mysql/plugin/ha_oqgraph.so(_ZN7handler14index_read_mapEPhPKhm16ha_rkey_function+0x3e)[0x7c14002]
sql/handler.cc:2585(handler::ha_index_read_map(unsigned char*, unsigned char const*, unsigned long, ha_rkey_function))[0x73a279]
sql/handler.cc:5362(handler::read_range_first(st_key_range const*, st_key_range const*, bool, bool))[0x73f7f7]
sql/multi_range_read.cc:296(handler::multi_range_read_next(void**))[0x6c4bb9]
sql/opt_range.cc:11673(QUICK_RANGE_SELECT::get_next())[0x82d79f]
sql/filesort.cc:739(find_all_keys)[0x732fc9]
sql/sql_select.cc:20557(create_sort_index)[0x5f75fe]
sql/sql_select.cc:3040(JOIN::exec_inner())[0x60b282]
sql/sql_select.cc:2367(JOIN::exec())[0x60b9f3]
sql/sql_select.cc:3305(mysql_select(THD*, Item***, TABLE_LIST*, unsigned int, List<Item>&, Item*, unsigned int, st_order*, st_order*, Item*, st_order*, unsigned long long, select_result*, st_select_lex_unit*, st_select_lex*))[0x6084b6]
sql/sql_select.cc:372(handle_select(THD*, LEX*, select_result*, unsigned long))[0x6086cb]
sql/sql_parse.cc:5263(execute_sqlcom_select)[0x5a798e]
sql/sql_parse.cc:2554(mysql_execute_command(THD*))[0x5ae066]
sql/sql_parse.cc:6409(mysql_parse(THD*, char*, unsigned int, Parser_state*))[0x5b6da6]
sql/sql_parse.cc:1296(dispatch_command(enum_server_command, THD*, char*, unsigned int))[0x5b81ae]
sql/sql_parse.cc:1006(do_command(THD*))[0x5b9ef5]
sql/sql_connect.cc:1379(do_handle_one_connection(THD*))[0x68f86d]
sql/sql_connect.cc:1295(handle_one_connection)[0x68f94d]
perfschema/pfs.cc:1863(pfs_spawn_thread)[0x8d43da]
/lib64/libpthread.so.0(+0x80d2)[0x4e3a0d2]
/lib64/libc.so.6(clone+0x6d)[0x65eef6d]

Trying to get some variables.
Some pointers may be invalid and cause the dump to abort.
Query (0x2210c088): SELECT `db`.`version`, `db`.`nodeID` FROM `version_history` AS `v` INNER JOIN `db_history` AS `db` ON `db`.`nodeID` = `v`.`linkid` WHERE `latch` = 'breadth_first' AND `origid` = '1' ORDER BY `weight` DESC LIMIT 1
Connection ID (thread ID): 7
Status: NOT_KILLED

Optimizer switch: index_merge=on,index_merge_union=on,index_merge_sort_union=on,index_merge_intersection=on,index_merge_sort_intersection=off,engine_condition_pushdown=off,index_condition_pushdown=on,derived_merge=on,derived_with_keys=on,firstmatch=on,loosescan=on,materialization=on,in_to_exists=on,semijoin=on,partial_match_rowid_merge=on,partial_match_table_scan=on,subquery_cache=on,mrr=off,mrr_cost_based=off,mrr_sort_keys=off,outer_join_with_cache=on,semijoin_with_cache=on,join_cache_incremental=on,join_cache_hashed=on,join_cache_bka=on,optimize_join_buffer_size=off,table_elimination=on,extended_keys=on,exists_to_in=off

The manual page at http://dev.mysql.com/doc/mysql/en/crashing.html contains
information that should help you find out what is causing the crash.
Writing a core file
==1849==
==1849== Process terminating with default action of signal 11 (SIGSEGV): dumping core
==1849==  General Protection Fault
==1849==    at 0x73A2E8: handler::ha_index_read_map(unsigned char*, unsigned char const*, unsigned long, ha_rkey_function) (sql_class.h:2479)
==1849==    by 0x7C214E6: oqgraph3::cursor::seek_to(boost::optional<unsigned long long>, boost::optional<unsigned long long>) (oqgraph_thunk.cc:503)
==1849==    by 0x7C14D67: open_query::oqgraph_share::find_vertex(unsigned long long) const (oqgraph_shim.h:480)
==1849==    by 0x7C15BE2: open_query::oqgraph::search(int*, unsigned long long*, unsigned long long*) (graphcore.cc:726)
==1849==    by 0x7C135B6: ha_oqgraph::index_read_idx(unsigned char*, unsigned int, unsigned char const*, unsigned int, ha_rkey_function) (ha_oqgraph.cc:966)
==1849==    by 0x7C13747: ha_oqgraph::index_read(unsigned char*, unsigned char const*, unsigned int, ha_rkey_function) (ha_oqgraph.cc:815)
==1849==    by 0x7C14001: handler::index_read_map(unsigned char*, unsigned char const*, unsigned long, ha_rkey_function) (handler.h:2888)
==1849==    by 0x73A278: handler::ha_index_read_map(unsigned char*, unsigned char const*, unsigned long, ha_rkey_function) (handler.cc:2585)
==1849==    by 0x73F7F6: handler::read_range_first(st_key_range const*, st_key_range const*, bool, bool) (handler.cc:5362)
==1849==    by 0x6C4BB8: handler::multi_range_read_next(void**) (multi_range_read.cc:296)
==1849==    by 0x82D79E: QUICK_RANGE_SELECT::get_next() (opt_range.cc:11673)
==1849==    by 0x732FC8: filesort(THD*, TABLE*, st_sort_field*, unsigned int, SQL_SELECT*, unsigned long long, bool, unsigned long long*, unsigned long long*) (filesort.cc:739)
==1849==
==1849== HEAP SUMMARY:
==1849==     in use at exit: 69,035 bytes in 123 blocks
==1849==   total heap usage: 712 allocs, 589 frees, 114,132 bytes allocated
==1849==
==1849== LEAK SUMMARY:
==1849==    definitely lost: 240 bytes in 3 blocks
==1849==    indirectly lost: 216 bytes in 6 blocks
==1849==      possibly lost: 154 bytes in 4 blocks
==1849==    still reachable: 68,425 bytes in 110 blocks
==1849==         suppressed: 0 bytes in 0 blocks
==1849== Rerun with --leak-check=full to see details of leaked memory
==1849==
==1849== For counts of detected and suppressed errors, rerun with: -v
==1849== ERROR SUMMARY: 2 errors from 1 contexts (suppressed: 1 from 1)
Killed
