Skip to content

libc++abi: terminating due to uncaught exception of type std::out_of_range: basic_string Abort trap: 6 #801

@Leask

Description

@Leask

Crash while parsing some pages. It's easy to reproduce:

let { Readability } = require('./index.js');
let { JSDOM } = require('jsdom');

const url = 'https://pandas.pydata.org/pandas-docs/stable/user_guide/indexing.html';

(async () => {
    const resp = await fetch(url);
    const html = Buffer.from(await resp.arrayBuffer()).toString('utf8');
    const doc = new JSDOM(html);
    const reader = new Readability(doc.window.document);
    const article = reader.parse();
    console.log(article);
})();

Crash with logs:

libc++abi: terminating due to uncaught exception of type std::out_of_range: basic_string
Abort trap: 6

Screenshot:

Screenshot 2023-05-05 at 12 48 22 PM

Debug codes can be found here:

https://github.com/Leask/readability/blob/out_of_range/debug.js

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions