Re: BUG #15420: Server crash. Segmentation fault when parsing xml file

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Sergey Mirvoda <sergey(at)mirvoda(dot)com>
Cc: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Andrey Borodin <x4mmm(at)yandex-team(dot)ru>, Andrew Borodin <borodin(at)octonica(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15420: Server crash. Segmentation fault when parsing xml file
Date: 2018-10-04 15:02:05
Message-ID: CAFj8pRD6d=wHgGRkVE2ZzCFof_ga+mNQ+V2Yw59r0StTjfqc_w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

čt 4. 10. 2018 v 16:42 odesílatel Sergey Mirvoda <sergey(at)mirvoda(dot)com>
napsal:

>
>
> чт, 4 окт. 2018, 19:31 Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>:
>
>> On 2018-Oct-04, Sergey Mirvoda wrote:
>>
>> > чт, 4 окт. 2018, 19:03 Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>:
>>
>> > Pavel, thank you for your interest.
>> > It is definitely something inside this document.
>> >
>> > Actually we loaded about 10k different documents like this one. About
>> 10Gb
>> > of content and crash is only on this one.
>>
>> It's probably a good idea to report this to libxml2 then.
>>
>> --
>> Álvaro Herrera https://www.2ndQuadrant.com/
>> PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services
>>
>
> Sure, but bug is mostly about unhandled server crash. Is it normal?
>

Nobody can handle process crash. This should be fixed on libxml2 side.

>
> Also, as far as I understand Pavel, lbxml2 interface somehow changed for
> handling 'huge' documents, but postgres don't handle this correctly.
>

This can be fixed only partially - the authors of libxml2 introduced new
limit and new option, but there is not possible apply new option on all
API.

If I understand well to this behave - libxml2 implemented new limits as
safeguards against strange attacker documents. Is it question if it is good
idea disable this safeguards by default. Second issue is impossibility to
set this option for functionality that we use from libxml2 - and there are
not alternatives. I have not any idea, how these issues can be fixed on
postgresql side.

The mentioned limit is 10 000 000 bytes - if you will generate documents
less than this size, then probably don't hit this issue.

Regards

Pavel

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2018-10-04 23:27:06 Re: BUG #15420: Server crash. Segmentation fault when parsing xml file
Previous Message Sergey Mirvoda 2018-10-04 14:42:31 Re: BUG #15420: Server crash. Segmentation fault when parsing xml file