Bug 239189 - editors/nano: binary package segfaults
Summary: editors/nano: binary package segfaults
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: amd64 Any
: --- Affects Many People
Assignee: Danilo Egea Gondolfo
URL:
Keywords:
: 239188 (view as bug list)
Depends on:
Blocks:
 
Reported: 2019-07-13 18:06 UTC by Robert Clausecker
Modified: 2019-07-28 20:03 UTC (History)
5 users (show)

See Also:
bugzilla: maintainer-feedback? (danilo)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Robert Clausecker 2019-07-13 18:06:32 UTC
The current amd64 binary package for nano (nano-4.2) segfaults on all machines I've tried it on (all on FreeBSD-12.0).  Building the binary manually from ports fixes the problem.  Please upload a correctly built binary.
Comment 1 Robert Clausecker 2019-07-13 18:07:23 UTC
*** Bug 239188 has been marked as a duplicate of this bug. ***
Comment 2 s.zawadzki 2019-07-14 00:21:09 UTC
Yeah, something has wrong. You must unset LANG...

x@FreeBSD:~ % nano --version
 GNU nano, version 4.2
 (C) 1999-2011, 2013-2019 Free Software Foundation, Inc.
 (C) 2014-2019 the contributors to nano
 Email: nano@nano-editor.org	Web: https://nano-editor.org/
 Compiled options: --enable-utf8
x@FreeBSD:~ % setenv LANG pl_PL.UTF-8
x@FreeBSD:~ % nano --version
Segmentation fault (core dumped)
x@FreeBSD:~ % setenv LANG
x@FreeBSD:~ % nano --version
 GNU nano, version 4.2
 (C) 1999-2011, 2013-2019 Free Software Foundation, Inc.
 (C) 2014-2019 the contributors to nano
 Email: nano@nano-editor.org	Web: https://nano-editor.org/
 Compiled options: --enable-utf8
Comment 3 Derek Schrock 2019-07-14 00:23:38 UTC
Looking at this in freenode #freebsd it appears to be a LANG/LC_MESSAGES/locale thing with ncurses.

setting LANG or LC_MESSAGES may be an alt. work around too.

$ env LC_MESSAGES=pl_PL.UTF-8 nano --version
Segmentation fault (zrzut pamięci)

$ env LC_MESSAGES=en_US.UTF-8 nano --version
 GNU nano, version 4.2
 (C) 1999-2011, 2013-2019 Free Software Foundation, Inc.
 (C) 2014-2019 the contributors to nano
 Email: nano@nano-editor.org    Web: https://nano-editor.org/
Comment 4 Luciano PELLE 2019-07-23 01:24:24 UTC
I've tried to remove (pkg remove nano) and re- install nano from ports but it did not work. I get the same segmentation fault error.
Is there something i could try?
I am not a real expert in FreeBSD so, if you can, try to explain step by step the solution.

Thanks a lot in advance
Comment 5 JH 2019-07-27 16:48:49 UTC
I'm also experiencing this problem as well with Japanese. This really causes problems in my workflow.

% env LC_MESSAGES=ja_JP.UTF-8 nano --version
[1]    15105 segmentation fault (core dumped)  env LC_MESSAGES=ja_JP.UTF-8 nano --version

% env LC_MESSAGES=en_US.UTF-8 nano --version
 GNU nano, version 4.2
 (C) 1999-2011, 2013-2019 Free Software Foundation, Inc.
 (C) 2014-2019 the contributors to nano
 Email: nano@nano-editor.org	Web: https://nano-editor.org/
 Compiled options: --enable-utf8
Comment 6 JH 2019-07-27 16:50:12 UTC
(In reply to Robert Clausecker from comment #0)
I'm using 13.0-CURRENT and built from ports.
Comment 7 sebastian 2019-07-28 15:13:21 UTC
I can confirm the below:

[root@waldfest /]# uname -a
FreeBSD waldfest 12.0-RELEASE-p3 FreeBSD 12.0-RELEASE-p3 GENERIC  amd64
[root@waldfest /]# env LC_MESSAGES=en_US.UTF-8 nano --version
 GNU nano, version 4.2
 (C) 1999-2011, 2013-2019 Free Software Foundation, Inc.
 (C) 2014-2019 the contributors to nano
 Email: nano@nano-editor.org	Web: https://nano-editor.org/
 Compiled options: --enable-utf8
[root@waldfest /]# env LC_MESSAGES=de_DE.UTF-8 nano --version
Segmentation fault
[root@waldfest /]# locale
LANG=de_DE.UTF-8
LC_CTYPE="de_DE.UTF-8"
LC_COLLATE="de_DE.UTF-8"
LC_TIME="de_DE.UTF-8"
LC_NUMERIC="de_DE.UTF-8"
LC_MONETARY="de_DE.UTF-8"
LC_MESSAGES="de_DE.UTF-8"
LC_ALL=

Nano crashes on amd64 (binary package) on a machine that is not using en_US it seems. Unsetting LANG or changing LC_MESSAGES (see above) fixes the issue.
Comment 8 commit-hook freebsd_committer 2019-07-28 19:11:50 UTC
A commit references this bug:

Author: danilo
Date: Sun Jul 28 19:11:14 UTC 2019
New revision: 507525
URL: https://svnweb.freebsd.org/changeset/ports/507525

Log:
  - Update to 4.3
  - Re-introduce CPPFLAGS. Without it the configure test for libintl fails and nano crashes when the user selects one of the NLS supported languages

  PR:		239189

Changes:
  head/editors/nano/Makefile
  head/editors/nano/distinfo
Comment 9 Danilo Egea Gondolfo freebsd_committer 2019-07-28 19:12:43 UTC
May you test this new update, guys?
Comment 10 sebastian 2019-07-28 19:30:37 UTC
I can confirm that adding the following line to the Makefile of editors/nano fixes the issue:

NLS_CPPFLAGS=   -I${LOCALBASE}/include

Thanks for fixing this Danilo!
Comment 11 Robert Clausecker 2019-07-28 20:03:28 UTC
Works for me.

Thank you for fixing this.