This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Compact dict bug on Windows (Visual Studio): if (mp->ma_keys->dk_usable * 3 < other->ma_used * 2)
Type: Stage: resolved
Components: Interpreter Core, Windows Versions: Python 3.6
process
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: abarry, methane, ned.deily, paul.moore, serhiy.storchaka, steve.dower, tim.golden, vstinner, zach.ware
Priority: normal Keywords:

Created on 2016-09-10 12:05 by abarry, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (17)
msg275627 - (view) Author: Anilyka Barry (abarry) * (Python triager) Date: 2016-09-10 12:05
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.
msg275630 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2016-09-10 12:13
Which hg (or git) revision do you use?
msg275631 - (view) Author: Anilyka Barry (abarry) * (Python triager) Date: 2016-09-10 12:15
Latest, i.e. https://hg.python.org/cpython/rev/a477ef882a16
msg275633 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2016-09-10 13:01
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.
msg275653 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-09-10 16:42
> 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?
msg275693 - (view) Author: Anilyka Barry (abarry) * (Python triager) Date: 2016-09-10 20:33
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.
msg275755 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2016-09-11 09:27
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
msg275756 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-09-11 09:35
Emanuel Barry: What is your Visual Studio (exact) version? I know that there are service packs for VS. What is your Windows version?
msg275759 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-09-11 09:54
> 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.
msg275765 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2016-09-11 10:07
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
msg275769 - (view) Author: Inada Naoki (methane) * (Python committer) Date: 2016-09-11 10:33
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.
msg275778 - (view) Author: Anilyka Barry (abarry) * (Python triager) Date: 2016-09-11 12:06
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 :)
msg275791 - (view) Author: Steve Dower (steve.dower) * (Python committer) Date: 2016-09-11 13:41
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.
msg276002 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-09-12 08:48
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
msg276013 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-09-12 10:05
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 :-)
msg276014 - (view) Author: Anilyka Barry (abarry) * (Python triager) Date: 2016-09-12 10:23
I actually did a clean rebuild and could not reproduce, so I'm guessing something did go wrong on my side.
msg276015 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2016-09-12 10:25
> 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 ;-)
History
Date User Action Args
2022-04-11 14:58:36adminsetgithub: 72248
2016-09-12 10:25:35vstinnersetmessages: + msg276015
2016-09-12 10:23:42abarrysetstatus: open -> closed
priority: deferred blocker -> normal
type: crash ->
messages: + msg276014

resolution: not a bug
stage: needs patch -> resolved
2016-09-12 10:05:05vstinnersetpriority: release blocker -> deferred blocker

messages: + msg276013
2016-09-12 08:48:41vstinnersetmessages: + msg276002
2016-09-11 13:41:35steve.dowersetmessages: + msg275791
2016-09-11 12:06:04abarrysetmessages: + msg275778
2016-09-11 10:33:10methanesetmessages: + msg275769
2016-09-11 10:07:43methanesetmessages: + msg275765
2016-09-11 09:54:52vstinnersetmessages: + msg275759
2016-09-11 09:35:43vstinnersetmessages: + msg275756
2016-09-11 09:27:15methanesetmessages: + msg275755
2016-09-11 08:01:01vstinnersettitle: 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)
2016-09-10 20:54:31abarrysetnosy: + steve.dower, paul.moore, tim.golden, zach.ware
components: + Windows
2016-09-10 20:33:05abarrysetmessages: + msg275693
2016-09-10 16:42:42vstinnersetmessages: + msg275653
2016-09-10 13:01:30methanesetmessages: + msg275633
2016-09-10 12:15:32abarrysetmessages: + msg275631
2016-09-10 12:13:42methanesetmessages: + msg275630
2016-09-10 12:05:02abarrycreate