Bug 268809 - www/writefreely: segfaults
Summary: www/writefreely: segfaults
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Some People
Assignee: Fernando Apesteguía
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-01-07 11:19 UTC by NaziLeaks
Modified: 2023-01-31 11:10 UTC (History)
2 users (show)

See Also:
bugzilla: maintainer-feedback? (fuz)
fernape: merge-quarterly+


Attachments
segfault (88.94 KB, image/png)
2023-01-07 11:19 UTC, NaziLeaks
no flags Details
www/writefreely: make port more robust when binary is run manually (4.52 KB, patch)
2023-01-27 16:18 UTC, Robert Clausecker
fuz: maintainer-approval+
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description NaziLeaks 2023-01-07 11:19:36 UTC
Created attachment 239326 [details]
segfault

I am trying to set up a fresh install of writefreely 0.13.2 on FreeBSD 13.1 (MySQL backend) and getting a segfault when trying to create an admin user (i selected the multi-user instance option during configuration).

The issue was reported to the writefreely developers and they told me to report it here instead.
Comment 1 Robert Clausecker freebsd_committer freebsd_triage 2023-01-07 11:59:50 UTC
Upstream bug: https://github.com/writefreely/writefreely/issues/620
Comment 2 Robert Clausecker freebsd_committer freebsd_triage 2023-01-24 12:11:05 UTC
This bug is caused by us not specifying the path to various important directories in the configuration file in conjunction with upstream not performing correct error handling.  Upstream will fix the error handling in an upcoming version.

I will shortly upload a patch avoiding this problem for newly set up instances.  For existing instances, please add the following configuration keys to /usr/local/www/writefreely/config.ini:

[server]
templates_parent_dir = /usr/local/www/writefreely
static_parent_dir = /usr/local/www/writefreely
pages_parent_dir = /usr/local/www/writefreely
keys_parent_dir = /usr/local/www/writefreely

If your installation has PREFIX set to a value other than /usr/local, please adjust the paths as needed.

OP, please let me know if this work around fixes your problem so I can push the patch.
Comment 3 Robert Clausecker freebsd_committer freebsd_triage 2023-01-27 16:18:49 UTC
Created attachment 239745 [details]
www/writefreely: make port more robust when binary is run manually

The attached patch should work around this problem for new installations and provide better error reporting for existing installations.  The same workaround can be added to existing installations by setting in /usr/local/www/writefreely:

[server]
templates_parent_dir = /usr/local/www/writefreely
static_parent_dir = /usr/local/www/writefreely
pages_parent_dir = /usr/local/www/writefreely
keys_parent_dir = /usr/local/www/writefreely

(change /usr/local to your PREFIX as needed).
Comment 4 Fernando Apesteguía freebsd_committer freebsd_triage 2023-01-30 09:57:54 UTC
Committed,

Thanks!
Comment 5 commit-hook freebsd_committer freebsd_triage 2023-01-30 09:57:59 UTC
A commit in branch main references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=7625d4e4e5dd24a06c7d946d7b4328c8f17410bb

commit 7625d4e4e5dd24a06c7d946d7b4328c8f17410bb
Author:     Robert Clausecker <fuz@fuz.su>
AuthorDate: 2023-01-30 08:41:05 +0000
Commit:     Fernando Apesteguía <fernape@FreeBSD.org>
CommitDate: 2023-01-30 09:53:14 +0000

    www/writefreely: Pick patch to fix segmentation fault

    Selectively picking patch from upstream to fix a segmentation fault. Adding
    sample configuration to workaround the problem.

    PR:             268809
    Reported by:    trash@nazileaks.eu

 www/writefreely/Makefile                         | 12 ++++++++++--
 www/writefreely/distinfo                         |  4 +++-
 www/writefreely/files/config.ini.sample.in (new) | 10 ++++++++++
 www/writefreely/pkg-plist                        |  1 +
 4 files changed, 24 insertions(+), 3 deletions(-)
Comment 6 Robert Clausecker freebsd_committer freebsd_triage 2023-01-30 23:13:37 UTC
(In reply to Fernando Apesteguía from comment #4)

Could you please MFH the change as it is a build fix?
I was unable to ask for that to be done as I am not permitted to set the flag.
Comment 7 Robert Clausecker freebsd_committer freebsd_triage 2023-01-30 23:16:12 UTC
(In reply to Fernando Apesteguía from comment #4)

Also I would very much appreciate if you kept the commit text when committing my patches.  I spent time making sure the problem is accurately described and to pick a reasonable summary.  Your description does not describe the problem in a useful way, making it much harder to find out what this patch is really about.

If you use "git am" to apply a patch, the commit text is automatically imported from the patch file.
Comment 8 commit-hook freebsd_committer freebsd_triage 2023-01-31 11:09:52 UTC
A commit in branch 2023Q1 references this bug:

URL: https://cgit.FreeBSD.org/ports/commit/?id=d0e955466184a2dfb141f7f910a042c2189833c6

commit d0e955466184a2dfb141f7f910a042c2189833c6
Author:     Robert Clausecker <fuz@fuz.su>
AuthorDate: 2023-01-30 08:41:05 +0000
Commit:     Fernando Apesteguía <fernape@FreeBSD.org>
CommitDate: 2023-01-31 10:07:51 +0000

    www/writefreely: Pick patch to fix segmentation fault

    Selectively picking patch from upstream to fix a segmentation fault. Adding
    sample configuration to workaround the problem.

    PR:             268809
    Reported by:    trash@nazileaks.eu

    (cherry picked from commit 7625d4e4e5dd24a06c7d946d7b4328c8f17410bb)

 www/writefreely/Makefile                         | 12 ++++++++++--
 www/writefreely/distinfo                         |  4 +++-
 www/writefreely/files/config.ini.sample.in (new) | 10 ++++++++++
 www/writefreely/pkg-plist                        |  1 +
 4 files changed, 24 insertions(+), 3 deletions(-)
Comment 9 Fernando Apesteguía freebsd_committer freebsd_triage 2023-01-31 11:10:53 UTC
Merged to 2023Q1.