Comments (7)
On which operating system is this? I can't reproduce it on Ubuntu 22.04 as mentioned in the linked python ticket.
(And which version of libuuid?)
from util-linux.
That's weird. I can reproduce this on a fresh Ubuntu 22.04.2 LTS install. (I tried it again on a new VPS)
libuuid version: libuuid1/jammy-updates,jammy-security,now 2.37.2-4ubuntu3.4 amd64 [installed,automatic]
root@ubuntu-s-1vcpu-2gb-70gb-intel-sfo3-04:~# uname -a
Linux ubuntu-s-1vcpu-2gb-70gb-intel-sfo3-04 5.15.0-67-generic #74-Ubuntu SMP Wed Feb 22 14:14:39 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
root@ubuntu-s-1vcpu-2gb-70gb-intel-sfo3-04:~# cat /etc/os-release
PRETTY_NAME="Ubuntu 22.04.2 LTS"
NAME="Ubuntu"
VERSION_ID="22.04"
VERSION="22.04.2 LTS (Jammy Jellyfish)"
VERSION_CODENAME=jammy
ID=ubuntu
ID_LIKE=debian
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
UBUNTU_CODENAME=jammy
root@ubuntu-s-1vcpu-2gb-70gb-intel-sfo3-04:~# uuidgen --version
uuidgen from util-linux 2.37.2
root@ubuntu-s-1vcpu-2gb-70gb-intel-sfo3-04:~# gcc uuidtest.c -luuid && ./a.out
before fork: 0 4dd58c2e0a1d11ef84ac73fe09c6a754
after fork: 1528089 0
4dd58c2f0a1d11ef84ac73fe09c6a754
after fork: 0 0
4dd58c2f0a1d11ef84ac73fe09c6a754
root@ubuntu-s-1vcpu-2gb-70gb-intel-sfo3-04:~# cat uuidtest.c
#include <uuid/uuid.h>
#include <unistd.h>
#include <stdio.h>
int main()
{
uuid_t uuid;
printf("before fork: %d ", uuid_generate_time_safe(uuid));
for (int i = 0; i < 16; i++)
printf("%02x", uuid[i]);
printf("\n");
int ret = fork();
printf("after fork: %d %d\n", ret, uuid_generate_time_safe(uuid));
for (int i = 0; i < 16; i++)
printf("%02x", uuid[i]);
printf("\n");
return 0;
}
root@ubuntu-s-1vcpu-2gb-70gb-intel-sfo3-04:~#
from util-linux.
I used the "ubuntu:22.04" docker container, with the exact same version of libuuid.
On my ArchLinux workstation and Debian 12 server it also behaves the same.
from util-linux.
On a similar DO droplet as yours I can reproduce it (unsurprisingly).
from util-linux.
The droplet has the uuidd daemon installed and enabled.
In that case uuid_generate_time_safe()
will indeed always return 0
.
When going through the daemon I can also reproduce this on the current release of util-linux.
from util-linux.
libuuid has a cache and requests UUIDs from libuuidd in batches. This cache is kept in memory and preserved over fork().
from util-linux.
The weird thing is, that the cache is a thread-local variable.
fork() by definition creates a new thread but the thread-local data is preserved.
from util-linux.
Related Issues (20)
- The small capacity of the CDROM triggered a Buffer I/O error during the probe.
- minimal multilib build fails HOT 5
- option to link to always create hard links to first found file HOT 3
- `-Dbuild-lsfd=disabled` apparently doesn't disable the tests for it also
- Feature proposal: umount --recursive on non-mountpoint directory HOT 2
- Typeo in wipefs.c ("superblok")
- Stop capturing paswords with the log-in flag
- mount with mountfd API cannot remount with relatime or strictatime HOT 1
- Build issue 2.40.1 HOT 2
- 2.40.1 - ld.lld: error: version script assignment of 'UUID_2.40' to symbol 'uuid_time64' failed: symbol not defined
- libblkid doc: missing blkid_probe_get_partitions() error check in partitions API usage example
- command "lscpu -e" hangs/loops when output column width greater than tty column width HOT 2
- Feature request: Shouldn't lscpu output the microcode version of the CPU, too?
- [SECURITY] Memory Leak in fsck.c HOT 1
- libsmartcols/src/filter-xxx.c file causing unnecessary rebuilding and even errors HOT 1
- lscpu: The model name of core in the last cluster is not displayed HOT 10
- Bug: Very confusing error message positioning in fdisk output
- Lack of ability to customize ncurses headers/libraries location for cross-compilation
- Rename command sets basename of file to zero length if a rename of the suffix is attempted HOT 4
- wdctl cannot read information about /dev/watchdog HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from util-linux.