Opened 10 years ago

Closed 10 years ago

#7967 closed Bugs (fixed)

auto_index crashes during boostbook xml processing

Reported by: alexey kutumov <alexey.kutumov@…> Owned by: John Maddock
Milestone: To Be Determined Component: auto_index
Version: Boost 1.52.0 Severity: Problem
Keywords: Cc:

Description

auto_index crashes with following backtrace:

#3 0x08126947 in std::pair<std::string, std::string>::pair (this=0xbf909bb8, a=<error reading variable: Cannot access memory at address 0x0>, b="end")

at /usr/include/c++/4.7/bits/stl_pair.h:105

#4 0x0811ef7c in process_node (node=..., prev=0xbf909ea4, pt=0xbf909e9c, seen=false)

at /usr/src/projects/boost/modularize/src/boost/auto_index/src/auto_index.cpp:469

I founded, that this error happens when we construct item_index:

std::pair<std::string, std::string> item_index(*pid, i->term);

with incorrect pid argument (in this case it equals to zero). This variable is initialized at line 455:

const std::string* pid = get_current_block_id(&id);

And this function returns 0, which causes segfault

Attachments (1)

autoindex_issue.zip (231.0 KB ) - added by alexey kutumov <alexey.kutumov@…> 10 years ago.
reproducing example

Download all attachments as: .zip

Change History (4)

by alexey kutumov <alexey.kutumov@…>, 10 years ago

Attachment: autoindex_issue.zip added

reproducing example

comment:1 by John Maddock, 10 years ago

Resolution: invalid
Status: newclosed

You can't run auto_index on boostbook, only on docbook.

comment:2 by Steven Watanabe, 10 years ago

Resolution: invalid
Status: closedreopened

Even if it's illegal, auto_index shouldn't crash on invalid input.

comment:3 by John Maddock, 10 years ago

Resolution: fixed
Status: reopenedclosed

(In [83952]) Throw exception on precondition failure. Fixes #7967.

Note: See TracTickets for help on using tickets.