Skip to content

Valgrind error with python #77029

Closed
Closed

Description

@ArunSolomon
BPO 32848
Nosy @vstinner, @tiran, @bitdancer, @skrah
Files
  • suppress.zip: attached valgrind warnings for both pymalloc enabled and disabled
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2018-02-15.14:13:47.371>
    created_at = <Date 2018-02-15.07:20:06.839>
    labels = ['build', 'invalid']
    title = 'Valgrind error with python'
    updated_at = <Date 2018-02-15.14:13:47.357>
    user = 'https://bugs.python.org/ArunSolomon'

    bugs.python.org fields:

    activity = <Date 2018-02-15.14:13:47.357>
    actor = 'christian.heimes'
    assignee = 'none'
    closed = True
    closed_date = <Date 2018-02-15.14:13:47.371>
    closer = 'christian.heimes'
    components = ['Build']
    creation = <Date 2018-02-15.07:20:06.839>
    creator = 'Arun Solomon'
    dependencies = []
    files = ['47443']
    hgrepos = []
    issue_num = 32848
    keywords = []
    message_count = 6.0
    messages = ['312193', '312202', '312203', '312204', '312205', '312208']
    nosy_count = 5.0
    nosy_names = ['vstinner', 'christian.heimes', 'r.david.murray', 'skrah', 'Arun Solomon']
    pr_nums = []
    priority = 'normal'
    resolution = 'not a bug'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue32848'
    versions = ['Python 2.7']

    Activity

    1. ArunSolomon commented on Feb 15, 2018

      ArunSolomonmannequin
      MannequinAuthor

      Hi...

      I am facing the problem python along with valgrind. I was getting default valgrind warnings messages. I have created the sample.py. sample.py file does not have any code. I created empty py file to confirm that my code does not have any memory leaks.

      Following is the valgrind command that I am using in command line:
      valgrind --leak-check=full --show-reachable=yes --error-limit=no --gen-suppressions=all --log-file=msm_suppress.log -v /home/arunspra/py_src/Python-2.7.5/python sample.py

      I was getting plenty of valgrind warnings.

      I surfed in the google and I got to know that i need to configure python by disabling pymalloc. As said by technical peoples, If pymalloc was disabled, we would not got any memory related errors. But i was getting the memory related error. Following is my command that i used to disable pymalloc:

      ./configure --without-pymalloc --with-pydebug
      make

      Then I ran above said valgrind command. I was getting 1299 valgrind warnings. If i enable pymalloc, I was getting only 108 valgrind warnings.

      Following is my software versions:
      Cent os: 7.3
      Python: 2.7.5
      Valgrind: 3.12.0

      PS: If i configure and build python, i was getting an Import Error: No module named netifaces. I am using netifaces in my project. If i use system inbuilt python, i am not getting netifaces import error.

      Can anyone please advice me to resolve this issue.

    2. added
      build
      on Feb 15, 2018
    3. bitdancer commented on Feb 15, 2018

      @bitdancer
      Member

      Did you notice that our configure has a --with-valgrind option?

      In any case, there isn't a bug in python here that you are reporting. If you want to continue to learn about our existing support for valgrind and find things that can be improved, you are welcome to open a more specific issue in the future. I would suggest seeking help on the python-list mailing list for learning about this, and for your second question.

    4. added and removed
      build
      on Feb 15, 2018
    5. ArunSolomon commented on Feb 15, 2018

      ArunSolomonmannequin
      MannequinAuthor

      Hi,

      I ran with the following command to configure python with valgrind:
      ./configure --without-pymalloc --with-pydebug --with-valgrind

      I was getting the following error:
      configure: error: Valgrind support requested but headers not available

      Python: 2.7.5
      Valgrind: 3.12.0

      How can i resolve this error?

    6. skrah commented on Feb 15, 2018

      skrahmannequin
      Mannequin

      You have two options:

      a) ./configure CFLAGS="-O0 -g" --without-pymalloc

      b) ./configure CFLAGS="-O0 -g" --with-valgrind

      For b) you need the Valgrind headers installed.

      --with-pydebug is always wrong when using Valgrind.

    7. ArunSolomon commented on Feb 15, 2018

      ArunSolomonmannequin
      MannequinAuthor

      Hi Stefan,

      I tried with two configure options. Both of them, I am getting the same error.

      configure: error: Valgrind support requested but headers not available

    8. tiran commented on Feb 15, 2018

      @tiran
      Member

      You are missing some dependencies. You have to install valgrind development package.

      This is a bug tracker, not a support forum. Please use the Python users mailing list or #python IRC channel to get help.

    9. transferred this issue fromon Apr 10, 2022
    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

      build

      Projects

      No projects

        Milestone

        No milestone

        Relationships

        None yet

        Development

        No branches or pull requests

        Issue actions