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

Merged

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

@picnixz
Copy link
MemberAuthor

@hugovk friendly ping

This is a bug fix, so it should technically be backported up to 3.13. But I'm not confident in this bugfix because there is still a change of behavior, and maybe it could have more impact than what I think.

The bug is however really hard to spot as it's only betweendifferent interpreters that it would appear. Within the same process, it wouldn't appear. Do you think it's better to merge this one for 3.14 and 3.15 but hold a few beta releases until merging it into 3.13?

@hugovk
Copy link
Member

Do you think it's better to merge this one for 3.14 and 3.15 but hold a few beta releases until merging it into 3.13?

Can do. The next 3.13 is scheduled for 2025-06-03. After that is 2025-08-05, by which time we'll have had all three remaining 3.14 betas and one RC.

@picnixzpicnixz self-assigned thisMay 25, 2025
@picnixzpicnixz removed the needs backport to 3.13bugs and security fixes labelMay 25, 2025
@picnixzpicnixz added the 🔨 test-with-buildbotsTest PR w/ buildbots; report in status section labelMay 25, 2025
@bedevere-bot
Copy link

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

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 25, 2025
@picnixz
Copy link
MemberAuthor

Note: the buildbot failures are unrelated so I'll ignore them.

@picnixzpicnixz merged commit3bffada intopython:mainMay 26, 2025
113 of 119 checks passed
@picnixzpicnixz deleted the fix/uuid/mac-address-libuuid-132710 branchMay 26, 2025 08:56
@picnixz
Copy link
MemberAuthor

Hum, is our backport bot sick? it didn't make an automatic backport, so I'll do it for 3.14

picnixz added a commit to picnixz/cpython that referenced this pull requestMay 26, 2025
…to deduce MAC address (pythonGH-132901)(cherry picked from commit3bffada)Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
@picnixzpicnixz added needs backport to 3.13bugs and security fixes and removed needs backport to 3.14bugs and security fixes labelsMay 26, 2025
@miss-islington-app
Copy link

Thanks@picnixz for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13.
🐍🍒⛏🤖

@miss-islington-app
Copy link

Sorry,@picnixz, I could not cleanly backport this to3.13 due to a conflict.
Please backport usingcherry_picker on command line.

cherry_picker 3bffada46728e51f84c41ecbb0d3722595693e63 3.13

@picnixz
Copy link
MemberAuthor

huh... ok I'll make the manual bp, add a DO-NOT-MERGE and so that we don't forget it

@bedevere-app
Copy link

GH-134704 is a backport of this pull request to the3.13 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelMay 26, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestMay 26, 2025
…-134705)(cherry picked from commit9eb84d8)Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
picnixz added a commit that referenced this pull requestMay 26, 2025
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestMay 26, 2025
…-134705)(cherry picked from commit9eb84d8)Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@hugovkhugovkhugovk approved these changes

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

@corona10corona10Awaiting requested review from corona10corona10 is a code owner

@zaniebzaniebAwaiting requested review from zanieb

Assignees

@picnixzpicnixz

Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@picnixz@zanieb@bedevere-bot@hugovk

[8]ページ先頭

©2009-2025 Movatter.jp