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.
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
pg_journal-0.2.0-12.fc24 has been submitted as an update to Fedora 24. https://bodhi.fedoraproject.org/updates/FEDORA-2016-cd4e3d9254
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.
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.
(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
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
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.
I'm reopening this bug, I don't have the feeling that the patch is enough.
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?
Just noting that pg_journal remains unusable in F25.
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.
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.