Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
dev-util/cmake-3.9.6 Fails Compile
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Portage & Programming
View previous topic :: View next topic  
Author Message
bloodfilledwater
n00b
n00b


Joined: 30 Apr 2010
Posts: 6

PostPosted: Wed Feb 07, 2018 8:05 am    Post subject: dev-util/cmake-3.9.6 Fails Compile Reply with quote

I'm trying to upgrade cmake from 3.8.2 to 3.9.6 and it fails almost instantly with "illegal instruction". It'll always fail in the same spot. revdep-rebuild shows that system is consistent and no errors. This is a VM in ESXi.

Build log - https://pastebin.com/vs7nZFfH
Emerge --info - https://pastebin.com/SkDhK3Cd
CPU info - https://pastebin.com/w1sVGeNw

dmesg shows -
[5238459.879688] traps: cmake[16916] trap invalid opcode ip:7e6842 sp:7ffc72911650 error:0 in cmake[400000+4bb000]
[5238605.658111] traps: cmake[17634] trap invalid opcode ip:7e6842 sp:7ffd80be4140 error:0 in cmake[400000+4bb000]
[5274396.496013] traps: cmake[22854] trap invalid opcode ip:7e6842 sp:7ffe77d9e2a0 error:0 in cmake[400000+4bb000]
[5281527.478213] traps: cmake[30263] trap invalid opcode ip:7e6842 sp:7ffe39d334c0 error:0 in cmake[400000+4bb000]

Compiling everything else seems to be fine that I'm aware of. This started after doing @world updates.
Back to top
View user's profile Send private message
fedeliallalinea
Administrator
Administrator


Joined: 08 Mar 2003
Posts: 31675
Location: here

PostPosted: Wed Feb 07, 2018 8:14 am    Post subject: Reply with quote

Can help this?
_________________
Questions are guaranteed in life; Answers aren't.

"Those who would give up essential liberty to purchase a little temporary safety,
deserve neither liberty nor safety."
- Ben Franklin
https://www.news.admin.ch/it/nsb?id=103968
Back to top
View user's profile Send private message
bloodfilledwater
n00b
n00b


Joined: 30 Apr 2010
Posts: 6

PostPosted: Wed Feb 07, 2018 8:18 am    Post subject: Reply with quote

I read that before posting. His issue is slightly different. His posting looks like it may have been to an issue with libnettle where as I don't have that error in dmesg.
Back to top
View user's profile Send private message
Yamakuzure
Advocate
Advocate


Joined: 21 Jun 2006
Posts: 2312
Location: Adendorf, Germany

PostPosted: Wed Feb 07, 2018 11:15 am    Post subject: Reply with quote

Quote:
trap invalid opcode
An 'opcode' is the very basic instruction the CPU executes.

For instance, the simple opcode for JMP (Jump to an adress) is 0xE9 plus relative 16/32 bit offset or 0xEB plus relative 8bit offset. (Note: There are many more JMP commands)
On x86 (32bit) there is also 0xEA for an absolute jump (16/32 bit adress), but that one is illegal on x86_64. So if the assembler inserts an 0xEA for code that is then executed on a 64bit x86 cpu, it'll generate an invalid opcode trap.

Another (and far more common!) reason for an invalid opcode could be, that extensions have been activated that your CPU does not understands. Like AMD extensions on an Intel CPU and vice versa.

Or maybe something too modern was used, like SSE4.2 when the CPU only understands SSE up to 4.1.

You could try the following:
  • run cmake. It should display a help text.
  • If it does *not* display a help text, you will most probably find another "illegal opcode" trap message in dmesg.
    => unmerge cmake then to get clean - the next try to emerge cmake should then boostrap itself first.
  • If it does display a help text, something is really really odd.
    => rename /usr/bin/cmake to /usr/bin/cmake.bak - the next try to emerge cmake should then boostrap itself first.

_________________
Edited 220,176 times by Yamakuzure
Back to top
View user's profile Send private message
bloodfilledwater
n00b
n00b


Joined: 30 Apr 2010
Posts: 6

PostPosted: Wed Feb 07, 2018 3:46 pm    Post subject: Reply with quote

Yamakuzure wrote:
Quote:
trap invalid opcode
An 'opcode' is the very basic instruction the CPU executes.

For instance, the simple opcode for JMP (Jump to an adress) is 0xE9 plus relative 16/32 bit offset or 0xEB plus relative 8bit offset. (Note: There are many more JMP commands)
On x86 (32bit) there is also 0xEA for an absolute jump (16/32 bit adress), but that one is illegal on x86_64. So if the assembler inserts an 0xEA for code that is then executed on a 64bit x86 cpu, it'll generate an invalid opcode trap.

Another (and far more common!) reason for an invalid opcode could be, that extensions have been activated that your CPU does not understands. Like AMD extensions on an Intel CPU and vice versa.

Or maybe something too modern was used, like SSE4.2 when the CPU only understands SSE up to 4.1.

You could try the following:
  • run cmake. It should display a help text.
  • If it does *not* display a help text, you will most probably find another "illegal opcode" trap message in dmesg.
    => unmerge cmake then to get clean - the next try to emerge cmake should then boostrap itself first.
  • If it does display a help text, something is really really odd.
    => rename /usr/bin/cmake to /usr/bin/cmake.bak - the next try to emerge cmake should then boostrap itself first.


If I run just "cmake" it does display the help text. I looked in dmesg and no illegal opcode. I renamed /usr/bin/cmake to cmake.bak and tried to emerge it, but still fails in the same spot. I suspect that unmerging cmake and trying to emerge would produce the same results.
Back to top
View user's profile Send private message
bloodfilledwater
n00b
n00b


Joined: 30 Apr 2010
Posts: 6

PostPosted: Fri Feb 09, 2018 5:22 am    Post subject: Reply with quote

How can I figured out what instruction it's trying to use that's creating the issue? I don't have any crazy in make.conf. The only thing in there that's specified is sse and sse2 both of which my processor supports.
Back to top
View user's profile Send private message
Yamakuzure
Advocate
Advocate


Joined: 21 Jun 2006
Posts: 2312
Location: Adendorf, Germany

PostPosted: Fri Feb 09, 2018 11:11 am    Post subject: Reply with quote

bloodfilledwater wrote:
If I run just "cmake" it does display the help text. I looked in dmesg and no illegal opcode. I renamed /usr/bin/cmake to cmake.bak and tried to emerge it, but still fails in the same spot. I suspect that unmerging cmake and trying to emerge would produce the same results.
Yes, unmerging cmake will help nothing. cmake uses itself to configure itself. (Means: If you do not have cmake installed, trying to configure it will first bootstrap a rudimentary cmake that is then used for the configuration.)
That's why I thought cmake itself would always cause the illegal opcode trap, but that isn't the case here.

Which means that this is really curious, as your build log states:
Code:
/var/tmp/portage/dev-util/cmake-3.9.6/temp/environment: line 723: 30263 Illegal instruction     "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}"
And that means, that cmake caused the error istself.

The line that got expanded from these value is above in your build log: (I have added the line breaks by hand for better readability)
Code:
cmake -C /var/tmp/portage/dev-util/cmake-3.9.6/work/cmake-3.9.6_build/gentoo_common_config.cmake
      -G Unix Makefiles
      -DCMAKE_INSTALL_PREFIX=/usr
      -DCMAKE_USE_SYSTEM_LIBRARIES=ON
      -DCMAKE_USE_SYSTEM_LIBRARY_JSONCPP=no
      -DCMAKE_INSTALL_PREFIX=/usr
      -DCMAKE_DOC_DIR=/share/doc/cmake-3.9.6
      -DCMAKE_MAN_DIR=/share/man
      -DCMAKE_DATA_DIR=/share/cmake
      -DSPHINX_MAN=no
      -DSPHINX_HTML=no
      -DBUILD_CursesDialog=yes
      -DCMake_ENABLE_SERVER_MODE=no
      -DCMAKE_USE_LIBUV=no
      -DCMAKE_BUILD_TYPE=Gentoo
      -DCMAKE_USER_MAKE_RULES_OVERRIDE=/var/tmp/portage/dev-util/cmake-3.9.6/work/cmake-3.9.6_build/gentoo_rules.cmake
      -DCMAKE_TOOLCHAIN_FILE=/var/tmp/portage/dev-util/cmake-3.9.6/work/cmake-3.9.6_build/gentoo_toolchain.cmake 
      /var/tmp/portage/dev-util/cmake-3.9.6/work/cmake-3.9.6
That looks pretty basic and in order to me.

What happens if you call this command (the one-liner from your build log) after the merge failed?
_________________
Edited 220,176 times by Yamakuzure
Back to top
View user's profile Send private message
Yamakuzure
Advocate
Advocate


Joined: 21 Jun 2006
Posts: 2312
Location: Adendorf, Germany

PostPosted: Fri Feb 09, 2018 11:31 am    Post subject: Reply with quote

Hmm.. Your CPU info says:
Intel Xeon 5130
Family 6, Model 15, Stepping 6

The Intel Xeon 5130 was released in 2006. Can this be right?

However, according to cpu-world.com that CPU supports MMX, SSE, SSE2, SSE3 and SSSE3.

So there is nothing curious in your emerge --info output at all. :?

Edith just had an idea: If cmake itself causes this error, but not when presenting a help text, it may just be a defect in the file. Unmerging cmake and then emerging it anew might then indeed do the trick!

[Moderator edit: fixed [url] tag. Forum linking does not work when the URL contains parentheses. -Hu]
_________________
Edited 220,176 times by Yamakuzure
Back to top
View user's profile Send private message
bloodfilledwater
n00b
n00b


Joined: 30 Apr 2010
Posts: 6

PostPosted: Sat Feb 10, 2018 6:35 am    Post subject: Reply with quote

Quote:
Hmm.. Your CPU info says:
Intel Xeon 5130
Family 6, Model 15, Stepping 6

The Intel Xeon 5130 was released in 2006. Can this be right?

However, according to cpu-world.com that CPU supports MMX, SSE, SSE2, SSE3 and SSSE3.

So there is nothing curious in your emerge --info output at all. :?

Edith just had an idea: If cmake itself causes this error, but not when presenting a help text, it may just be a defect in the file. Unmerging cmake and then emerging it anew might then indeed do the trick!


Yeah, I'm using some repurposed Dell PowerEdge 1950's and 2950's. I have several Gentoo VMs on them. I know it's old. ;)

The output just gave an error saying that it was unable to find "unix"? I didn't copy the exact error. However, unmerging and emerging cmake seems to have fixed it. It's compiling now it seems. Interesting.... I appreciate your help.
Back to top
View user's profile Send private message
Yamakuzure
Advocate
Advocate


Joined: 21 Jun 2006
Posts: 2312
Location: Adendorf, Germany

PostPosted: Mon Feb 12, 2018 11:30 am    Post subject: Reply with quote

bloodfilledwater wrote:
unmerging and emerging cmake seems to have fixed it
Wow. So in the end, it was "just" Bitrot... :?
_________________
Edited 220,176 times by Yamakuzure
Back to top
View user's profile Send private message
Jaglover
Watchman
Watchman


Joined: 29 May 2005
Posts: 8291
Location: Saint Amant, Acadiana

PostPosted: Mon Feb 12, 2018 11:42 am    Post subject: Reply with quote

Dare to run 'qcheck -B'?
_________________
My Gentoo installation notes.
Please learn how to denote units correctly!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Portage & Programming All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum