[issue26285] Garbage collection of unused input sections from CPython binaries

Alecsandru Patrascu report at bugs.python.org
Fri Feb 5 07:50:48 EST 2016


Alecsandru Patrascu added the comment:

I've done again the experiments on larger workloads, such as our OpenStack Swift cluster, and it works without any issues.

Also, I've attached an archive with a simple external module in CPython3 that uses PyMem_RawMalloc. The output is ok, and it's copied bellow.


u at palecsandru:~/w/experimente/c_ext3$ /home/u/w/cpython3_deadcode/python setup.py build_ext --inplace
running build_ext
building 'mytest' extension
creating build
creating build/temp.linux-x86_64-3.6
gcc -pthread -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -fdata-sections -ffunction-sections -Wl,--gc-sections -fPIC -I/home/u/w/cpython3_deadcode/Include -I/home/u/w/cpython3_deadcode -c mytest.c -o build/temp.linux-x86_64-3.6/mytest.o
gcc -pthread -shared build/temp.linux-x86_64-3.6/mytest.o -o /home/u/w/experimente/c_ext3/mytest.cpython-36m-x86_64-linux-gnu.so

u at palecsandru:~/w/experimente/c_ext3$ ll
total 40
drwxrwxr-x  3 u u  4096 Feb  5 14:29 ./
drwxr-xr-x 12 u u  4096 Feb  5 14:00 ../
drwxrwxr-x  3 u u  4096 Feb  5 14:29 build/
-rw-rw-r--  1 u u   619 Feb  5 14:16 mytest.c
-rwxrwxr-x  1 u u 17856 Feb  5 14:29 mytest.cpython-36m-x86_64-linux-gnu.so*
-rw-rw-r--  1 u u   132 Feb  5 14:15 setup.py

u at palecsandru:~/w/experimente/c_ext3$ /home/u/w/cpython3_deadcode/python
Python 3.6.0a0 (default:87dfadd61e0d+, Feb  5 2016, 14:22:57) 
[GCC 5.2.1 20151010] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import mytest
>>> mytest.mytest()
'test'
>>>

----------
Added file: http://bugs.python.org/file41819/c_ext3.zip

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue26285>
_______________________________________


More information about the Python-bugs-list mailing list