Running without the drop at the end of the test indicates root cause is
a memory leak

130812 19:23:46 [Note] 
/home/andrew/develop/maria/repo/oqgraph-varchar/build/sql/mysqld: ready for 
connections.
Version: '10.0.1-MariaDB-debug-log'  socket: 
'/home/andrew/develop/maria/repo/oqgraph-varchar/build/mysql-test/var/tmp/mysqld.1.sock'
  port: 16000  Source distribution
Warning:  984 bytes lost, allocated by T@2 at mysys/my_alloc.c:233, 
sql/thr_malloc.cc:77, sql/field.h:163, sql/field.cc:9501, sql/table.cc:1590, 
sql/table.cc:747, ??:0, sql/handler.cc:2347
Warning: 1744 bytes lost, allocated by T@2 at mysys/my_alloc.c:233, 
sql/sql_list.h:43, myisam/ha_myisam.cc:128, sql/handler.cc:252, 
sql/table.cc:1370, sql/table.cc:747, ??:0, sql/handler.cc:2347
Warning:  984 bytes lost, allocated by T@2 at mysys/my_alloc.c:233, ??:0, 
sql/handler.cc:2347, sql/table.cc:2663, sql/sql_base.cc:3207, 
sql/sql_base.cc:4564, sql/sql_base.cc:5115, sql/sql_base.cc:5718
Memory lost: 3712 bytes in 2204 chunks
mysqld: /home/andrew/develop/maria/repo/oqgraph-varchar/sql/sql_class.cc:1572: 
virtual THD::~THD(): Assertion `status_var.memory_used == 0' failed.


I did some funky stuff in gdb and worked out that the oqgraph3::cursor has a 
reference count that never falls to zero:

andrew@atlantis3:~/develop/maria$ egrep '_ref_count|#2' refs1.txt | paste - 
-|grep cursor
163         ptr->_ref_count++;  #2  0x00000000009a5e9c in 
oqgraph3::cursor::cursor (this=0x22c3f10, graph=...) at 
/home/andrew/develop/maria/repo/oqgraph-varchar/storage/oqgraph/oqgraph_thunk.cc:69
163         ptr->_ref_count++;  #2  0x00000000009a5e9c in 
oqgraph3::cursor::cursor (this=0x22c4130, graph=...) at 
/home/andrew/develop/maria/repo/oqgraph-varchar/storage/oqgraph/oqgraph_thunk.cc:69
163         ptr->_ref_count++;  #2  0x00000000009a5e9c in 
oqgraph3::cursor::cursor (this=0x22d6de0, graph=...) at 
/home/andrew/develop/maria/repo/oqgraph-varchar/storage/oqgraph/oqgraph_thunk.cc:69
163         ptr->_ref_count++;  #2  0x00000000009a5e9c in 
oqgraph3::cursor::cursor (this=0x22d6eb0, graph=...) at 
/home/andrew/develop/maria/repo/oqgraph-varchar/storage/oqgraph/oqgraph_thunk.cc:69
163         ptr->_ref_count++;  #2  0x00000000009a5e9c in 
oqgraph3::cursor::cursor (this=0x22d7670, graph=...) at 
/home/andrew/develop/maria/repo/oqgraph-varchar/storage/oqgraph/oqgraph_thunk.cc:69
163         ptr->_ref_count++;  #2  0x00000000009a5e9c in 
oqgraph3::cursor::cursor (this=0x22d7740, graph=...) at 
/home/andrew/develop/maria/repo/oqgraph-varchar/storage/oqgraph/oqgraph_thunk.cc:69
168         ptr->_ref_count--;  #2  0x00000000009a659f in 
oqgraph3::cursor::~cursor (this=0x22d6eb0, __in_chrg=<optimized out>) at 
/home/andrew/develop/maria/repo/oqgraph-varchar/storage/oqgraph/oqgraph_thunk.cc:93
168         ptr->_ref_count--;  #2  0x00000000009a659f in 
oqgraph3::cursor::~cursor (this=0x22d6de0, __in_chrg=<optimized out>) at 
/home/andrew/develop/maria/repo/oqgraph-varchar/storage/oqgraph/oqgraph_thunk.cc:93
163         ptr->_ref_count++;  #2  0x00000000009a5e9c in 
oqgraph3::cursor::cursor (this=0x22d7020, graph=...) at 
/home/andrew/develop/maria/repo/oqgraph-varchar/storage/oqgraph/oqgraph_thunk.cc:69
163         ptr->_ref_count++;  #2  0x00000000009a5e9c in 
oqgraph3::cursor::cursor (this=0x22d6d80, graph=...) at 
/home/andrew/develop/maria/repo/oqgraph-varchar/storage/oqgraph/oqgraph_thunk.cc:69
168         ptr->_ref_count--;  #2  0x00000000009a659f in 
oqgraph3::cursor::~cursor (this=0x22d7020, __in_chrg=<optimized out>) at 
/home/andrew/develop/maria/repo/oqgraph-varchar/storage/oqgraph/oqgraph_thunk.cc:93
168         ptr->_ref_count--;  #2  0x00000000009a659f in 
oqgraph3::cursor::~cursor (this=0x22d7670, __in_chrg=<optimized out>) at 
/home/andrew/develop/maria/repo/oqgraph-varchar/storage/oqgraph/oqgraph_thunk.cc:93
168         ptr->_ref_count--;  #2  0x00000000009a659f in 
oqgraph3::cursor::~cursor (this=0x22d7740, __in_chrg=<optimized out>) at 
/home/andrew/develop/maria/repo/oqgraph-varchar/storage/oqgraph/oqgraph_thunk.cc:93

This was also visible in the debugger at the assertion point -
_ref_count=3

-- 
You received this bug notification because you are a member of OQgraph
developers, which is a bug assignee.
https://bugs.launchpad.net/bugs/1133093

Title:
  Crash on ORDER BY in OQGRAPH v3

Status in OQGraph Engine for MariaDB:
  Triaged

Bug description:
  SELECT * FROM graph WHERE latch=1 AND origid=1 AND destid=6;
  works

  SELECT * FROM graph WHERE latch=1 AND origid=1 AND destid=6 ORDER BY seq;
  segfaults.

To manage notifications about this bug go to:
https://bugs.launchpad.net/oqgraph/+bug/1133093/+subscriptions

-- 
Mailing list: https://launchpad.net/~oqgraph-dev
Post to     : oqgraph-dev@lists.launchpad.net
Unsubscribe : https://launchpad.net/~oqgraph-dev
More help   : https://help.launchpad.net/ListHelp

Reply via email to