Skip to contentSkip to conversation

pthread_cancel bug on ubuntu2004/debian11

DISCUSSION Richard Purdie 4 participants 5 messages Dec 27, 2023 – Dec 30, 2023

lore
Share & tools
lore
#0 lore raw

I wanted to write down some thoughts on this which I have all the pieces handy.

We saw a nightly layer check fail for meta-openembedded:

https://autobuilder.yoctoproject.org/typhoon/#/builders/121/builds/1798/steps/21/logs/stdio

INFO: ======================================================================
INFO: ERROR: test_show_environment (common.CommonCheckLayer)
INFO: ----------------------------------------------------------------------
INFO: Traceback (most recent call last):
File "/home/pokybuild/yocto-worker/check-layer-nightly/build/scripts/lib/checklayer/cases/common.py", line 48, in test_show_environment
check_command('Layer %s failed to show environment.' % self.tc.layer['name'],
File "/home/pokybuild/yocto-worker/check-layer-nightly/build/scripts/lib/checklayer/__init__.py", line 287, in check_command
raise RuntimeError(msg)
RuntimeError: Layer meta-gnome failed to show environment.
Command: bitbake -e
Output:
libgcc_s.so.1 must be installed for pthread_cancel to work
Aborted (core dumped)

which unsurprisingly is on ubuntn 20.04. We've also seen issues like this on Debian 11.

I noticed:

https://stackoverflow.com/questions/64797838/libgcc-s-so-1-must-be-installed-for-pthread-cancel-to-work

and:

https://bugs.ams1.psf.io/issue42888

which led me to try:

ubuntu2004-ty-1:~$ wget https://bugs.ams1.psf.io/file50112/pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py 
ubuntu2004-ty-1:~$ echo $?
0
rpurdie@ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py 
libgcc_s.so.1 must be installed for pthread_cancel to work
Aborted (core dumped)
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py 
libgcc_s.so.1 must be installed for pthread_cancel to work
Aborted (core dumped)
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py 
libgcc_s.so.1 must be installed for pthread_cancel to work
Aborted (core dumped)

(1 in 4 success)

Then adding to the script:
import ctypes
libgcc_s = ctypes.CDLL('libgcc_s.so.1')

ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py 
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py 
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py 
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py 
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py 
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py 
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py 
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py 
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py 
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py 
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py 
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py 
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py 
ubuntu2004-ty-1:~$ python3 --version
Python 3.8.10

I also tried this on debian 11:

debian11-ty-1:~$ python3 pthread_cancel_bug.py 
libgcc_s.so.1 must be installed for pthread_cancel to work
Aborted
debian11-ty-1:~$ python3 --version
Python 3.9.2

where the above workaround using ctypes also seems to work.

I'm therefore tempted for python 3.8/3.9 to preload libgcc_s as a workaround for this...

Cheers,

Richard

#1 lore raw
Quoted 76 lines · Richard Purdie

I wanted to write down some thoughts on this which I have all the pieces handy.

We saw a nightly layer check fail for meta-openembedded:

https://autobuilder.yoctoproject.org/typhoon/#/builders/121/builds/1798/steps/21/logs/stdio

INFO: ======================================================================
INFO: ERROR: test_show_environment (common.CommonCheckLayer)
INFO: ----------------------------------------------------------------------
INFO: Traceback (most recent call last):
File "/home/pokybuild/yocto-worker/check-layer-nightly/build/scripts/lib/checklayer/cases/common.py", line 48, in test_show_environment
check_command('Layer %s failed to show environment.' % self.tc.layer['name'],
File "/home/pokybuild/yocto-worker/check-layer-nightly/build/scripts/lib/checklayer/__init__.py", line 287, in check_command
raise RuntimeError(msg)
RuntimeError: Layer meta-gnome failed to show environment.
Command: bitbake -e
Output:
libgcc_s.so.1 must be installed for pthread_cancel to work
Aborted (core dumped)

which unsurprisingly is on ubuntn 20.04. We've also seen issues like this on Debian 11.

I noticed:

https://stackoverflow.com/questions/64797838/libgcc-s-so-1-must-be-installed-for-pthread-cancel-to-work

and:

https://bugs.ams1.psf.io/issue42888

which led me to try:

ubuntu2004-ty-1:~$ wget https://bugs.ams1.psf.io/file50112/pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ echo $?
0
rpurdie@ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
libgcc_s.so.1 must be installed for pthread_cancel to work
Aborted (core dumped)
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
libgcc_s.so.1 must be installed for pthread_cancel to work
Aborted (core dumped)
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
libgcc_s.so.1 must be installed for pthread_cancel to work
Aborted (core dumped)

(1 in 4 success)

Then adding to the script:
import ctypes
libgcc_s = ctypes.CDLL('libgcc_s.so.1')

ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 --version
Python 3.8.10

I also tried this on debian 11:

debian11-ty-1:~$ python3 pthread_cancel_bug.py
libgcc_s.so.1 must be installed for pthread_cancel to work
Aborted
Quoted 7 lines
debian11-ty-1:~$ python3 --version
Python 3.9.2

where the above workaround using ctypes also seems to work.

I'm therefore tempted for python 3.8/3.9 to preload libgcc_s as a workaround for this...

Seems reasonable to me, as long as we can restrict it to a specific version range of python and have a nice comment explaining why

Quoted 15 lines

Cheers,

Richard

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#15704): https://lists.openembedded.org/g/bitbake-devel/message/15704
Mute This Topic: https://lists.openembedded.org/mt/103383244/3616693
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/leave/8021544/3616693/382565666/xyzzy [[email protected]]
-=-=-=-=-=-=-=-=-=-=-=-

#2 lore raw
Quoted 81 lines · Joshua Watt
Quoted 79 lines · Richard Purdie

I wanted to write down some thoughts on this which I have all the pieces handy.

We saw a nightly layer check fail for meta-openembedded:

https://autobuilder.yoctoproject.org/typhoon/#/builders/121/builds/1798/steps/21/logs/stdio

INFO: ======================================================================
INFO: ERROR: test_show_environment (common.CommonCheckLayer)
INFO: ----------------------------------------------------------------------
INFO: Traceback (most recent call last):
File "/home/pokybuild/yocto-worker/check-layer-nightly/build/scripts/lib/checklayer/cases/common.py", line 48, in test_show_environment
check_command('Layer %s failed to show environment.' % self.tc.layer['name'],
File "/home/pokybuild/yocto-worker/check-layer-nightly/build/scripts/lib/checklayer/__init__.py", line 287, in check_command
raise RuntimeError(msg)
RuntimeError: Layer meta-gnome failed to show environment.
Command: bitbake -e
Output:
libgcc_s.so.1 must be installed for pthread_cancel to work
Aborted (core dumped)

which unsurprisingly is on ubuntn 20.04. We've also seen issues like this on Debian 11.

I noticed:

https://stackoverflow.com/questions/64797838/libgcc-s-so-1-must-be-installed-for-pthread-cancel-to-work

and:

https://bugs.ams1.psf.io/issue42888

which led me to try:

ubuntu2004-ty-1:~$ wget https://bugs.ams1.psf.io/file50112/pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ echo $?
0
rpurdie@ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
libgcc_s.so.1 must be installed for pthread_cancel to work
Aborted (core dumped)
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
libgcc_s.so.1 must be installed for pthread_cancel to work
Aborted (core dumped)
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
libgcc_s.so.1 must be installed for pthread_cancel to work
Aborted (core dumped)

(1 in 4 success)

Then adding to the script:
import ctypes
libgcc_s = ctypes.CDLL('libgcc_s.so.1')

ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 --version
Python 3.8.10

I also tried this on debian 11:

debian11-ty-1:~$ python3 pthread_cancel_bug.py
libgcc_s.so.1 must be installed for pthread_cancel to work
Aborted
debian11-ty-1:~$ python3 --version
Python 3.9.2
Quoted 7 lines
Quoted 4 lines

where the above workaround using ctypes also seems to work.

I'm therefore tempted for python 3.8/3.9 to preload libgcc_s as a workaround for this...

Seems reasonable to me, as long as we can restrict it to a specific version range of python and have a nice comment explaining why

Patch tested, sent and I've applied it to older bitbake branches too in the hope that it helps some of Steve's autobuilder failures too.

Once we get to 3.10 as a minimum version we can drop it.

Cheers,

Richard

#3 lore raw
Quoted 85 lines · Richard Purdie
Quoted 83 lines · Joshua Watt
Quoted 81 lines · Richard Purdie

I wanted to write down some thoughts on this which I have all the pieces handy.

We saw a nightly layer check fail for meta-openembedded:

https://autobuilder.yoctoproject.org/typhoon/#/builders/121/builds/1798/steps/21/logs/stdio

INFO: ======================================================================
INFO: ERROR: test_show_environment (common.CommonCheckLayer)
INFO: ----------------------------------------------------------------------
INFO: Traceback (most recent call last):
File "/home/pokybuild/yocto-worker/check-layer-nightly/build/scripts/lib/checklayer/cases/common.py", line 48, in test_show_environment
check_command('Layer %s failed to show environment.' % self.tc.layer['name'],
File "/home/pokybuild/yocto-worker/check-layer-nightly/build/scripts/lib/checklayer/__init__.py", line 287, in check_command
raise RuntimeError(msg)
RuntimeError: Layer meta-gnome failed to show environment.
Command: bitbake -e
Output:
libgcc_s.so.1 must be installed for pthread_cancel to work
Aborted (core dumped)

which unsurprisingly is on ubuntn 20.04. We've also seen issues like this on Debian 11.

I noticed:

https://stackoverflow.com/questions/64797838/libgcc-s-so-1-must-be-installed-for-pthread-cancel-to-work

and:

https://bugs.ams1.psf.io/issue42888

which led me to try:

ubuntu2004-ty-1:~$ wget https://bugs.ams1.psf.io/file50112/pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ echo $?
0
rpurdie@ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
libgcc_s.so.1 must be installed for pthread_cancel to work
Aborted (core dumped)
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
libgcc_s.so.1 must be installed for pthread_cancel to work
Aborted (core dumped)
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
libgcc_s.so.1 must be installed for pthread_cancel to work
Aborted (core dumped)

(1 in 4 success)

Then adding to the script:
import ctypes
libgcc_s = ctypes.CDLL('libgcc_s.so.1')

ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 --version
Python 3.8.10

I also tried this on debian 11:

debian11-ty-1:~$ python3 pthread_cancel_bug.py
libgcc_s.so.1 must be installed for pthread_cancel to work
Aborted
debian11-ty-1:~$ python3 --version
Python 3.9.2

where the above workaround using ctypes also seems to work.

Quoted 8 lines
Quoted 5 lines
Quoted 2 lines

I'm therefore tempted for python 3.8/3.9 to preload libgcc_s as a workaround for this...

Seems reasonable to me, as long as we can restrict it to a specific version range of python and have a nice comment explaining why

Patch tested, sent and I've applied it to older bitbake branches too in the hope that it helps some of Steve's autobuilder failures too.

I pulled the patch into my -nut branches when you posted it and have been testing too -- all looks fine from my perspective.

Thanks for merging!

Steve

#4 lore raw
In reply to Joshua Watt

It’s preloading the library so I think it
Won’t have unintended side effects therefore can be applied regardless I would imagine

Quoted 120 lines · Joshua Watt
Quoted 7 lines · Richard Purdie

I wanted to write down some thoughts on this which I have all the pieces handy.

We saw a nightly layer check fail for meta-openembedded:

https://autobuilder.yoctoproject.org/typhoon/#/builders/121/builds/1798/steps/21/logs/stdio

Quoted 2 lines

INFO:

======================================================================

Quoted 2 lines

INFO: ERROR: test_show_environment (common.CommonCheckLayer) INFO:

----------------------------------------------------------------------

Quoted 2 lines

INFO: Traceback (most recent call last):
File

"/home/pokybuild/yocto-worker/check-layer-nightly/build/scripts/lib/checklayer/cases/common.py", line 48, in test_show_environment

Quoted 1 line

check_command('Layer %s failed to show environment.' %

self.tc.layer['name'],

Quoted 1 line

File

"/home/pokybuild/yocto-worker/check-layer-nightly/build/scripts/lib/checklayer/__init__.py", line 287, in check_command

Quoted 7 lines

raise RuntimeError(msg)
RuntimeError: Layer meta-gnome failed to show environment.
Command: bitbake -e
Output:
libgcc_s.so.1 must be installed for pthread_cancel to work Aborted (core dumped)

Quoted 6 lines

which unsurprisingly is on ubuntn 20.04. We've also seen issues like this on Debian 11.

I noticed:

https://stackoverflow.com/questions/64797838/libgcc-s-so-1-must-be-installed-for-pthread-cancel-to-work

Quoted 7 lines

and:

https://bugs.ams1.psf.io/issue42888

which led me to try:

ubuntu2004-ty-1:~$ wget

https://bugs.ams1.psf.io/file50112/pthread_cancel_bug.py

Quoted 41 lines
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ echo $?
0
rpurdie@ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
libgcc_s.so.1 must be installed for pthread_cancel to work
Aborted (core dumped)
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
libgcc_s.so.1 must be installed for pthread_cancel to work
Aborted (core dumped)
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
libgcc_s.so.1 must be installed for pthread_cancel to work
Aborted (core dumped)

(1 in 4 success)

Then adding to the script:
import ctypes
libgcc_s = ctypes.CDLL('libgcc_s.so.1')

ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 pthread_cancel_bug.py
ubuntu2004-ty-1:~$ python3 --version
Python 3.8.10

I also tried this on debian 11:

debian11-ty-1:~$ python3 pthread_cancel_bug.py
libgcc_s.so.1 must be installed for pthread_cancel to work
Aborted
Quoted 7 lines
debian11-ty-1:~$ python3 --version
Python 3.9.2

where the above workaround using ctypes also seems to work.

I'm therefore tempted for python 3.8/3.9 to preload libgcc_s as a workaround for this...

Seems reasonable to me, as long as we can restrict it to a specific version range of python and have a nice comment explaining why

Quoted 9 lines

Cheers,

Richard

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group. View/Reply Online (#15709):
https://lists.openembedded.org/g/bitbake-devel/message/15709
Mute This Topic: https://lists.openembedded.org/mt/103383244/1997914
Group Owner: [email protected]
Unsubscribe: https://lists.openembedded.org/g/bitbake-devel/unsub [ [email protected]]
-=-=-=-=-=-=-=-=-=-=-=-