Wireshark-dev: Re: [Wireshark-dev] compilation hangs on Ubuntu

From: Eugène Adell <eugene.adell@xxxxxxxxx>
Date: Mon, 14 May 2018 19:58:24 +0200

Thanks all for the help and Darius for finding out this conflict with ninja. Building with an ordinary user works.


By the way, I have another small request. Could you please change the AUTHORS file to keep my personal address (my email at D2-SI didn't survive after I left, and I contributed twice, the first time with D2-SI and later under my personal address). Thanks.

kind regards
Eugène




2018-05-14 17:11 GMT+02:00 Darius Davis <darius@xxxxxxxxxx>:

Hi Eugène,

 

The strace log shows that your Ubuntu 16.04 system has the "ninja" package installed, which is "a privilege escalation detection and prevention system for GNU/Linux hosts" (https://packages.ubuntu.com/xenial/admin/ninja).  It installs into /usr/sbin/ninja.  Your build problem is caused by the presence of that "ninja" package on your system -- and the fact that you appear to be building wireshark as "root".

 

While running as "root", your PATH contains /usr/sbin, and that entry appears before /usr/bin, so instead of cmake launching the ninja build tool (/usr/bin/ninja), it launches the ninja privilege escalation detection tool (/usr/sbin/ninja), which busily monitors your /proc directory for evidence of system intrusion... but does not build Wireshark.

 

1900  access("/usr/sbin/ninja", R_OK)   = 0

1900  stat("/usr/sbin/ninja", {st_mode=S_IFREG|0755, st_size=22872, ...}) = 0

[...]

1901  execve("/usr/sbin/ninja", ["/usr/sbin/ninja", "--version"], [/* 22 vars */] <unfinished ...>

 

You should be able to resolve the issue by building Wireshark as a non-root user -- I don't think there is any need or reason to build as "root".  As a regular user, your PATH should not contain /usr/sbin, and the ninja intrusion-detection program will be ignored.  cmake should then find and launch the ninja build tool correctly.

 

If you are not going to use the "ninja" privilege escalation detection program (for example, if it was installed by accident while you were looking for the "ninja-build" package), you can uninstall it by running "sudo apt-get remove ninja", and that would resolve the build problem too.  (Regardless, I would really advise not building as "root" unless you have a very good reason to do so!)

 

Cheers,

--

Darius

 

From: Wireshark-dev <wireshark-dev-bounces@wireshark.org> on behalf of Eugène Adell <eugene.adell@xxxxxxxxx>
Reply-To: Developer support list for Wireshark <wireshark-dev@xxxxxxxxxxxxx>
Date: Tuesday, 15 May 2018 at 12:25 am
To: Developer support list for Wireshark <wireshark-dev@xxxxxxxxxxxxx>
Subject: Re: [Wireshark-dev] compilation hangs on Ubuntu

 

It doesn't hang, it returns :

2;7;12

As requested, the strace is attached.



 

2018-05-13 22:29 GMT+02:00 Jakub Zawadzki <darkjames-ws@xxxxxxxxxxxx>:

Hello,

W dniu 2018-05-13 17:15, Eugène Adell napisał(a):

I'm facing a problem on my development server (Ubuntu 16.04 hosted on
VMWARE) when trying to compile Wireshark. It was working with older
versions (2.0 for example), but now it's like the compilation will never
end.
I installed/updated all the required packages, since version 2.6 seems
quite different.

I'm doing an strace -f -o to find out what could be wrong, but no clue. The
strace log being too big, here is how it looks like :

1900  execve("/usr/bin/cmake", ["cmake", "-LH", "../wireshark"], [/*
22 vars */]) = 0
[cut]



thousands of lines such as :

1901  open("/proc/537/status", O_RDONLY) = -1 ENOENT (No such file or directory)
1901  open("/proc/538/status", O_RDONLY) = -1 ENOENT (No such file or directory)
1901  open("/proc/539/status", O_RDONLY) = -1 ENOENT (No such file or directory)
1901  open("/proc/540/status", O_RDONLY) = -1 ENOENT (No such file or directory)
1901  open("/proc/541/status", O_RDONLY) = -1 ENOENT (No such file or directory)
1901  open("/proc/542/status", O_RDONLY) = -1 ENOENT (No such file or directory)
1901  open("/proc/543/status", O_RDONLY) = -1 ENOENT (No such file or directory)
1901  open("/proc/544/status", O_RDONLY) = -1 ENOENT (No such file or directory)


then thousands and thousands of lines such as the following, and it seems
it will never end :

1901  open("/proc/882/status", O_RDONLY) = 3
1901  fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
1901  read(3, "Name:\tvmhgfs-fuse\nUmask:\t0000\nSt"..., 1024) = 1024
1901  read(3, "0000,00000000,00000000,00000000,"..., 1024) = 263
1901  read(3, "", 1024)                 = 0
1901  close(3)                          = 0
1901  open("/proc/965/status", O_RDONLY) = 3
1901  fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
1901  read(3, "Name:\tsystemd-logind\nUmask:\t0022"..., 1024) = 1024
1901  read(3, "0000000,00000000,00000000,000000"..., 1024) = 269
1901  read(3, "", 1024)                 = 0
1901  close(3)                          = 0
1901  open("/proc/968/status", O_RDONLY) = 3
1901  fstat(3, {st_mode=S_IFREG|0444, st_size=0, ...}) = 0
1901  read(3, "Name:\tdbus-daemon\nUmask:\t0022\nSt"..., 1024) = 1024
1901  read(3, "00,00000000,00000000,00000000,00"..., 1024) = 283
1901  read(3, "", 1024)                 = 0
1901  close(3)                          = 0


How can I resolve this ?


Not sure, but it seems that first subprocess (1901 == 1900 + 1) makes some strange things.

Looking on my strace output of cmake -LH ../wireshark:

6410  execve("/usr/bin/cmake", ["cmake", "-LH", "../wireshark/"], 0x7ffe72092520 /* 32 vars */) = 0
(..)
6410  clone(child_stack=NULL, flags=CLONE_CHILD_CLEARTID|CLONE_CHILD_SETTID|SIGCHLD, child_tidptr=0x7f7cde41ba50) = 6411
6411  execve("/usr/bin/python", ["/usr/bin/python", "-c", "import sys; sys.stdout.write(';'.join([str(x) for x in sys.version_info[:3]]))"], 0x7ffc7adb4958 /* 32 vars */) = 0

first execve() is /usr/bin/python -c "import sys; sys.stdout.write(';'.join([str(x) for x in sys.version_info[:3]]))"

Is it same for you? If you run from same shell:
  /usr/bin/python -c "import sys; sys.stdout.write(';'.join([str(x) for x in sys.version_info[:3]]))"

does it hang?

Could you please attach gzip compressed strace log?


Kind Regards,
Jakub.


___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <
wireshark-dev@xxxxxxxxxxxxx>
Archives:   
https://www.wireshark.org/lists/wireshark-dev
Unsubscribe:
https://www.wireshark.org/mailman/options/wireshark-dev
            mailto:
wireshark-dev-request@wireshark.org?subject=unsubscribe

 


___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    https://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://www.wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request@wireshark.org?subject=unsubscribe