Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

gh-132710: only use stable_uuid.generate_time_safe() to deduce MAC address#132901

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
picnixz wants to merge8 commits intopython:main
base:main
Choose a base branch
Loading
frompicnixz:fix/uuid/mac-address-libuuid-132710

Conversation

picnixz
Copy link
Member

@picnixzpicnixz commentedApr 25, 2025
edited by bedevere-appbot
Loading

@picnixz
Copy link
MemberAuthor

cc@zanieb

@picnixzpicnixzforce-pushed thefix/uuid/mac-address-libuuid-132710 branch 2 times, most recently from2d398c9 to99bdd52CompareApril 25, 2025 08:02
@picnixzpicnixzforce-pushed thefix/uuid/mac-address-libuuid-132710 branch from99bdd52 toee71d62CompareApril 25, 2025 08:03
@picnixz
Copy link
MemberAuthor

picnixz commentedApr 25, 2025
edited
Loading

@zanieb Does it actually solve your issue? becausemy system also appears to be unable to get the MAC address... but I was offline (I work offline during the week in general) and I didn't check when I'm online.

@zanieb
Copy link
Contributor

It's kind of hard to test because I haven't added support for the latest 3.14 inpython-build-standalone and the patch doesn't apply cleanly to 3.13.

@zanieb
Copy link
Contributor

zanieb commentedApr 25, 2025
edited
Loading

Okay, the patch does apply cleanly to the previous 3.14 alpha so I can test this. On macOS, it does resolve the problem. I did not test Linux.

@zanieb
Copy link
Contributor

I tested a Linux build atastral-sh/python-build-standalone#595 (comment) and it didn't seem to work.

@picnixz
Copy link
MemberAuthor

Hum. It's very strange. Did I mess the configure script? what's the value ofHAVE_UUID_GENERATE_TIME_SAFE_STABLE_MAC?

@zanieb
Copy link
Contributor

Looking at the logs..."HAVE_UUID_GENERATE_TIME_SAFE_STABLE_MAC": "0",

@picnixz
Copy link
MemberAuthor

... so it's not_unix_node() that is being called?

@zanieb
Copy link
Contributor

zanieb commentedApr 25, 2025
edited
Loading

The builds are attached there if you want to hop into a debugger.

Briefly... yeah it looks like it's called and we try each getter until we reach the random one:

(Pdb) getter<function _unix_getnode at 0xffffb77b74d0>(Pdb) s--Call--> /python/install/lib/python3.14/uuid.py(634)_unix_getnode()-> def _unix_getnode():(Pdb) n> /python/install/lib/python3.14/uuid.py(636)_unix_getnode()-> if _generate_time_safe and _has_stable_extractable_node:(Pdb) n--Return--> /python/install/lib/python3.14/uuid.py(636)_unix_getnode()->None-> if _generate_time_safe and _has_stable_extractable_node:(Pdb) n> /python/install/lib/python3.14/uuid.py(706)getnode()-> if (_node is not None) and (0 <= _node < (1 << 48)):(Pdb) l701     for getter in _GETTERS + [_random_getnode]:702         try:703             _node = getter()704         except:705             continue706  ->       if (_node is not None) and (0 <= _node < (1 << 48)):707             return _node708     assert False, '_random_getnode() returned invalid value: {}'.format(_node)709  710  711  _last_timestamp = None(Pdb) n> /python/install/lib/python3.14/uuid.py(701)getnode()-> for getter in _GETTERS + [_random_getnode]:(Pdb) n> /python/install/lib/python3.14/uuid.py(702)getnode()-> try:(Pdb) getter<function _ip_getnode at 0xffffb77b71d0>(Pdb) n> /python/install/lib/python3.14/uuid.py(703)getnode()-> _node = getter()(Pdb) n> /python/install/lib/python3.14/uuid.py(706)getnode()-> if (_node is not None) and (0 <= _node < (1 << 48)):(Pdb) _node(Pdb) n> /python/install/lib/python3.14/uuid.py(701)getnode()-> for getter in _GETTERS + [_random_getnode]:(Pdb) n> /python/install/lib/python3.14/uuid.py(702)getnode()-> try:(Pdb) getter<function _ifconfig_getnode at 0xffffb77b7110>(Pdb) n> /python/install/lib/python3.14/uuid.py(703)getnode()-> _node = getter()(Pdb) n> /python/install/lib/python3.14/uuid.py(706)getnode()-> if (_node is not None) and (0 <= _node < (1 << 48)):(Pdb) _node(Pdb) n> /python/install/lib/python3.14/uuid.py(701)getnode()-> for getter in _GETTERS + [_random_getnode]:(Pdb) n> /python/install/lib/python3.14/uuid.py(702)getnode()-> try:(Pdb) getter<function _random_getnode at 0xffffb77b7650>(Pdb) n> /python/install/lib/python3.14/uuid.py(703)getnode()-> _node = getter()(Pdb) n> /python/install/lib/python3.14/uuid.py(706)getnode()-> if (_node is not None) and (0 <= _node < (1 << 48)):(Pdb) _node23292345252342

@zanieb
Copy link
Contributor

So, the patch worked but it turns outgenerate_time_safe is necessary for MAC address retrieval on (at least)ubuntu:latest?

@picnixz
Copy link
MemberAuthor

Maybe we should add all possiblegetnode fallbacks based on ifconfig, ip, arp, netstat, lanscan?

@zanieb
Copy link
Contributor

We did try_ip_getnode and_ifconfig_getnode as expected there. I didn't look into why those might fail. It does feel like a bit of a separate concern than this patch.

@picnixz
Copy link
MemberAuthor

I suggest adding a print in theexcept: continue as well just in case and also print the output of the invoked command to see whether we need to upgrade how the output is being parsed.

@zanieb
Copy link
Contributor

Those commands are just not installed by default in theubuntu image. If youapt-get install net-tools, thegetnode result is static.

@picnixz
Copy link
MemberAuthor

picnixz commentedApr 26, 2025
edited
Loading

Ha! so that's why. Let's also fix this by adding them as a dependency then

@picnixzpicnixz added the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelApr 26, 2025
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by@picnixz for commit16200ae 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F132901%2Fmerge

If you want to schedule another build, you need to add the🔨 test-with-buildbots label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelApr 26, 2025
@picnixzpicnixz added the needs backport to 3.13bugs and security fixes labelApr 26, 2025
@picnixz
Copy link
MemberAuthor

Ok the refleaks were fixed in#132989.

@picnixzpicnixz requested a review fromhugovkApril 28, 2025 11:07
@picnixzpicnixz requested a review fromzaniebMay 7, 2025 12:37
@picnixzpicnixz added the needs backport to 3.14bugs and security fixes labelMay 7, 2025
@picnixz
Copy link
MemberAuthor

Ok, it's actually a real bug fix because the docs say:

Changed in version 3.7: Universally administered MAC addresses are preferred over locally administered MAC addresses, since the former are guaranteed to be globally unique, while the latter are not.

@picnixzpicnixz added the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelMay 17, 2025
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by@picnixz for commite311181 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F132901%2Fmerge

If you want to schedule another build, you need to add the🔨 test-with-buildbots label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelMay 17, 2025
@picnixzpicnixz added the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelMay 17, 2025
@bedevere-bot
Copy link

🤖 New build scheduled with the buildbot fleet by@picnixz for commit19c6262 🤖

Results will be shown at:

https://buildbot.python.org/all/#/grid?branch=refs%2Fpull%2F132901%2Fmerge

If you want to schedule another build, you need to add the🔨 test-with-buildbots label again.

@bedevere-botbedevere-bot removed the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelMay 17, 2025
@picnixz
Copy link
MemberAuthor

picnixz commentedMay 17, 2025
edited
Loading

@brettcannon is the configure issue a known WASM/WASI issue or is this an issue on my side, namely:

configure: error: set ac_cv_file__dev_ptmx to yes/no in your CONFIG_SITE file when cross compiling

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@erlend-aaslanderlend-aaslandAwaiting requested review from erlend-aaslanderlend-aasland is a code owner

@corona10corona10Awaiting requested review from corona10corona10 is a code owner

@hugovkhugovkAwaiting requested review from hugovk

@zaniebzaniebAwaiting requested review from zanieb

Assignees
No one assigned
Labels
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@picnixz@zanieb@bedevere-bot

[8]ページ先頭

©2009-2025 Movatter.jp