"stack smashing detected" when make check of glibc
Hello there,
I followed instructions in LFS 11.3 and everything worked until "stack smashing detected" reported when doing make check in 8.5. I tried a second time after rming & restoring backup made in 7.13 and failed with the same error. Code:
make[4]: Entering directory '/sources/glibc-2.37/string' The libc etc on partly build lfs: Code:
root@slacktest:~# ls $LFS/usr/lib/libc* -l ********** Correction: "make test" in both title and the post should be "make install", I just recall it a moment ago and sorry for the confusion. ********** |
Wow, it's been a while since I used stacks.
Stacks are ram spaces internal to the cpu. Let's stick with 1 process, 1 core, & no OS just for the purposes of explaining. There are 2 stack assembler instructions
With multicore cpus running hundreds of processes and an OS jumping in, it's vastly more complicated. Stack protection is implemented, and your own kernel probably has raised a red flag, and killed the compile. That's what it looks like. Start over. New archive, new compile, check the checksum on the download, reapply the patches (if any) and see if it happens the second time. What's your host OS? Some are not suitable. |
Thank you business_kid for the reply.
My host: Code:
root@slacktest14:~# uname -a While looking for clues, I found there is livecd version of lfs and can service as a known good host to build things and therefore may act as plan B for me I think. Anyway I will get back. Enjoy the day! |
Gcc-5.x is seriously old. If you're building antique software, you know what you're doing. Older stuff often has exploitable holes.
My slackware64-15.0 has gcc-11.2.0, glibc-2.33 & LTS kernel 5.15.63( originally 5.15.19). I installed ~Current on my Raspberry Pi last night. That has gcc-13.2.0, glibc-2.37 & kernel-6.4.8. I'd use a modern system to install modern stuff with. You're running kernel-3.2.29, & gcc-4.9. Be serious. That's your problem! You're also going to run into countless 'undefined reference' errors and bizarre errors from ancient headers. In short, install a much newer system before you compile anything. |
Hi business_kid,
Thanks for the input, I'd say my system is much old and I'm considering an upgrade and in fact this building lfs is part of the effort and till now it has not been much progress. The 5.1 gcc and 3.2 kernel is as what required in LFS book 11.3, which is the highest version I had read about, the livecd thing is much older so I'd stick with 11.3 and see where it goes. Have a good day. ============= There actually is LFS 12.0 with much higher os &libs, but since 11.3 is what I have system most close to and all the packages, I may just don't switch, and besides it is just one version higher. |
Errors occured during make in 5.3 (GCC12.2.0 pass 1)
Code:
g++ -std=gnu++11 -fno-PIE -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include -I../../gcc/../libcpp/include -I../../gcc/../libcody -I/mnt/lfs/sources/gcc-12.2.0/build/./gmp -I/mnt/lfs/sources/gcc-12.2.0/gmp -I/mnt/lfs/sources/gcc-12.2.0/build/./mpfr/src -I/mnt/lfs/sources/gcc-12.2.0/mpfr/src -I/mnt/lfs/sources/gcc-12.2.0/mpc/src -I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/bid -I../libdecnumber -I../../gcc/../libbacktrace -o i386.o -MT i386.o -MMD -MP -MF ./.deps/i386.TPo ../../gcc/config/i386/i386.cc Then make abort: Code:
../../gcc/config/i386/i386.cc:313:1: error: narrowing conversion of '4294967295u' from 'unsigned int' to 'int' inside { } Code:
g++ -std=gnu++11 -fno-PIE -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include -I../../gcc/../libcpp/include -I../../gcc/../libcody -I/mnt/lfs/sources/gcc-12.2.0/build/./gmp -I/mnt/lfs/sources/gcc-12.2.0/gmp -I/mnt/lfs/sources/gcc-12.2.0/build/./mpfr/src -I/mnt/lfs/sources/gcc-12.2.0/mpfr/src -I/mnt/lfs/sources/gcc-12.2.0/mpc/src -I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/bid -I../libdecnumber -I../../gcc/../libbacktrace -o tree-diagnostic-path.o -MT tree-diagnostic-path.o -MMD -MP -MF ./.deps/tree-diagnostic-path.TPo ../../gcc/tree-diagnostic-path.cc Code:
g++ -std=gnu++11 -fno-PIE -c -g -O2 -DIN_GCC -DCROSS_DIRECTORY_STRUCTURE -fno-exceptions -fno-rtti -fasynchronous-unwind-tables -W -Wall -Wno-narrowing -Wwrite-strings -Wcast-qual -Wmissing-format-attribute -Woverloaded-virtual -pedantic -Wno-long-long -Wno-variadic-macros -Wno-overlength-strings -DHAVE_CONFIG_H -I. -I. -I../../gcc -I../../gcc/. -I../../gcc/../include -I../../gcc/../libcpp/include -I../../gcc/../libcody -I/mnt/lfs/sources/gcc-12.2.0/build/./gmp -I/mnt/lfs/sources/gcc-12.2.0/gmp -I/mnt/lfs/sources/gcc-12.2.0/build/./mpfr/src -I/mnt/lfs/sources/gcc-12.2.0/mpfr/src -I/mnt/lfs/sources/gcc-12.2.0/mpc/src -I../../gcc/../libdecnumber -I../../gcc/../libdecnumber/bid -I../libdecnumber -I../../gcc/../libbacktrace -o tree-vect-data-refs.o -MT tree-vect-data-refs.o -MMD -MP -MF ./.deps/tree-vect-data-refs.TPo ../../gcc/tree-vect-data-refs.cc Code:
lfs:~$ bash version-check.sh |
Quote:
|
Quote:
GCC5.1 and 3.2 kernel https://www.linuxfromscratch.org/lfs.../hostreqs.htmlis the minimum requirement of the host, and I think things should go well if that are met. |
Update follow #6
After upgrade gcc from 5.1 to 5.2 on host and start all over again, it worked until errored in 8.5 make install, with seemingly the same error as #1 "stack smashing detected": Code:
make subdir=stdio-common -C ../stdio-common ..=../ objdir=/sources/glibc-2.37/build -f Makefile -f ../elf/rtld-Rules rtld-all rtld-modules='rtld-errname.os' Any suggestion is greatly welcome. |
Just a note in passing. Gcc-5.1.x and kernel-3.x are very old by modern standards. Glibc-2.37 and gcc-12.2.x are quite new. It's best for LFS to have programs of the same vintage compiling together. You apparently have a fairly old system doing the work. Is that a Red Hat system? RH, Centos, Fedora, Scientific Linux, etc.
None of those make good bases for LFS. I tried. The second pass of gcc in chapter 6 has tests that fairly well have to pass. They didn't, and I went down in flames. I had to throw that work away. It's better to save you pain now if you're on that road. |
By the time you get to chapter 8, you should be using your own tools exclusively. That includes the final version of gcc-13.2.0 built in chapter 6.18. So now I'm as puzzled as you are.
LFS doesn't support the live cd any more and no later versions have been produced. I'm surprised that an old one still worked for you. But you need to understand that the build process of the latest versions is completely different logically from the older method in which all the tools were built in the tools directory. Nowadays most of the toolchain is installed directly onto the new partition and then overwritten by the final versions. |
Quote:
|
Quote:
Yes, Gcc 5.1 and kernel 3.2 are fairly old but they are on the sw/os version list supported by lfs 11.3 so I take that it should work with these versions though the progress so far didn't. I have projects at workplace that use gcc 4.9, glibc 2.17(19?), Qt5.x etc , so I need to upgrade to a system with these old versions of apps that is why I can't just go straight to "modern" systems. |
Quote:
Yes, I followed the build process as the book said but since there are many steps I'm not sure if there isn't any mistake made, or if its just version vintage problem as Business_kid said. I just recalled that right before 8.5 make install, make test finished with errors plus dozons of fail, xfail and xpass(no idea what the later two are for). Don't know if that matters. |
Quote:
|
All times are GMT -5. The time now is 12:13 AM. |