Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gdb doesn't work in 2.7-slim #101

Closed
ionelmc opened this issue Apr 16, 2016 · 7 comments
Closed

Gdb doesn't work in 2.7-slim #101

ionelmc opened this issue Apr 16, 2016 · 7 comments
Labels

Comments

@ionelmc
Copy link

ionelmc commented Apr 16, 2016

Installed gdb with apt-get install gdb and I get:

root@516ce4c20e51:/# gdb -p 8
Traceback (most recent call last):
  File "/usr/lib/python2.7/site.py", line 563, in <module>
    main()
  File "/usr/lib/python2.7/site.py", line 545, in main
    known_paths = addusersitepackages(known_paths)
  File "/usr/lib/python2.7/site.py", line 272, in addusersitepackages
    user_site = getusersitepackages()
  File "/usr/lib/python2.7/site.py", line 247, in getusersitepackages
    user_base = getuserbase() # this will also set USER_BASE
  File "/usr/lib/python2.7/site.py", line 237, in getuserbase
    USER_BASE = get_config_var('userbase')
  File "/usr/lib/python2.7/sysconfig.py", line 582, in get_config_var
    return get_config_vars().get(name)
  File "/usr/lib/python2.7/sysconfig.py", line 528, in get_config_vars
    _init_posix(_CONFIG_VARS)
  File "/usr/lib/python2.7/sysconfig.py", line 412, in _init_posix
    from _sysconfigdata import build_time_vars
  File "/usr/lib/python2.7/_sysconfigdata.py", line 6, in <module>
    from _sysconfigdata_nd import *
ImportError: No module named _sysconfigdata_nd
@ionelmc
Copy link
Author

ionelmc commented Apr 16, 2016

It would appear the problem is that gdb depends on: file gdbserver libc6-dbg libexpat1 libmagic1 libpython2.7 libpython2.7-minimal libpython2.7-stdlib mime-support. Looks like gdb is rigged to work with the python from the repositories, not whatever is available.

What's a nice way to sort this out?

@tianon
Copy link
Member

tianon commented Aug 8, 2016

Is this related in some way to #89?

@ionelmc
Copy link
Author

ionelmc commented Aug 8, 2016

Perhaps that could provide a solution, no idea. I'm not that versed in gdb features.

@vEpiphyte
Copy link

@ionelmc / @tianon

I have a python docker image built with modifications from the current 3.6.3 dockerfile (i'll be making that a public repo today). This does require doing a debug build of python, and running the container with SYS_PTRACE capability. These both increase repo size and decrease container security. The container size increase is unavoidable; but the use of sys_ptrace is only needed when you know you will need to attach to the container.

I'll update this issue when I have a the exemplar repository available.

cc: @jennolsen84

@vEpiphyte
Copy link

My example repo is here https://github.com/vertexproject/pydebug. After pulling the images built from docker-cloud there is pretty negligible size difference.

vertexproject/pydebug                                           3.6-slim                                   dc5245838148        About an hour ago   174MB
vertexproject/pydebug                                           3.6.3-slim                                 a18b561907c6        About an hour ago   174MB
python                                                          3.6-slim                                   a79297999298        4 weeks ago         156MB
python                                                          3.6.3-slim                                 a79297999298        4 weeks ago         156MB

@tianon
Copy link
Member

tianon commented Apr 25, 2018

#251 seems to imply that this potentially might require compiling GDB from source in order to actually fix it, which is really nasty (and I hope not the case) 😞

@tianon
Copy link
Member

tianon commented Sep 6, 2018

Closing, since this seems to be something we can't easily enable (without possibly compiling GDB from source, which is kind of nasty and we don't want to embed GDB itself in the image). Sorry!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants