Skip to content

Gdb doesn't work in 2.7-slim #101

Closed
Closed

Description

@ionelmc

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

Activity

  1. ionelmc commented on Apr 16, 2016

    @ionelmc
    Author

    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?

  2. tianon commented on Aug 8, 2016

    @tianon
    Member

    Is this related in some way to #89?

  3. ionelmc commented on Aug 8, 2016

    @ionelmc
    Author

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

  4. vEpiphyte commented on Dec 5, 2017

    @vEpiphyte

    @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

  5. vEpiphyte commented on Dec 6, 2017

    @vEpiphyte

    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
    
  6. tianon commented on Apr 25, 2018

    @tianon
    Member

    #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) 😞

  7. tianon commented on Sep 6, 2018

    @tianon
    Member

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions