Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to hugify the .text section #8168

Closed
marcodepolo opened this issue Apr 4, 2018 · 5 comments
Closed

Failed to hugify the .text section #8168

marcodepolo opened this issue Apr 4, 2018 · 5 comments

Comments

@marcodepolo
Copy link

HHVM Version

HipHop VM 3.25.2 (rel)
Compiler: 1522444052_385014031
Repo schema: e0b7305f6fd0419bc95890eef648f579bca7189c

Operating System and Version

official docker image php:5-6-apache-jessie

Standalone code, or other way to reproduce the problem

relevant part of the docker image where hhvm is installed

FROM php:5.6-apache-jessie

ENV DEBIAN_FRONTEND noninteractive

the pub key was different until recently changed. not sure if this is related to the issue

RUN apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xB4112585D386EB94 &&
echo deb http://dl.hhvm.com/debian jessie main | tee /etc/apt/sources.list.d/hhvm.list &&
echo deb http://ftp.debian.org/debian jessie-backports main | tee /etc/apt/sources.list.d/backports.list

RUN apt-get update && apt-get install -y
libfreetype6-dev
libjpeg62-turbo-dev
libpng12-dev
hhvm
supervisor
cron
mysql-client
rsync
python-certbot-apache -t jessie-backports
locales
gettext
inkscape
openssh-client
sshpass
&& docker-php-ext-configure mysql --with-mysql=mysqlnd
&& docker-php-ext-configure mysqli --with-mysqli=mysqlnd
&& docker-php-ext-install -j$(nproc) mysql
&& docker-php-ext-install -j$(nproc) mysqli
&& docker-php-ext-install -j$(nproc) pdo
&& docker-php-ext-install -j$(nproc) pdo_mysql
&& docker-php-ext-configure gd --with-freetype-dir=/usr/include/ --with-jpeg-dir=/usr/include/
&& docker-php-ext-install -j$(nproc) gd

[...] bunch of other config for the docker image

hhvm launched via supervisor

[supervisord]
nodaemon=true
loglevel=debug

[program:hhvm]
command=/usr/bin/hhvm --config /etc/hhvm/php.ini --config /etc/hhvm/server.ini --user www-data --mode daemon -vPidFile=/var/run/hhvm/pid
stdout_logfile=/var/log/%(program_name)s/error.log
stderr_logfile=/var/log/%(program_name)s/error.log

Expected result

hhvm up and running

Actual result

hhvm crashes at startup with following messages in the log file

cap_set_proc failed: Operation not permitted
Failed to hugify the .text section

This setup has been working perfectly for about 2 years, until my laptop got stolen. I restored a backup of my sources to a new laptop and attempted to rebuild the docker image but started running in various issues.
First the pub key for hhvm had changed and wasnt available anymore. I found this one online, it seems to be working (hope this helps someone).
Then I had to remove package php_gettext from the install command as it had no install candidate, which I don't understand since I am not using the latest version of php but rather an image tagged to a precise version.
Finally, once hhvm managed to install and launch, it crashes complaining about failing to "hugify the .text section" which I couldnt find online except in hhvm source code.

I'm getting the feeling it might have to do with the fact that my new laptop has a more recent processor that has support for huge pages which get detected, but that somehow this fails to start.

Is there anyway to debug this further or to simply switch off that test ?

@marcodepolo
Copy link
Author

For additional info, so far I was using this version without issue (but on a different computer)
HipHop VM 3.18.2 (rel)
Compiler: tags/HHVM-3.18.2-0-g1e28cfedefb439554cae05f1721bd6ea60c31839
Repo schema: 7aa473404e83b5cd2d1a53c6f3200a3a9012f2f1

@fredemmott
Copy link
Contributor

GPG key update: https://hhvm.com/blog/2017/11/14/gpg-key-migration.html - definitely unrelated.

The message you are seeing is likely unrelated to the crash: it's only logged as a warning. Most likely it just coincidentally the last message before it exit.

Debugging steps include:

  • check dmesg in the container
  • try to reproduce the issue outside of server mode - e.g. when running unit tests - and look at more detailed output
  • enable core dumps, or run in gdb, and get a backtrace
  • you can confirm whether or not it is huge pages with the hhvm.max_hot_text_huge_pages=0 ini setting

@marcodepolo
Copy link
Author

Thank you for your answer. I think you are right that it is unrelated to the crash.
I tried to change the install command to reference specifically 3.18 and hhvm was able to start normally

RUN apt-key adv --recv-keys --keyserver hkp://keyserver.ubuntu.com:80 0xB4112585D386EB94
&& echo deb http://dl.hhvm.com/debian jessie-lts-3.18 main | tee /etc/apt/sources.list.d/hhvm.list

However, I also tried to start with 3.21 and 3.24 and in both cases hhvm crashed at startup, without the message about hugify though, which indicate the issue is indeed unrelated to that message.

I will try your suggestions and see where that gets me

@ghost
Copy link

ghost commented Jun 12, 2018

same problem here in docker container (debian 9)

using /etc/init.d/hhvm start the same error occurred both in server and daemon mode

Failed to hugify the .text section
cap_set_proc failed: Operation not permitted

when i add hhvm.max_hot_text_huge_pages = 0 in config file, still has one error

cap_set_proc failed: Operation not permitted

and run HHVM as root user or set docker container privileged=true , everything is ok.
ENV HHVM_DISABLE_NUMA true was in my Dockerfile.


SOLVED

sed -i 's|start-stop-daemon|start-stop-daemon --chuid $RUN_AS_USER:$RUN_AS_GROUP|g' /etc/init.d/hhvm

@lexidor
Copy link
Collaborator

lexidor commented Jan 13, 2022

I am going over old issues on this repository, to see which ones apply to the current versions of hhvm.

Newer versions of hhvm run fine in Docker. No changes required. The are even official docker images available.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants