Bug 1337710 - pg_journal causes postgreSQL to experience a fatal 'out of memory' error on start-up.
Summary: pg_journal causes postgreSQL to experience a fatal 'out of memory' error on s...
Keywords:
Status: CLOSED EOL
Alias: None
Product: Fedora
Classification: Fedora
Component: pg_journal
Version: 24
Hardware: x86_64
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: Tomasz Torcz
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-05-19 21:34 UTC by Ed Behn
Modified: 2017-08-08 14:35 UTC (History)
3 users (show)

Fixed In Version: pg_journal-0.2.0-12.fc24
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-08-08 14:35:17 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
Source Patch to correct noted bug. (2.49 KB, patch)
2016-05-19 21:34 UTC, Ed Behn
no flags Details | Diff

Description Ed Behn 2016-05-19 21:34:40 UTC
Created attachment 1159720 [details]
Source Patch to correct noted bug.

Description of problem:
When trying to use the pg_journal library in postgreSQL, an 'out of memory' error is produced at start up. 

Version-Release number of selected component (if applicable):0.2.0-11.fc24.x86_64


Steps to Reproduce:
1. Install postgresql-server and pg_journal
2. Add the line 
    shared_preload_libraries = 'pg_journal'
to postgres.conf

3. Attempt to start PostgreSQL
    systemctl start postgresql.service

Actual results: PostgreSQL fails to start. It produces an 'out of memory error' instead. 

Expected results: clean startup and PostgreSQL log information entered into the jouarnald system. 

Additional info:
    A patch is attached. When applied the library functions normally. This is accomplished by replacing the append_fmt function.
    In addition, the patch increases MAX_FIELDS from 23 to 25. This was another error that was identified.

Comment 1 Tomasz Torcz 2016-05-24 17:57:31 UTC
Thank you Ed, bugs with patches attached are the best gift for the maintainer!

I've included your patch in rawhide build, after few days of testing I will respin the F24 package and update this bug.

In the meantime I've forwarded the patch to the upstream: https://github.com/intgr/pg_journal/issues/1

Comment 2 Fedora Update System 2016-05-26 11:07:45 UTC
pg_journal-0.2.0-12.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-cd4e3d9254

Comment 3 Marti Raudsepp 2016-05-26 14:11:04 UTC
Thanks for the patch, Ed. But this looks more like a workaround than a proper fix.

Have you analysed/debugged the original code, why it might run out of memory? I'll try to find the time to look into this myself soon.

As for(In reply to Ed Behn from comment #0)
> 3. Attempt to start PostgreSQL
>     systemctl start postgresql.service
> Actual results: PostgreSQL fails to start. It produces an 'out of memory
> error' instead. 

I don't use Fedora myself, but I have never seen this happen on my systems. 

Does this just happen on one particular machine or everywhere? What PostgreSQL version are you using? Any unusual things about your environment? Are any large messages or fields logged during your startup?

I assume this doesn't affect Tomasz Torcz, the maintainer of this package?

>     In addition, the patch increases MAX_FIELDS from 23 to 25. This was
> another error that was identified.

I think you counted wrong. The code can't take the if(){} branch and the else{} branch at the same time.

Comment 4 Tomasz Torcz 2016-05-26 14:16:34 UTC
I didn't see it personally, but I have my databases on Fedora 23, pgsql-9.4.8.
This was reported against F24, which has 9.5.3.

Comment 5 Ed Behn 2016-05-26 15:24:24 UTC
(In reply to Tomasz Torcz from comment #4)
> I didn't see it personally, but I have my databases on Fedora 23,
> pgsql-9.4.8.
> This was reported against F24, which has 9.5.3.

No, I have not analyzed the reason for the code failing beyond determining that it is the append_fmt function that caused the problem. This may well be a bug in PostgreSQL.

I'm running PostgreSQL-9.5 (the Fedora 24) default. I have not tested it on other versions of PostgreSQL. 

I tested this on a (virtual) machine where I installed Fedora 24 Server Beta. I only installed PostgreSQL and pg_journal. 

You are absolutely correct about the MAX_FIELDS. It should remain at 23. 

            -Ed

Comment 6 Fedora Update System 2016-05-26 23:28:28 UTC
pg_journal-0.2.0-12.fc24 has been pushed to the Fedora 24 testing repository. If problems still persist, please make note of it in this bug report.
See https://fedoraproject.org/wiki/QA:Updates_Testing for
instructions on how to install test updates.
You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2016-cd4e3d9254

Comment 7 Fedora Update System 2016-05-28 03:31:43 UTC
pg_journal-0.2.0-12.fc24 has been pushed to the Fedora 24 stable repository. If problems still persist, please make note of it in this bug report.

Comment 8 Tomasz Torcz 2016-05-28 07:20:35 UTC
I'm reopening this bug, I don't have the feeling that the patch is enough.

Comment 9 Tomasz Torcz 2016-07-21 11:24:55 UTC
Nb. there was an effort to introduce proper systemd support in upstream Postgresql:
https://www.postgresql.org/message-id/564B34C5.7030209@gmx.net

As far as I know, sd_notify() patches were merged, but journal integration wasn't. Maybe it is feasible to fold pg_journal into this initiative?

Comment 10 Anthony Messina 2017-01-14 18:26:51 UTC
Just noting that pg_journal remains unusable in F25.

Comment 11 Fedora End Of Life 2017-07-25 20:49:57 UTC
This message is a reminder that Fedora 24 is nearing its end of life.
Approximately 2 (two) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 24. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as EOL if it remains open with a Fedora  'version'
of '24'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version'
to a later Fedora version.

Thank you for reporting this issue and we are sorry that we were not
able to fix it before Fedora 24 is end of life. If you would still like
to see this bug fixed and are able to reproduce it against a later version
of Fedora, you are encouraged  change the 'version' to a later Fedora
version prior this bug is closed as described in the policy above.

Although we aim to fix as many bugs as possible during every release's
lifetime, sometimes those efforts are overtaken by events. Often a
more recent Fedora release includes newer upstream software that fixes
bugs or makes them obsolete.

Comment 12 Fedora End Of Life 2017-08-08 14:35:17 UTC
Fedora 24 changed to end-of-life (EOL) status on 2017-08-08. Fedora 24 is
no longer maintained, which means that it will not receive any further
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of
Fedora please feel free to reopen this bug against that version. If you
are unable to reopen this bug, please file a new report against the
current release. If you experience problems, please add a comment to this
bug.

Thank you for reporting this bug and we are sorry it could not be fixed.


Note You need to log in before you can comment on or make changes to this bug.