Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
CMake stack smashing termination on builds
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM
View previous topic :: View next topic  
Author Message
melts
n00b
n00b


Joined: 21 Feb 2004
Posts: 53

PostPosted: Sat Apr 02, 2022 5:55 am    Post subject: CMake stack smashing termination on builds Reply with quote

Hi

As the title suggests I'm seeing the stack smashing protections kicking in when I use cmake, at least sometimes. I don't know how often cmake is called in builds.
I've spent a little bit of time trying to debug this but its a bit beyond me. The system was built a bit over a week ago following the raspberry pi build instructions, I used stage3-arm64-openrc-20220320T232720Z.tar.xz

After getting distcc working I moved onto emerging system tools and then tried nodejs - this is where the brotli-1.0.9-r3 package first had the issue. I was able to emerge gdb and take a look, initially attempted to rebuild cmake after finding that generated the core file, this had the same error with cmake stack smashing.
Focused on that core dump and saw /lib64/libc.so.6 involved and used gentoolkit to confirm its in glibc so remerged like so - emerge -va1 =sys-libs/glibc-2.33-r13
That merged fine but obviously didn't fix the issue as really it was just the tools protecting the system as I later realised.
I've tried merging cmake with and without distcc enabled to no avail - though it's failing in the config stage that the pi does unless I'm totally mistaken.

Here's a quick copy of what I'm seeing (for future internet searchers)

Code:
-- <<< Gentoo configuration >>>
Build type      RelWithDebInfo
Install path    /usr
Compiler flags:
C               -march=armv8-a+crc -mtune=cortex-a53 -O2 -pipe -no-pie -ggdb3
C++             -march=armv8-a+crc -mtune=cortex-a53 -O2 -pipe -no-pie -ggdb3
Linker flags:
Executable      -Wl,-O1 -Wl,--as-needed
Module          -Wl,-O1 -Wl,--as-needed
Shared          -Wl,-O1 -Wl,--as-needed

*** stack smashing detected ***: terminated
/var/tmp/portage/dev-util/cmake-3.22.2/temp/environment: line 847:    65 Aborted                 (core dumped) "${CMAKE_BINARY}" "${cmakeargs[@]}" "${CMAKE_USE_DIR}"


Here's links for pastebin files of what I think is needed
dmesg - https://dpaste.com//98W4WGXZC
emerge --info - https://dpaste.com//BLHE4GYUG
cmake build.log - http://dpaste.com//7F87AYJYT

output of gdb --core core (from the build dir)
Code:
Core was generated by `cmake -C /var/tmp/portage/dev-util/cmake-3.22.2/work/cmake-3.22.2_build/gentoo_'.
Program terminated with signal SIGABRT, Aborted.


output of gdb /usr/bin/cmake --core core
Code:
Reading symbols from /usr/bin/cmake...
(No debugging symbols found in /usr/bin/cmake)
[New LWP 65]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Core was generated by `cmake -C /var/tmp/portage/dev-util/cmake-3.22.2/work/cmake-3.22.2_build/gentoo_'.
Program terminated with signal SIGABRT, Aborted.
#0  0x0000007f90e325f8 in raise () from /lib64/libc.so.6
(gdb) bt
#0  0x0000007f90e325f8 in raise () from /lib64/libc.so.6
#1  0x0000007f90e1ef0c in abort () from /lib64/libc.so.6
#2  0x0000007f90e6bb90 in ?? () from /lib64/libc.so.6
#3  0x0000007f90edda68 in __fortify_fail () from /lib64/libc.so.6
#4  0x0000007f90edda34 in __stack_chk_fail () from /lib64/libc.so.6
#5  0x000000555e6490d0 in ?? ()
#6  0x000000555e861f0c in ?? ()
#7  0x000000555e86d5c8 in ?? ()
#8  0x000000555e604c90 in ?? ()
#9  0x000000555e606694 in ?? ()
#10 0x000000555e611358 in ?? ()
#11 0x000000555e504844 in ?? ()
#12 0x000000555e4ee5d0 in ?? ()
#13 0x0000007f90e1f214 in __libc_start_main () from /lib64/libc.so.6
#14 0x000000555e4feef8 in ?? ()
(gdb)


I can't rebuild cmake to include the symbols so I don't quite know what to do now, if anyone has advice that'd be most welcome

thanks

Michael
_________________
=== === === === === ===
doh
=== === === === === ===
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Gentoo on ARM 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