Skip to content
This repository has been archived by the owner on Jan 16, 2025. It is now read-only.

ngrep: segmentation fault #27171

Closed
oscdis opened this issue Mar 3, 2014 · 7 comments
Closed

ngrep: segmentation fault #27171

oscdis opened this issue Mar 3, 2014 · 7 comments

Comments

@oscdis
Copy link

oscdis commented Mar 3, 2014

running ngrep with a port fails.

$ ngrep port 80 
interface: en0 (192.168.0.0/255.255.255.0)
[1]    60353 segmentation fault  ngrep port 80

I can add "--disable-pcap-restart” to ngrep.rb and avoid it.(But by it, I don't know what side effects happen)


diff --git a/Library/Formula/ngrep.rb b/Library/Formula/ngrep.rb

index 2c1435d..ef272a1 100644
--- a/Library/Formula/ngrep.rb
+++ b/Library/Formula/ngrep.rb
@@ -10,7 +10,8 @@ class Ngrep < Formula
                           "--disable-dependency-tracking",
                           "--prefix=#{prefix}",
                           # this line required to make configure succeed
-                          "--with-pcap-includes=/usr/include"
+                          "--with-pcap-includes=/usr/include",
+                          "--disable-pcap-restart"
     system "make install"
   end
 end
$ brew --config
HOMEBREW_VERSION: 0.9.5
ORIGIN: https://github.com/Homebrew/homebrew.git
HEAD: 68dfcda524374a425657f30629f91693eed63531
HOMEBREW_PREFIX: /usr/local
HOMEBREW_CELLAR: /usr/local/Cellar
CPU: quad-core 64-bit ivybridge
OS X: 10.9.2-x86_64
Xcode: 5.0.2
CLT: 5.0.1.0.1.1382131676
Clang: 5.0 build 500
X11: 2.7.5 => /opt/X11
System Ruby: 1.8.7-358
Perl: /usr/bin/perl
Python: /usr/bin/python
Ruby: /usr/bin/ruby => /System/Library/Frameworks/Ruby.framework/Versions/2.0/usr/bin/ruby

Thanks.

@MikeMcQuaid
Copy link
Member

Can you try building from source outside of Homebrew and see if the same thing happens?

@oscdis
Copy link
Author

oscdis commented Mar 4, 2014

Yes, I can. and can reproduce this without Homebrew.

wget https://downloads.sourceforge.net/project/ngrep/ngrep/1.45/ngrep-1.45.tar.bz2
tar xvf ngrep-1.45.tar.bz2
cd ngrep-1.45
./configure --disable-debug --disable-dependency-tracking --with-pcap-includes=/usr/include
make
./ngrep port 80

Result:

.
.
.
gcc -g -O2 -DMACOSX -DHAVE_CONFIG_H  -D_BSD_SOURCE=1 -D__FAVOR_BSD=1  -L/usr/lib  -o ngrep ngrep.o  regex-0.12/regex.o -lpcap   
interface: en0 (192.168.0.0/255.255.255.0)
a.sh: line 6: 80342 Segmentation fault: 11  ./ngrep port 80

Also, can be avoiding this in the same option.

@MikeMcQuaid
Copy link
Member

In that case this should be reported upstream as it's not a Homebrew-specific issue.

@oscdis
Copy link
Author

oscdis commented Mar 4, 2014

I will report this to the ngrep project. Thank you.

@dch
Copy link
Contributor

dch commented May 28, 2014

can we at least have this as a work-around or caveat or something?

ngrep fails silently via sudo ngrep ... and the port is useless without it.

@newca12
Copy link

newca12 commented May 28, 2014

@dch
Copy link
Contributor

dch commented May 28, 2014

In case others find this, I sent #29665 which includes the link to jpr5/ngrep@e29fc29 that warns during ./configure if this option is not set.

@Homebrew Homebrew locked and limited conversation to collaborators Feb 17, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

5 participants