← Back to team overview

oqgraph-dev team mailing list archive

Re: Trying the examples - mysqld segfault inserting into tol_tree caused by a NULL pointer in ha_oqgraph::open

 

Hi Andrew

I think the create table statement is incomplete for v3, as in v3 there is no local storage but instead the columns need to be mapped onto cols of an existing base table (generally InnoDB).
Antony, can you update us on the correct CREATE TABLE for v3?


> INSERT INTO tol_tree (origid,destid)
> SELECT parent,id FROM tol WHERE parent IS NOT NULL;
> 
> this failed ... (stack trace attachment)
> 
> I note the stack trace is full of mangled C++ identifiers ...
> 
> I then ran mysqld from gdb. The fault repeated the same, but gdb let
> me see the identifiers. (attach #2) and of course, catch the fault and
> examine variables.
> 
> It turns out that options->tablename in ha_oqgraph::open (-->
> table_name in table.cc) is NULL. And strlen barfs because table.cc
> isn't checking for a NULL.
> 
> I am unfamiliar with the code as yet, so I don't know why this is
> NULL.
> 
> As an aside, I am used to working with code that is defensively laced
> with assertions for NULL pointers, so this is a little different to me...

Well that's clearly an omission and a bug in the new code.
Crashing a multi-threaded/multi-user daemon is not nice. So generally when something fails in MySQL, you have a mechanism to return a fail from that function.
At the very least you'd have an assert in there (do add it), but obviously you'd want to code to not get into that situation in the first place


Cheers,
Arjen.
-- 
Arjen Lentz, Exec.Director @ Open Query (http://openquery.com)
Australian peace of mind for your MySQL/MariaDB infrastructure.

Follow us at http://openquery.com/blog/ & http://twitter.com/openquery



Follow ups

References