Skip to content

libgc: 'pthread_kill failed at suspend' when trying to compile/use GNU Guile #3360

@RobertCochran

Description

@RobertCochran

Problem description
When trying to compile or run the test suite for GNU Guile, occasionally a message gets written out - phtread_kill failed at suspend - and whatever process was running gets killed. With luck, it is possible to re-run the make portion of the build until you get lucky enough not to run into this error, but the problem is still exhibited elsewhere, ie running the test suite via check-guile. Based on the nature of the issue, it seems like this has a chance of happening any time a GC is triggered.

(See this issue where it was happening in Embeddable Common Lisp: #183 . I was able to install Quicklisp without any trouble, but this was possibly due to using a built-in libgc.)

Steps to reproduce

# Install the packages necessary to build Guile
pkg install clang git make libtool gettext flex android-support libgmp-dev libgc-dev readline-dev autoconf automake
# There may be more that I'm currently forgetting... sorry
# Reset directory to known base
cd ~
# Pull Guile repo
git clone git://git.sv.gnu.org/guile.git
# If the git protocol is unavailable, use http: git clone http://git.sv.gnu.org/r/guile.git
cd guile
# Use the latest stable branch, stable-2.2
git fetch origin stable-2.2
git checkout stable-2.2
# Apply the patch from here: https://lists.gnu.org/archive/html/bug-gnulib/2018-05/msg00119.html
# I have it saved as 'fix-langinfo.patch' locally
# NOTE: This is in upstream gnulib; the Guile folks need to update their in-tree copy
git apply fix-langinfo.patch
# Remove the 'backup' definition of `nl_langinfo` in gnulib.
# Guile tries to auto-detect it, but doesn't realize that it is
# provided by libandroid-support and fails to find it.
# It thus tries to define its own, which causes the compiler
# to balk about redefinition. The correct way to do this would
# be to fix the feature detection parts, but in the interest
# of ease, just directly disable it by preprocessor-conditioning it out.
sed -ibak "s/#else/#endif\n#if 0\n/" lib/nl_langinfo.c
# Run configure. Explicitly specific external libraries that must be used, as well as CC.
# Ensure that Guile is compiled with the Android-required PIC option
CC='clang' LIBS='-latomic -landroid-support' ./configure --with-pic
# Build Guile. The error is likely to occur. At this point, you can get away with running
# `make` again and again and eventually it'll entirely succeed.
# Be warned that some key files in the bootstrap process take a little while to build.
# Optinally, specify a -jX argument (X being number of concurrent processes) to speed
# up compilation, and maybe -k if you want to try and get the build to complete
# (this makes it complete as much as it can, even if there's an error)
make
# If you've gotten make to finish, then run the test suite. I've not gotten it even halfway through the
# tests without the error, and it's unlikely you'll have enough luck to do so. It will probably fail every time.
./check-guile

Expected behavior
GNU Guile successfully builds without having to restart the build, and the test suite runs to completion.

Additional information

$ termux-info
Updatable packages:
All packages up to date
System information:
Linux localhost 3.18.14-8761055 #1 SMP PREEMPT Wed Jul 20 08:48:18 KST 2016 armv8l Android
Termux-packages arch:
arm
Android version:
6.0.1
Device manufacturer:
samsung
Device model:
SM-T580
$ 

Depending on problem, additional information may be requested:

  1. Android warning/error log: logcat -d "*:W".
  2. Output of strace: strace -fv -s 2048 -o strace.log {program name}.
  3. If program write it's own log files, you may need to attach them.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions