Opened 18 years ago

Closed 18 years ago

Last modified 18 years ago

#83 closed defect (released)

segfault when adding a value to a document pointer

Reported by: alec Owned by: Olly Betts
Priority: normal Milestone:
Component: Xapian-bindings Version: 0.9.6
Severity: minor Keywords:
Cc: Blocked By:
Blocking: Operating System: Linux

Description

example code: <?

/* FROM phpinfo()

  • xapian *
  • Xapian Support => enabled
  • Xapian Compiled Version => 0.9.6 */

set up a search db $index_path = "xapian_db"; $index_ptr = new_WritableDatabase($index_path, DB_CREATE_OR_OPEN);

$document_ptr = new_document();

this will make xapian segfault document_add_value($document_pointer, 0, 1);

?>

Attachments (2)

bug_segfault_when_adding_value.php (347 bytes ) - added by alec 18 years ago.
bug demonstration
omega-htmlparser-ignore-javascript-lessthan.patch (1.5 KB ) - added by Olly Betts 18 years ago.
Patch to fix this bug

Download all attachments as: .zip

Change History (9)

by alec, 18 years ago

bug demonstration

comment:1 by alec, 18 years ago

I realise why this happened now. I am just not using the same name for the document_pointer when trying to add the value.

Segfault nevertheless! :)

comment:2 by alec, 18 years ago

writabledatabase_add_document() will also throw the segfault if its fed an incorrect resource as an index pointer.

likely this affects other xapian functions as well.

comment:3 by Olly Betts, 18 years ago

Severity: majorminor
Status: newassigned

This is a SWIG issue - the code it generates allows you to pass "Null" as the "this" pointer, converts it to NULL, and then calls methods on that. I'll fix it in SWIG - shouldn't be too hard.

comment:4 by Olly Betts, 18 years ago

This will be fixed in SWIG 1.3.30 (not yet released).

by Olly Betts, 18 years ago

Patch to fix this bug

comment:5 by Olly Betts, 18 years ago

attachments.isobsolete: 01

(From update of attachment 21) Wrong bug! I hate bugzilla sometimes...

comment:6 by Olly Betts, 18 years ago

Resolution: fixed
Status: assignedclosed

Fixed in SWIG CVS, which we'll be using for the next Xapian release.

comment:7 by Olly Betts, 18 years ago

Operating System: Linux
Resolution: fixedreleased
Note: See TracTickets for help on using tickets.