pthread_create failed is printed some times when running a snap

Bug #1661863 reported by Leo Arias
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
snapd
Fix Released
Critical
John Lenton

Bug Description

During the past week, Alan, myself and cgull [1] have seen this error printed intermittently when we run a snap:

runtime/cgo: pthread_create failed: Resource temporarily unavailable

I'll pay more attention and update this bug if I find it again. Reporting in the meantime to see if somebody else can share more information.

[1] https://github.com/mobile-shell/mosh/pull/854#issuecomment-277424563

Changed in snapd:
importance: Undecided → Critical
Revision history for this message
Felipe Reyes (freyes) wrote :

At the moment I'm seeing this issue with a snap I'm developing/testing, when I changed the confinement method from strict to classic the error appeared.

Some details of my system:

ii snapd 2.22.3+16.10 amd64 Tool to interact with Ubuntu Core Snappy.

$ apt-cache policy snapd
snapd:
  Installed: 2.22.3+16.10
  Candidate: 2.22.3+16.10
  Version table:
 *** 2.22.3+16.10 500
        500 http://archive.ubuntu.com/ubuntu yakkety-updates/main amd64 Packages
        100 /var/lib/dpkg/status
     2.16+16.10ubuntu1 500
        500 http://archive.ubuntu.com/ubuntu yakkety/main amd64 Packages
$ uname -a
Linux alienware.lan 4.8.0-38-generic #41-Ubuntu SMP Wed Feb 8 14:27:17 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux

This is the output when running the command:
$ bundletester -h
runtime/cgo: pthread_create failed: Resource temporarily unavailableruntime/cgo: pthread_create failed: Resource temporarily unavailable
runtime/cgo: runtime/cgo: runtime/cgo: pthread_create failed: Resource temporarily unavailable
runtime/cgo: pthread_create failed: Resource temporarily unavailableruntime/cgo: runtime/cgo: runtime/cgo: runtime/cgo: pthread_create failed: Resource temporarily unavailable
runtime/cgo: pthread_create failed: Resource temporarily unavailable
runtime/cgo: pthread_create failed: Resource temporarily unavailable
runtime/cgo: pthread_create failed: Resource temporarily unavailable
runtime/cgo: pthread_create failed: Resource temporarily unavailable
runtime/cgo: runtime/cgo: pthread_create failed: Resource temporarily unavailable
runtime/cgo: runtime/cgo: runtime/cgo: pthread_create failed: Resource temporarily unavailable
runtime/cgo: pthread_create failed: Resource temporarily unavailableruntime/cgo: pthread_create failed: Resource temporarily unavailable
runtime/cgo: pthread_create failed: Resource temporarily unavailable
runtime/cgo: runtime/cgo: pthread_create failed: Resource temporarily unavailable
runtime/cgo: runtime/cgo: pthread_create failed: Resource temporarily unavailable
runtime/cgo: runtime/cgo: runtime/cgo: runtime/cgo: pthread_create failed: Resource temporarily unavailable

I'm attaching the output of strace for the snap-confine process ( root 8504 103 0.0 13276 820 ? R 13:20 9:41 /usr/lib/snapd/snap-confine --classic snap.bundletester.bundletester /usr/lib/snapd/snap-exec bundletester -h )

Revision history for this message
Felipe Reyes (freyes) wrote :
Revision history for this message
Felipe Reyes (freyes) wrote :

After some (undetermined) time the command gave up and printed:

...
runtime/cgo: pthread_create failed: Resource temporarily unavailable
runtime/cgo: runtime/cgo: runtime/cgo: pthread_create failed: Resource temporarily unavailable
runtime/cgo: pthread_create failed: Resource temporarily unavailable
need to run as root or suid

Revision history for this message
Felipe Reyes (freyes) wrote :

I could make it work, I had to change the command, originally I had this:

apps:
  bundletester:
    command: bundletester

If add the prefix 'bin/' to the command, it successfully gets executed

apps:
  bundletester:
    command: bin/bundletester

I could find this as the root cause when running strace and filtering for execve syscall and I could notice how it was looping trying to run bundletester and going from the wrapper to wrapper http://pastebin.ubuntu.com/24055202/

Zygmunt Krynicki (zyga)
Changed in snapd:
status: New → Triaged
Revision history for this message
Zygmunt Krynicki (zyga) wrote :

There are two bugs here (both exist separately):

- in certain situations snapcraft will create an exec loop
- pthread_create messages can be emited by certain combination of golang/kernel

I'll try to find them and dupe this bug as one of the two.

John Lenton (chipaca)
Changed in snapd:
assignee: nobody → John Lenton (chipaca)
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.