Bug 189326 - [PATCH] net/mtr segfaults with ncurses installed from ports
Summary: [PATCH] net/mtr segfaults with ncurses installed from ports
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Po-Chuan Hsieh
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-04 03:30 UTC by Ashish SHUKLA
Modified: 2014-05-04 17:30 UTC (History)
1 user (show)

See Also:


Attachments
file.diff (457 bytes, patch)
2014-05-04 03:30 UTC, Ashish SHUKLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ashish SHUKLA freebsd_committer freebsd_triage 2014-05-04 03:30:00 UTC
λ sudo gdb $(which mtr )                                             
GNU gdb 6.1.1 [FreeBSD]
Copyright 2004 Free Software Foundation, Inc.
GDB is free software, covered by the GNU General Public License, and you are
welcome to change it and/or distribute copies of it under certain conditions.
Type "show copying" to see the conditions.
There is absolutely no warranty for GDB.  Type "show warranty" for details.
This GDB was configured as "amd64-marcel-freebsd"...
(gdb) run google.com
Starting program: /usr/local/sbin/mtr google.com
[New LWP 101095]
[New Thread 802007400 (LWP 101095/mtr)]

Program received signal SIGSEGV, Segmentation fault.
[Switching to Thread 802007400 (LWP 101095/mtr)]
0x0000000800f6ed40 in _nc_init_acs () from /usr/local/lib/libtinfo.so.5.9
(gdb) bt
#0  0x0000000800f6ed40 in _nc_init_acs () from /usr/local/lib/libtinfo.so.5.9
#1  0x00000008011b9c5f in _nc_setupscreen () from /lib/libncurses.so.8
#2  0x00000008011aa5db in newterm () from /lib/libncurses.so.8
#3  0x00000008011a79a9 in initscr () from /lib/libncurses.so.8
#4  0x00000000004047c9 in mtr_curses_open () at curses.c:677
#5  0x000000000040b292 in display_open () at display.c:99
#6  0x0000000000405668 in main (argc=2, argv=0x7fffffffdb38) at mtr.c:679
λ ldd $(which mtr)
/usr/local/sbin/mtr:
        libglib-2.0.so.0 => /usr/local/lib/libglib-2.0.so.0 (0x80082b000)
        libintl.so.9 => /usr/local/lib/libintl.so.9 (0x800b33000)
        libm.so.5 => /lib/libm.so.5 (0x800d3d000)
        libtinfo.so.5.9 => /usr/local/lib/libtinfo.so.5.9 (0x800f5e000)
        libncurses.so.8 => /lib/libncurses.so.8 (0x801190000)
        libc.so.7 => /lib/libc.so.7 (0x8013de000)
        libpcre.so.3 => /usr/local/lib/libpcre.so.3 (0x801739000)
        libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x80199d000)
        libthr.so.3 => /lib/libthr.so.3 (0x801c96000)

After applying the fix:

λ ldd $(which mtr)                 
/usr/local/sbin/mtr:
        libncurses.so.5.9 => /usr/local/lib/libncurses.so.5.9 (0x80082b000)
        libtinfo.so.5.9 => /usr/local/lib/libtinfo.so.5.9 (0x800a48000)
        libglib-2.0.so.0 => /usr/local/lib/libglib-2.0.so.0 (0x800c7a000)
        libintl.so.9 => /usr/local/lib/libintl.so.9 (0x800f82000)
        libm.so.5 => /lib/libm.so.5 (0x80118c000)
        libncurses.so.8 => /lib/libncurses.so.8 (0x8013ad000)
        libc.so.7 => /lib/libc.so.7 (0x8015fb000)
        libpcre.so.3 => /usr/local/lib/libpcre.so.3 (0x801956000)
        libiconv.so.3 => /usr/local/lib/libiconv.so.3 (0x801bba000)
        libthr.so.3 => /lib/libthr.so.3 (0x801eb3000)

How-To-Repeat: 1. Install devel/ncurses port.
2. Install net/mtr-nox11 port.
3. Execute: mtr some-host-name
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2014-05-04 03:30:04 UTC
Responsible Changed
From-To: freebsd-ports-bugs->sunpoet

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 dfilter service freebsd_committer freebsd_triage 2014-05-04 17:28:18 UTC
Author: sunpoet
Date: Sun May  4 16:28:14 2014
New Revision: 352965
URL: http://svnweb.freebsd.org/changeset/ports/352965
QAT: https://qat.redports.org/buildarchive/r352965/

Log:
  - Fix segfault when devel/ncurses installed
  
  PR:		ports/189326
  Submitted by:	ashish

Modified:
  head/net/mtr/Makefile

Modified: head/net/mtr/Makefile
==============================================================================
--- head/net/mtr/Makefile	Sun May  4 15:54:49 2014	(r352964)
+++ head/net/mtr/Makefile	Sun May  4 16:28:14 2014	(r352965)
@@ -19,7 +19,8 @@ GLIB_DESC=	Build with glib library
 X11_DESC=	Build X11-enabled mtr
 
 GNU_CONFIGURE=	yes
-USES=		pkgconfig
+LDFLAGS+=	-lncurses
+USES=		ncurses pkgconfig
 
 PLIST_FILES=	man/man8/mtr.8.gz \
 		sbin/mtr
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"
Comment 3 Po-Chuan Hsieh freebsd_committer freebsd_triage 2014-05-04 17:28:32 UTC
State Changed
From-To: open->closed

Committed. Thanks!