Opened 9 months ago

Closed 7 months ago

#26460 closed defect (user disappeared)

Some? autoconf tests that include stdio.h fail with a missing ssp.h on cygwin

Reported by: teor Owned by:
Priority: Medium Milestone: Tor: 0.3.4.x-final
Component: Core Tor/Tor Version: Tor: 0.3.3.1-alpha
Severity: Normal Keywords: regression, 033-backport
Cc: Actual Points:
Parent ID: #26356 Points:
Reviewer: Sponsor:

Description

It looks like ssp doesn't actually work on cygwin.
We should fix the ssp test so it includes studio.h and fails.

configure:10546: checking whether the compiler accepts -fstack-protector-all
configure:10565: gcc -c -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -pedantic -Werror -fstack-protector-all  -I${top_srcdir}/src/common conftest.c >&5
configure:10565: $? = 0
configure:10584: gcc -o conftest.exe -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -pedantic -Werror -fstack-protector-all  -I${top_srcdir}/src/common  conftest.c  >&5
configure:10584: $? = 0
configure:10596: result: yes
configure:10622: checking whether the compiler accepts -Wstack-protector
configure:10641: gcc -c -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all -pedantic -Werror -Wstack-protector  -I${top_srcdir}/src/common conftest.c >&5
configure:10641: $? = 0
configure:10672: result: yes
configure:10685: checking whether the compiler accepts --param ssp-buffer-size=1
configure:10704: gcc -c -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all -Wstack-protector -pedantic -Werror --param ssp-buffer-size=1  -I${top_srcdir}/src/common conftest.c >&5
configure:10704: $? = 0
configure:10735: result: yes
configure:10749: checking whether the compiler accepts -fPIE
configure:10768: gcc -c -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all -Wstack-protector --param ssp-buffer-size=1 -pedantic -Werror -fPIE  -I${top_srcdir}/src/common conftest.c >&5
configure:10768: $? = 0
configure:10799: result: yes
configure:10811: checking whether the linker accepts -pie
configure:10854: gcc -o conftest.exe -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all -Wstack-protector --param ssp-buffer-size=1 -fPIE -pedantic -Werror  -I${top_srcdir}/src/common     -pie conftest.c  -lz  -levent -lssl -lcrypto      >&5
In file included from /usr/include/stdio.h:800,
                 from conftest.c:78:
/usr/local/lib/gcc/x86_64-unknown-cygwin/8.1.0/include/ssp/stdio.h:38:10: fatal error: ssp.h: No such file or directory
 #include <ssp.h>
          ^~~~~~~
compilation terminated.
configure:10854: $? = 1
configure: program exited with status 1
configure: failed program was:
| /* confdefs.h */
| #define PACKAGE_NAME "tor"
| #define PACKAGE_TARNAME "tor"
| #define PACKAGE_VERSION "0.3.3.7"

(similar macros)

| #define STDC_HEADERS 1
| #define HAVE_SYS_TYPES_H 1

(similar macros)

| /* end confdefs.h.  */
| #include <stdio.h>
| int
| main ()
| {
| fputs("", stdout)
|   ;
|   return 0;
| }
configure:10868: result: no

Child Tickets

Change History (9)

comment:1 Changed 9 months ago by rolex0815

Just adding, file is present:

me@i7t /usr/local/lib/gcc/x86_64-unknown-cygwin/8.1.0/include/ssp
$ ll
total 20K
-rw-r--r-- 1 me Kein 2.4K May 21 17:11 ssp.h
-rw-r--r-- 1 me Kein 3.4K May 21 17:11 stdio.h
-rw-r--r-- 1 me Kein 5.6K May 21 17:11 string.h
-rw-r--r-- 1 me Kein 2.8K May 21 17:11 unistd.h

comment:2 Changed 9 months ago by teor

Status: newneeds_information

Ok, so I think your preprocessor is broken.
About half the time, it falils when including ssp.h. And the rest of the time, it succeeds.

configure:10878: checking whether the compiler accepts -fwrapv
configure:10897: gcc -c -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all -Wstack-protector --param ssp-buffer-size=1 -fPIE -pedantic -Werror -fwrapv  -I${top_srcdir}/src/common conftest.c >&5
configure:10897: $? = 0
configure:10916: gcc -o conftest.exe -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all -Wstack-protector --param ssp-buffer-size=1 -fPIE -pedantic -Werror -fwrapv  -I${top_srcdir}/src/common  conftest.c  >&5
configure:10916: $? = 0
configure:10928: result: yes
configure:11284: checking whether the linker accepts -z relro -z now
configure:11327: gcc -o conftest.exe -g -O2 -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -fstack-protector-all -Wstack-protector --param ssp-buffer-size=1 -fPIE -pedantic -Werror  -I${top_srcdir}/src/common     -z relro -z now conftest.c  -lz  -levent -lssl -lcrypto      >&5
In file included from /usr/include/stdio.h:800,
                 from conftest.c:78:
/usr/local/lib/gcc/x86_64-unknown-cygwin/8.1.0/include/ssp/stdio.h:38:10: fatal error: ssp.h: No such file or directory
 #include <ssp.h>
          ^~~~~~~
compilation terminated.
configure:11327: $? = 1
configure: program exited with status 1
configure: failed program was:

(similar to the last one)

Please try re-running configure, after deleting the config cache.
Then run a diff between the two logs.

If there are a lot of differences between the logs, then your preprocessor is failing on arbitrary inputs.
If the logs are identical, it's failing based on some characteristic of the input files.

Please also retry running configure with stack smashing protection off.

Then, please make sure you have enough available file descriptors, disk space, RAM, etc., then reinstall Cygwin, and try again.

comment:3 Changed 9 months ago by teor

Summary: All autoconf tests that include studio.h fail with a missing ssp.h on cygwinSome? autoconf tests that include studio.h fail with a missing ssp.h on cygwin

comment:4 Changed 9 months ago by nickm

Is this new with 0.3.3, or did 0.3.2 have the same issue?

comment:5 Changed 9 months ago by nickm

Summary: Some? autoconf tests that include studio.h fail with a missing ssp.h on cygwinSome? autoconf tests that include stdio.h fail with a missing ssp.h on cygwin

comment:6 in reply to:  4 Changed 9 months ago by teor

Replying to nickm:

Is this new with 0.3.3, or did 0.3.2 have the same issue?

Apparently 0.3.2 worked, but I want to confirm it's not a compiler upgrade issue:

https://trac.torproject.org/projects/tor/ticket/26356#comment:7

comment:7 Changed 9 months ago by nickm

I tried searching for this issue, and apparently ssp/stdio.h is *not* the include file you want the compiler to be finding: https://stackoverflow.com/questions/27824139/cygwin-gcc-cannot-find-stdio-h

comment:8 Changed 9 months ago by teor

Hi rolex0815,

Can you please check that you have cygwin-devel installed?

You can use these commands:

cygcheck -f /usr/include/stdio.h
cygcheck -c cygwin-devel
cygcheck -l cygwin-devel | grep stdio

If it isn't installed, please install it and try building 0.3.3 and 0.3.2 again.
If it is installed, please try building 0.3.2 again.

comment:9 Changed 7 months ago by nickm

Resolution: user disappeared
Status: needs_informationclosed
Note: See TracTickets for help on using tickets.