facebookincubator / cinder

Cinder is Meta's internal performance-oriented production version of CPython.
https://trycinder.com
Other
3.43k stars 122 forks source link

Unable to build the _socket module #2

Closed kmod closed 3 years ago

kmod commented 3 years ago

On Ubuntu 20.04, getting this error during the build:

$ gcc -pthread -fPIC -I. -fno-omit-frame-pointer -momit-leaf-frame-pointer -Wno-unused-result -Wsign-compare -Wno-cast-function-type -Wno-type-limits -DNDEBUG -g -fwrapv -O3 -Wall -std=c99 -Wextra -Werror -Wno-unused-result -Wno-unused-parameter -Wno-missing-field-initializers -Werror=implicit-function-declaration -I./Include/internal -I./ThirdParty/i386-dis -I. -I./Include -I./ThirdParty/fmt-6.1.1/include -I/usr/include/x86_64-linux-gnu -I/usr/local/include -I/home/kmod/cinder/Include -I/home/kmod/cinder -c /home/kmod/cinder/Modules/socketmodule.c -o build/temp.linux-x86_64-3.8/home/kmod/cinder/Modules/socketmodule.o
In file included from /usr/include/string.h:495,
                 from ./Include/Python.h:30,
                 from /home/kmod/cinder/Modules/socketmodule.c:103:
In function ‘memset’,
    inlined from ‘getsockaddrarg’ at /home/kmod/cinder/Modules/socketmodule.c:2301:9,
    inlined from ‘sock_bind’ at /home/kmod/cinder/Modules/socketmodule.c:3079:10:
/usr/include/x86_64-linux-gnu/bits/string_fortified.h:71:10: error: ‘__builtin_memset’ offset [17, 88] from the object at ‘addrbuf’ is out of the bounds of referenced subobject ‘sa’ with type ‘struct sockaddr’ at offset 0 [-Werror=array-bounds]
   71 |   return __builtin___memset_chk (__dest, __ch, __len, __bos0 (__dest));
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
cc1: all warnings being treated as errors
Mng-dev-ai commented 3 years ago

Same here

alexdoesh commented 3 years ago

https://bugs.python.org/issue38282, and corresponding commit https://github.com/python/cpython/commit/d565fb9828ee9c494bb7a80057a08e4738273e30. it wasn't backported to 3.8 as I understand, so cinder folks has no such change. I think there're two options here: to play with compiler args, or to try applying the patch locally (I don't think FB folks want to update CPython codebase on every issue like this).

I didn't get this issue on my popOS 20.10 w/ gcc 10.2.0 and default cinder's build scripts/config