Current-Users archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Failing ssp tests


I'm seeing some odd behavior in the src/tests/lib/libc/ssp tests: when
built with USETOOLS=no, they work as intended, but when built as part
of a release, they all fail.  It looks like as if ssp was being
properly enabled in the former case but not the latter.

As an example, doing "echo adlkfjldskfjd | ./h_fgets 11" in
src/tests/lib/libc/ssp results in a crash with the binary built with
USETOOLS=no, but not with the one built with nbmake-amd64 (i.e. the
ones I have in destdir or in /usr/tests/lib/libc/ssp).

This is with sources as of yesterday with fresh obj, tools and destdir
directories.  Running on an amd64.

If this helps, the command lines used to build h_fgets in both cases:

~/os/netbsd/tools.amd64/bin/nbmake-amd64 h_fgets
/home/jmmv/os/netbsd/tools.amd64/bin/x86_64--netbsd-ar cr libssp_nonshared.a
rm -f .gdbinit
echo "set solib-absolute-prefix /home/jmmv/os/netbsd/destdir.amd64" > .gdbinit
#   compile  ssp/h_fgets.o
/home/jmmv/os/netbsd/tools.amd64/bin/x86_64--netbsd-gcc -O2 -pipe
-fstack-protector-all -Wstack-protector -Wall -Wstrict-prototypes
-Wmissing-prototypes -Wpointer-arith -Wno-sign-compare
-Wno-traditional -Wa,--fatal-warnings -Wreturn-type -Wswitch -Wshadow
-Wcast-qual -Wwrite-strings -Wextra -Wno-unused-parameter
-Wsign-compare -std=gnu99  -Werror    -D_FORTIFY_SOURCE=2  -nostdinc
-isystem /home/jmmv/os/netbsd/destdir.amd64/usr/include -c
#      link  ssp/h_fgets
-B/home/jmmv/os/netbsd/destdir.amd64/usr/lib/  -Wl,-nostdlib
-fstack-protector-all -Wstack-protector -L. -Wl,--fatal-warnings
-o h_fgets  h_fgets.o

desky:~/os/netbsd/src/tests/lib/libc/ssp> make USETOOLS=no h_fgets
ar cr libssp_nonshared.a
rm -f .gdbinit
touch .gdbinit
#   compile  ssp/h_fgets.o
cc -O2 -pipe -fstack-protector-all -Wstack-protector -Wall
-Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith
-Wno-sign-compare -Wno-traditional -Wa,--fatal-warnings -Wreturn-type
-Wswitch -Wshadow -Wcast-qual -Wwrite-strings -Wextra
-Wno-unused-parameter -Wsign-compare -std=gnu99  -Werror
-D_FORTIFY_SOURCE=2   -c    h_fgets.c
#      link  ssp/h_fgets
cc      -fstack-protector-all -Wstack-protector -L.
-Wl,--fatal-warnings     -o h_fgets  h_fgets.o
-Wl,-rpath-link,/lib  -L/lib -Wl,-rpath-link,/usr/lib  -L/usr/lib

Any ideas?


Julio Merino / @jmmv

Home | Main Index | Thread Index | Old Index