You are not logged in.

#1 2018-06-19 17:11:26

JonnyJD
Member
From: Berlin
Registered: 2007-11-05
Posts: 50

[solved] cmake hangs on select() call (hardening-wrapper..)

After a huge system upgrade (haven't done updates for months) I can't run cmake anymore.

Example:

git clone https://github.com/metabrainz/libdiscid.git
cd libdiscid
cmake .

And this hangs forever. (no output)

Running

strace cmake .

I can see it hangs here:

select(9, [4 6 8], NULL, NULL, NULL)    = 1 (in [8])
read(8, "", 1024)                       = 0
close(8)                                = 0
select(7, [4 6], NULL, NULL, NULL

running

gdb --args cmake .

then

run

then STRG+C and

bt

yields this:

#0  0x00007ffff6386197 in select () from /usr/lib/libc.so.6
#1  0x0000555555985814 in cmsysProcess_WaitForData ()
#2  0x00005555557763b9 in cmExecuteProcessCommand::InitialPass(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, cmExecutionStatus&) ()
#3  0x000055555575879d in cmCommand::InvokeInitialPass(std::vector<cmListFileArgument, std::allocator<cmListFileArgument> > const&, cmExecutionStatus&) ()
#4  0x00005555556d351f in cmMakefile::ExecuteCommand(cmListFileFunction const&, cmExecutionStatus&) ()
#5  0x00005555557b01b1 in cmIfFunctionBlocker::IsFunctionBlocked(cmListFileFunction const&, cmMakefile&, cmExecutionStatus&) ()
#6  0x00005555556cad47 in cmMakefile::IsFunctionBlocked(cmListFileFunction const&, cmExecutionStatus&) ()
#7  0x00005555556d32a2 in cmMakefile::ExecuteCommand(cmListFileFunction const&, cmExecutionStatus&) ()
#8  0x00005555557a88a9 in cmFunctionHelperCommand::InvokeInitialPass(std::vector<cmListFileArgument, std::allocator<cmListFileArgument> > const&, cmExecutionStatus&) ()
#9  0x00005555556d351f in cmMakefile::ExecuteCommand(cmListFileFunction const&, cmExecutionStatus&) ()
#10 0x00005555557a6c39 in cmForEachFunctionBlocker::IsFunctionBlocked(cmListFileFunction const&, cmMakefile&, cmExecutionStatus&) ()
#11 0x00005555556cad47 in cmMakefile::IsFunctionBlocked(cmListFileFunction const&, cmExecutionStatus&) ()
#12 0x00005555556d32a2 in cmMakefile::ExecuteCommand(cmListFileFunction const&, cmExecutionStatus&) ()
#13 0x00005555557a6c39 in cmForEachFunctionBlocker::IsFunctionBlocked(cmListFileFunction const&, cmMakefile&, cmExecutionStatus&) ()
#14 0x00005555556cad47 in cmMakefile::IsFunctionBlocked(cmListFileFunction const&, cmExecutionStatus&) ()
#15 0x00005555556d32a2 in cmMakefile::ExecuteCommand(cmListFileFunction const&, cmExecutionStatus&) ()
#16 0x00005555557a88a9 in cmFunctionHelperCommand::InvokeInitialPass(std::vector<cmListFileArgument, std::allocator<cmListFileArgument> > const&, cmExecutionStatus&) ()
#17 0x00005555556d351f in cmMakefile::ExecuteCommand(cmListFileFunction const&, cmExecutionStatus&) ()
#18 0x00005555557b01b1 in cmIfFunctionBlocker::IsFunctionBlocked(cmListFileFunction const&, cmMakefile&, cmExecutionStatus&) ()
#19 0x00005555556cad47 in cmMakefile::IsFunctionBlocked(cmListFileFunction const&, cmExecutionStatus&) ()
#20 0x00005555556d32a2 in cmMakefile::ExecuteCommand(cmListFileFunction const&, cmExecutionStatus&) ()
#21 0x00005555556d6755 in cmMakefile::ReadListFile(cmListFile const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
#22 0x00005555556d6c9e in cmMakefile::ReadListFile(char const*) ()
#23 0x00005555558c8cb2 in cmGlobalGenerator::EnableLanguage(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, cmMakefile*, bool) ()
#24 0x00005555558dbc64 in cmGlobalUnixMakefileGenerator3::EnableLanguage(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, cmMakefile*, bool) ()
#25 0x00005555556d8e55 in cmMakefile::EnableLanguage(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, bool) ()
#26 0x00005555557df1f5 in cmProjectCommand::InitialPass(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, cmExecutionStatus&) ()
#27 0x000055555575879d in cmCommand::InvokeInitialPass(std::vector<cmListFileArgument, std::allocator<cmListFileArgument> > const&, cmExecutionStatus&) ()
#28 0x00005555556d351f in cmMakefile::ExecuteCommand(cmListFileFunction const&, cmExecutionStatus&) ()
#29 0x00005555556d6755 in cmMakefile::ReadListFile(cmListFile const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&) ()
#30 0x00005555556dc6e2 in cmMakefile::Configure() ()
#31 0x00005555558ce84e in cmGlobalGenerator::Configure() ()
#32 0x00005555558dbd37 in cmGlobalUnixMakefileGenerator3::Configure() ()
#33 0x000055555574f445 in cmake::ActualConfigure() ()
#34 0x0000555555750837 in cmake::Configure() ()
#35 0x0000555555754ea3 in cmake::Run(std::vector<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::allocator<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > const&, bool) ()
#36 0x00005555556922f9 in do_cmake(int, char const* const*) ()
#37 0x0000555555689552 in main ()

So this seems to be related to https://gitlab.kitware.com/cmake/cmake/issues/15873
However, adding this to PKGBUILD (refering to https://gitlab.kitware.com/utils/kwsys/ … quests/43)

CFLAGS="$CFLAGS -DKWSYSPE_USE_SELECT=0"

changes things, but doesn't seem to help.
I now have this (re-occorung) with strace:

nanosleep({tv_sec=0, tv_nsec=100000000}, NULL) = 0
read(6, 0x55b8552aa058, 1024)           = -1 EAGAIN (Resource temporarily unavailable)
read(4, 0x55b8552aa058, 1024)           = -1 EAGAIN (Resource temporarily unavailable)
nanosleep({tv_sec=0, tv_nsec=100000000}, ^CNULL) = ? ERESTART_RESTARTBLOCK (Interrupted by signal)

and this with gdb:

#0  0x00007ffff635b884 in nanosleep () from /usr/lib/libc.so.6
#1  0x00007ffff6386a04 in usleep () from /usr/lib/libc.so.6
#2  0x0000555555997ecb in kwsysProcessWaitForPipe (wd=<optimized out>, length=<optimized out>, 
    data=<optimized out>, cp=<optimized out>)

I haven't yet tried it on another up-to-date machine.
Does anybody have similar issues or knows what I should try or check?

Last edited by JonnyJD (2018-06-19 17:55:32)

Offline

#2 2018-06-19 17:38:02

JonnyJD
Member
From: Berlin
Registered: 2007-11-05
Posts: 50

Re: [solved] cmake hangs on select() call (hardening-wrapper..)

Okay, I am a step forward into finding out what happens, but still puzzled as to who/what is to blame:

The process running is a cc process, that seems to get an infinite amout of arguments:

jonnyjd   7950  7949 99 19:35 pts/0    00:00:17 /bin/bash /usr/lib/hardening-wrapper/bin/cc -B/usr/lib/hardening-wrapper/bin -pie -fstack-check -fstack-protector-strong -B/usr/lib/hardening-wrapper/bin -pie -fstack-check -fstack-protector-strong -B/usr/lib/hardening-wrapper/bin -pie -fstack-check -fstack-protector-strong -B/usr/lib/hardening-wrapper/bin -pie -fstack-check -fstack-protector-strong -B/usr/lib/hardening-wrapper/bin -pie -fstack-check -fstack-protector-strong -B/usr/lib/hardening-wrapper/bin -pie -fstack-check -fstack-protector-strong -B/usr/lib/hardening-wrapper/bin -pie -fstack-check -fstack-protector-strong -B/usr/lib/hardening-wrapper/bin -pie -fstack-check -fstack-protector-strong -B/usr/lib/hardening-wrapper/bin -pie -fstack-check -fstack-protector-strong -B/usr/lib/hardening-wrapper/bin -pie -fstack-check -fstack-protector-strong -B/usr/lib/hardening-wrapper/bin -pie -fstack-check -fstack-protector-strong -B/usr/lib/hardening-wrapper/bin -pie -fstack-check -fstack-protector-strong -B/usr/lib/hardening-wrapper/bin -pie -fstack-check -fstack-protector-strong -B/usr/lib/hardening-wrapper/bin -pie -fstack-check -fstack-protector-strong -B/usr/lib/hardening-wrapper/bin -pie -fstack-check -fstack-protector-strong -B/usr/lib/hardening-wrapper/bin -pie -fstack-check -fstack-protector-strong -B/usr/lib/hardening-wrapper/bin -pie -fstack-check -fstack-protector-strong -B/usr/lib/hardening-wrapper/bin -pie -fstack-check -fstack-protector-strong -B/usr/lib/hardening-wrapper/bin -pie -fstack-check -fstack-protector-strong -B/usr/lib/hardening-wrapper/bin -pie -fstack-check -fstack-protector-strong -B/usr/lib/hardening-wrapper/bin -pie -fstack-check -fstack-protector-strong -B/usr/lib/hardening-wrapper/bin -pie -fstack-check -fstack-protector-strong -B/usr/lib/hardening-wrapper/bin -pie -fstack-check -fstack-protector-strong -B/usr/lib/hardening-wrapper/bin -pie -fstack-check -fstack-protector-strong -B/usr/lib/hardening-wrapper/bin -pie -fstack-check -fstack-protector-strong -B/usr/lib/hardening-wrapper/bin -pie -fstack-check -fstack-protector-strong -B/usr/lib/hardening-wrapper/bin -pie -fstack-check -fstack-protector-strong -B/usr/lib/hardening-wrapper/bin -pie -fstack-check -fstack-protector-strong -B/usr/lib/hardening-wrapper/bin -pie -fstack-check -fstack-protector-strong -B/usr/lib/hardening-wrapper/bin -pie -fstack-check -fstack-protector-strong -B/usr/lib/hardening-wrapper/bin -pie -fstack-check -fstack-protector-strong -B/usr/lib/hardening-wrapper/bin -pie -fstack-check -fstack-protector-strong -B/usr/lib/hardening-wrapper/bin -pie -fstack-check -fstack-protector-strong -B/usr/lib/hardening-wrapper/bin -pie -fstack-check -fstack-protector-strong -B/usr/lib/hardening-wrapper/bin -pie -fstack-check
...

This is running the official cmake package, not my built version.
And I am not running makepkg, but plain cmake.

Offline

#3 2018-06-19 17:54:54

JonnyJD
Member
From: Berlin
Registered: 2007-11-05
Posts: 50

Re: [solved] cmake hangs on select() call (hardening-wrapper..)

A search for hardening-wrapper yields that it is broken/defunct and it should be uninstalled:

pacman -Rs hardening-wrapper

and removing all CMakeFiles/ and CMakeCache.txt fixes it for me.

That took me quite long (I created the topic only after gathering some insights).
Did I miss an official announcement that hardening-wrapper should be removed?

Offline

#4 2018-06-20 11:59:57

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,925

Re: [solved] cmake hangs on select() call (hardening-wrapper..)

I don't remember if there official announcement, but https://www.archlinux.org/todo/hardenin … r-removal/ should give some idea why it was removed.

Running pacman -Qm and pacman -Qdt regularly would have alerted you to the removal.
I advise you to ruin them asap, there may be more changes you missed.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#5 2018-06-20 19:31:36

JonnyJD
Member
From: Berlin
Registered: 2007-11-05
Posts: 50

Re: [solved] cmake hangs on select() call (hardening-wrapper..)

Lone_Wolf wrote:

Running pacman -Qm and pacman -Qdt regularly would have alerted you to the removal.

Well, when all but a few of my packages would have been installed via pacman or this would be somewhat of a "new" install, this would help a lot.
This system is really old (it is my private system and in use (without re-install) since 10 years or so) and I installed lots of (AUR) packages (not always managing dependencies with --asdeps back then).

So pacman -Qm gives 265 results, -Qdt 281 results.
While I should work on reducing these lists somewhen, I simply don't have the time now and won't change a "running system" just because.

So for me it would make a huge difference if actual problems with packages were announced, rather then dropped "silently".

Offline

#6 2018-06-21 13:44:18

Lone_Wolf
Forum Moderator
From: Netherlands, Europe
Registered: 2005-10-04
Posts: 11,925

Re: [solved] cmake hangs on select() call (hardening-wrapper..)

Many packages had problems when built with hardening-wrapper, arch devs used it only for a small amount (around 10 iirc) .
All those packages had a hard dependency on hardening-wrapper and were updated.

It seems you had it installed as default instead of only during buildtime.


The system i'm writing this on has this as first entry in pacman.log :

2009-09-14 18:45] installed filesystem (2009.07-1)

I had 100+ foreign packages and orphaned dependencies in 2011/2012 and had to spend many hours to solve it.

Since then 99% of the aur packages i use (there are a few that i want to see listed by -Qm so i don't forget they should be replaced sometimeI go into my own local repo and are managed through pacman.
I also run pacman -Qm / pacman Qdt atleast once a month.


Disliking systemd intensely, but not satisfied with alternatives so focusing on taming systemd.


(A works at time B)  && (time C > time B ) ≠  (A works at time C)

Offline

#7 2018-06-21 23:07:36

JonnyJD
Member
From: Berlin
Registered: 2007-11-05
Posts: 50

Re: [solved] cmake hangs on select() call (hardening-wrapper..)

Lone_Wolf wrote:

It seems you had it installed as default instead of only during buildtime.

I usually add dependencies manually (with --asdeps when I don't forget..) since half of them are not in the repos anyways (in my case) and re-building is much faster when the deps are still there,
but yes --syncdeps --rmdeps could help otherwise. I even gave the account building the packages some sudo pacman access a couple of years ago.
(I usually don't bother with extra-x86_64-build because it adds overhead)

Looks like your system is older, according to my pacman log:

[2009-11-06 22:20] installed filesystem (2009.07-1)

There are a couple of things I would do differently when setting the system up again, but some I couldn't have known back then.

Lone_Wolf wrote:

Since then 99% of the aur packages i use ... go into my own local repo and are managed through pacman.

Not a bad move in that regard. When I do have time, I would probably just try to build a list of package files laying around in my build folders so I can hide them from the list.
When I do have the time. Since I am rarely at my personal machine or even at home for extended periods of time, that won't happen soon though.
There are also more important tasks.

Offline

Board footer

Powered by FluxBB