Skip to content

Compact dict bug on Windows (Visual Studio): if (mp->ma_keys->dk_usable * 3 < other->ma_used * 2) #72248

Description

@Vgr255
mannequin
BPO 28061
Nosy @pfmoore, @vstinner, @tjguk, @ned-deily, @methane, @zware, @serhiy-storchaka, @zooba, @Vgr255

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 2016-09-12.10:23:42.690>
created_at = <Date 2016-09-10.12:05:02.012>
labels = ['interpreter-core', 'invalid', 'OS-windows']
title = 'Compact dict bug on Windows (Visual Studio): if (mp->ma_keys->dk_usable * 3 < other->ma_used * 2)'
updated_at = <Date 2016-09-12.10:25:35.516>
user = 'https://github.com/Vgr255'

bugs.python.org fields:

activity = <Date 2016-09-12.10:25:35.516>
actor = 'vstinner'
assignee = 'none'
closed = True
closed_date = <Date 2016-09-12.10:23:42.690>
closer = 'abarry'
components = ['Interpreter Core', 'Windows']
creation = <Date 2016-09-10.12:05:02.012>
creator = 'abarry'
dependencies = []
files = []
hgrepos = []
issue_num = 28061
keywords = []
message_count = 17.0
messages = ['275627', '275630', '275631', '275633', '275653', '275693', '275755', '275756', '275759', '275765', '275769', '275778', '275791', '276002', '276013', '276014', '276015']
nosy_count = 9.0
nosy_names = ['paul.moore', 'vstinner', 'tim.golden', 'ned.deily', 'methane', 'zach.ware', 'serhiy.storchaka', 'steve.dower', 'abarry']
pr_nums = []
priority = 'normal'
resolution = 'not a bug'
stage = 'resolved'
status = 'closed'
superseder = None
type = None
url = 'https://bugs.python.org/issue28061'
versions = ['Python 3.6']

Activity

  1. Vgr255 commented on Sep 10, 2016

    Vgr255mannequin
    MannequinAuthor

    VS breaks at line Objects/dictobject.c:2339 - ' if (mp->ma_keys->dk_usable * 3 < other->ma_used * 2)'

    I don't have any more useful information; I'm running Windows 7.

  2. added
    type-crashA hard crash of the interpreter, possibly with a core dump
    interpreter-core(Objects, Python, Grammar, and Parser dirs)
    on Sep 10, 2016
  3. methane commented on Sep 10, 2016

    @methane
    Member

    Which hg (or git) revision do you use?

  4. Vgr255 commented on Sep 10, 2016

    Vgr255mannequin
    MannequinAuthor
  5. methane commented on Sep 10, 2016

    @methane
    Member

    According to IRC log, the issue happens on Windows.
    And hg revision is a477ef882a16.

    I'll try building Python on Windows 10 amd64 in this weekend.

  6. vstinner commented on Sep 10, 2016

    @vstinner
    Member

    VS breaks at line Objects/dictobject.c:2339 - ' if (mp->ma_keys->dk_usable * 3 < other->ma_used * 2)'

    Can you elaborate? Does the compilation fail? Did you get a crash? What was you doing while getting this error/message?

    ... Can you please give clues how to reproduce the issue?

  7. Vgr255 commented on Sep 10, 2016

    Vgr255mannequin
    MannequinAuthor

    I compiled, I got a "Python stopped working" during compiling (but it went on anyway), and then launched it from VS in Debugging mode. I did 'from test import support' and then it crashed. VS said this line was the faulty one, and didn't give me anything else useful (no call stack, no access to locals, etc.). I'm sadly not home until Monday, so I can't further investigate this.

  8. changed the title [-]Python crashes on 'from test import support'[/-] [+]Compact dict bug on Windows (Visual Studio): if (mp->ma_keys->dk_usable * 3 < other->ma_used * 2)[/+] on Sep 11, 2016
  9. methane commented on Sep 11, 2016

    @methane
    Member

    I built acfe53a (git hash). Then:

    c:\Users\inada-n\work\cpython>PCbuild\win32\python_d.exe -m test.test_dict
    ..............................................................................
    ----------------------------------------------------------------------
    Ran 78 tests in 1.262s

    OK

  10. vstinner commented on Sep 11, 2016

    @vstinner
    Member

    Emanuel Barry: What is your Visual Studio (exact) version? I know that there are service packs for VS. What is your Windows version?

  11. vstinner commented on Sep 11, 2016

    @vstinner
    Member

    Emanuel Barry: What is your Visual Studio (exact) version? I know that there are service packs for VS. What is your Windows version?

    Oh, same questions for you Naoki in fact :-) It may help to check if
    it's related to VS, Windows or if it's something else.

  12. methane commented on Sep 11, 2016

    @methane
    Member

    I noticed I tested win32 mode. I'll rebuild on amd64 mode.

    Oh, same questions for you Naoki in fact :-)

    I don't know about how to describe exist version of my Windows environment. Is these enough?

    Windows 10 Home (with Anniversary Update)
    10.0.14393 build 14393

    Microsoft Visual Studio Community 2015
    Version 14.0.25425.01 Update 3
    Microsoft .NET Framework
    Version 4.6.01586
    Installed Version: Community
    Microsoft Visual C++ 2015

    cl /?
    Microsoft (R) C/C++ Optimizing Compiler Version 19.00.24213.1 for x86

    C:\Users\inada-n\work\cpython>PCbuild\win32\python_d.exe
    Python 3.6.0a4+ (default, Sep 11 2016, 18:22:14) [MSC v.1900 32 bit (Intel)] on win32

  13. methane commented on Sep 11, 2016

    @methane
    Member

    amd64 result

    c:\Users\inada-n\work\cpython>PCbuild\amd64\python_d.exe -m test.test_dict
    ..............................................................................
    ----------------------------------------------------------------------
    Ran 78 tests in 1.498s

    OK

    c:\Users\inada-n\work\cpython>PCbuild\amd64\python_d.exe
    Python 3.6.0a4+ (default, Sep 11 2016, 19:10:48) [MSC v.1900 64 bit (AMD64)] on win32
    Type "help", "copyright", "credits" or "license" for more information.

  14. Vgr255 commented on Sep 11, 2016

    Vgr255mannequin
    MannequinAuthor

    Huh, weird. I'm running a win32 build on a 64 bits machine, with VS2015. I didn't have time to test on a clean checkout, I will do that first thing when I'm back home tonight. I hope I did something wrong and there really isn't any issue :)

  15. zooba commented on Sep 11, 2016

    @zooba
    Member

    It's unlikely, but we also print out the UCRT version at the end of the build process (with a warning if you need to update the WinSDK).

    I built and tested a number of times with this change though. If suggest hg purge and rebuild to make sure everything is clean.

  16. vstinner commented on Sep 12, 2016

    @vstinner
    Member

    I just rebuilt the default Python branch (rev c8851a0ce7ca) on Windows in debug mode and 32-bit: the compilation succeeded and test_dict pass.

    • Windows 8.1 (Version 6.3, Build 9600)
    • Visual Studio 2015 : version 14.0.23107.0 D14EL

    It's unlikely, but we also print out the UCRT version at the end of the build process (with a warning if you need to update the WinSDK).

    Ah, UCRT seems outdated on my PC:

    29>------ Rebuild All started: Project: _testbuffer, Configuration: Debug Win32 ------
    27> Generating Code...
    26> C:\Windows\SYSTEM32\ucrtbased.dll is version 10.0.10150.0
    26> WARN: ucrtbased contains known issues. Please update the Windows 10 SDK.
    26> See:
    26> http://bugs.python.org/issue27705
    26> https://developer.microsoft.com/en-US/windows/downloads/windows-10-sdk

  17. vstinner commented on Sep 12, 2016

    @vstinner
    Member

    I compiled Python in 4 modes:

    • debug/32 bits
    • debug/64 bits
    • release/32 bits
    • release/64 bits

    Compilation never fails and test_dict always pass.

    I'm unable to reproduce the issue, so I removed the "release blocker" flag to not stress our release manager :-)

  18. Vgr255 commented on Sep 12, 2016

    Vgr255mannequin
    MannequinAuthor

    I actually did a clean rebuild and could not reproduce, so I'm guessing something did go wrong on my side.

  19. added and removed
    type-crashA hard crash of the interpreter, possibly with a core dump
    on Sep 12, 2016
  20. vstinner commented on Sep 12, 2016

    @vstinner
    Member

    I actually did a clean rebuild and could not reproduce, so I'm guessing something did go wrong on my side.

    Don't worry. It shouldn't hurt to double or tiple check. I'm not fully confident of this critical change (compact dict). It's good to get any kind of feedback ;-)

  21. 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

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions