Bug 1170551 - Call std::random_device failed when it is used by multiple threads
Call std::random_device failed when it is used by multiple threads
Status: RESOLVED FIXED
Classification: openSUSE
Product: openSUSE Tumbleweed
Classification: openSUSE
Component: Basesystem
Current
x86-64 All
: P5 - None : Critical (vote)
: ---
Assigned To: Richard Biener
E-mail List
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2020-04-27 07:48 UTC by Wnereiz Z
Modified: 2022-03-22 12:47 UTC (History)
3 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Wnereiz Z 2020-04-27 07:48:53 UTC
It seems this problem happens on openSUSE only. It does not happens on Fedora 31.

Original bug report from gcc: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=94087

Environment:

openSUSE Tumbleweed, snapshot 20200422
gcc-c++ version 9.3.1 20200406 [revision 6db837a5288ee3ca5ec504fbd5a765817e556ac2]

Description:

When using std::random_devic object with multiple treads, it return 
"rdseed failed" message. This issue causes some applications crashes.

Reproduce:

1. Download the test code from original bug report on gcc.gnu.org.
2. Compile it with command:
   
   $ g++ -std=c++17 -pthread -o repro-rdseed repro-rdseed.cc

3. Run the binary:

   $ ./repro-rdseed

Actual result:

  Exception raised by worker 0: random_device: rdseed failed
  ...
  Exception raised by worker 254: random_device: rdseed failed
  
  Test failed
    std::random_device is *NOT* usable from multiple threads
    the (alleged) bug *IS* reproduced
  
  Running with:
    GCC VERSION = 9.3.1
    __GLIBCXX__ = 20200408
    _GLIBCXX_RELEASE = 9
    __cplusplus = 201703

Expect result:

  Test should be successful

Attachment:

  See original report
Comment 1 Wnereiz Z 2020-04-27 07:50:31 UTC
The bugzilla search function is currently unavailable. Please close it as duplication if there is already a bug report.
Comment 2 Wnereiz Z 2020-04-27 08:31:58 UTC
I tried to copy the compiled binary from Fedora 31 to openSUSE Tumbleweed and run it, it is still failed. So it maybe the libstdc++ issue.
Comment 3 Richard Biener 2020-05-14 10:27:55 UTC
See comments upstream.
Comment 4 Richard Biener 2022-03-22 12:47:48 UTC
Fixed upstream and in Tumbleweed GCC 10 and 11.