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

Segmentation Fault #185

Closed
Honeypot95 opened this issue Nov 22, 2019 · 9 comments
Closed

Segmentation Fault #185

Honeypot95 opened this issue Nov 22, 2019 · 9 comments

Comments

@Honeypot95
Copy link

My emacs segfaults when trying to run vterm, after compilation of the library.

Shortest way to get the segfault:

emacs -Q -l test.el
Fatal error 11: Segmentation fault
Backtrace:
emacs(+0x14efce)[0x563887fdbfce]
emacs(+0x55960)[0x563887ee2960]
emacs(+0x55d6a)[0x563887ee2d6a]
emacs(+0x14d658)[0x563887fda658]
emacs(+0x14d6d9)[0x563887fda6d9]
/lib/x86_64-linux-gnu/libpthread.so.0(+0x13f40)[0x7fd857f8ff40]
/home/iulian/.emacs.d/elpa/vterm-20191025.1349/vterm-module.so(emacs_module_init+0x3a)[0x7fd84b35c6ea]
emacs(+0x1d65fb)[0x5638880635fb]
emacs(+0x1d22bd)[0x56388805f2bd]
emacs(+0x1d294a)[0x56388805f94a]
emacs(+0x1b9f17)[0x563888046f17]
emacs(+0x1abd03)[0x563888038d03]
emacs(+0x1e0d39)[0x56388806dd39]
emacs(+0x1adf82)[0x56388803af82]
emacs(+0x1d1d18)[0x56388805ed18]
emacs(+0x1d2661)[0x56388805f661]
emacs(+0x1d294a)[0x56388805f94a]
emacs(+0x1b9f17)[0x563888046f17]
emacs(+0x1adf82)[0x56388803af82]
emacs(+0x1add5e)[0x56388803ad5e]
emacs(+0x1ae5b2)[0x56388803b5b2]
emacs(+0x1addb9)[0x56388803adb9]
emacs(+0x1af7fc)[0x56388803c7fc]
emacs(+0x1addb9)[0x56388803adb9]
emacs(+0x1cbeeb)[0x563888058eeb]
emacs(+0x1d1b10)[0x56388805eb10]
emacs(+0x1d2a73)[0x56388805fa73]
emacs(+0x1abd03)[0x563888038d03]
emacs(+0x1e0d39)[0x56388806dd39]
emacs(+0x1ae4ca)[0x56388803b4ca]
emacs(+0x1abc5f)[0x563888038c5f]
emacs(+0x1aeb29)[0x56388803bb29]
emacs(+0x1d2569)[0x56388805f569]
emacs(+0x1abd03)[0x563888038d03]
emacs(+0x1e0d39)[0x56388806dd39]
emacs(+0x1abc5f)[0x563888038c5f]
emacs(+0x1e0d39)[0x56388806dd39]
emacs(+0x1abc5f)[0x563888038c5f]
emacs(+0x1e0d39)[0x56388806dd39]
emacs(+0x1ad980)[0x56388803a980]
emacs(+0x1adc86)[0x56388803ac86]
...
Segmentation fault (core dumped)


cat test.el
require 'package)
(setq package-enable-at-startup nil)
(add-to-list 'package-archives '("melpa" . "http://melpa.org/packages/"))
(package-initialize)

(unless (package-installed-p 'use-package)
  (package-refresh-contents)
  (package-install 'use-package))

(eval-when-compile
  (require 'use-package))
(require 'bind-key)

(use-package vterm
  :load-path  "."
)
emacs --version
GNU Emacs 27.0.50

cmake --version
cmake version 3.13.4

libtool --version
libtool (GNU libtool) 2.4.6

git log | head -1
commit 21b54c750b65eed9f195a2544f3a1782626fc5fe

I am not sure what else to add, so please guide me if there are more things to be added.

@jixiuf
Copy link
Collaborator

jixiuf commented Nov 23, 2019

#147

@Honeypot95
Copy link
Author

Honeypot95 commented Nov 26, 2019

My system-configuration-options says:

Its value is
"--build=x86_64-linux-gnu --prefix=/usr '--includedir=${prefix}/include' '--mandir=${prefix}/share/man' '--infodir=${prefix}/share/info' --sysconfdir=/etc --localstatedir=/var --disable-silent-rules '--libdir=${prefix}/lib/x86_64-linux-gnu' '--libexecdir=${prefix}/lib/x86_64-linux-gnu' --disable-maintainer-mode --disable-dependency-tracking --prefix=/usr --sharedstatedir=/var/lib --program-suffix=-snapshot --with-modules=yes --with-x=yes --with-x-toolkit=gtk3 --with-xwidgets=yes 'CFLAGS=-g -O2 -fdebug-prefix-map=<...>/emacs-snapshot-99415=. -fstack-protector-strong -Wformat -Werror=format-security' 'CPPFLAGS=-Wdate-time -D_FORTIFY_SOURCE=2' 'LDFLAGS=-Wl,-Bsymbolic-functions -Wl,-z,relro'"

, which includes --with-modules. But it is still installed from the Ubuntu PPA.

@jixiuf
Copy link
Collaborator

jixiuf commented Nov 26, 2019

(message module-file-suffix)

@Honeypot95
Copy link
Author

(message module-file-suffix)
returns
.so

@jixiuf
Copy link
Collaborator

jixiuf commented Dec 5, 2019

#66 (comment)
can you build a docker image for me like this to reproduce this

@Honeypot95
Copy link
Author

Yes. I actually got some free time and I wanted to try to find the problem, compiling the actual sources that are in the ubuntu repositories, because the rules there seem to be the problem.
I will also make the docker image that reproduces the problem then.

@Honeypot95
Copy link
Author

The dockerfile didn't work, because cmake version is not >11 in ubuntu18.04, which is the latest from docker.io apparently.
So I made this Dockerfile:

# Build and run
# docker build -t vterm .
# docker run -t -i vterm


FROM docker.io/ubuntu:latest
RUN apt-get update
RUN apt-get -y install software-properties-common # install add-apt-repository command
RUN apt-get -y install apt-transport-https ca-certificates gnupg wget

RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | apt-key add -

# http://ubuntuhandbook.org/index.php/2019/02/install-gnu-emacs-26-1-ubuntu-18-04-16-04-18-10/
RUN add-apt-repository ppa:kelleyk/emacs # for emacs26  (default emacs is not compile with module support)
RUN apt-get update

RUN apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' # this is to install cmake > 11 on ubuntu 18.04, the latest at this time
RUN apt-get update

RUN apt-get -y install cmake make git libtool-bin

RUN apt-get -y install emacs26-nox #run emacs26
RUN mkdir -p ~/.emacs.d/

RUN echo "(require 'package)" > ~/.emacs.d/init.el
RUN echo "(add-to-list 'package-archives '(\"melpa\" . \"http://melpa.org/packages/\"))" >> ~/.emacs.d/init.el
RUN echo "(or (file-exists-p package-user-dir) (package-refresh-contents))" >> ~/.emacs.d/init.el
RUN echo "(package-initialize)" >> ~/.emacs.d/init.el
RUN echo "(package-install 'vterm)" >> ~/.emacs.d/init.el
RUN echo "(let (vterm-install) (require 'vterm))" >> ~/.emacs.d/init.el

which succesfully compiles vterm, but the problem does not reproduce.

I will try to play around with the Dockerfile some more.

@Honeypot95
Copy link
Author

Yes, so apparently the problem does not lie in the official ppa for ubuntu, but in the ubuntu emacs lisp ppa (https://launchpad.net/~ubuntu-elisp/+archive/ubuntu/ppa). I used this to install the latest emacs (emacs-snapshot) built daily, and when I tried this on the docker image, it crashed.

The final Dockerfiles is this:

# Build and run
# docker build -t vterm .
# docker run -t -i vterm


FROM docker.io/ubuntu:latest
RUN apt-get update
RUN apt-get -y install software-properties-common # install add-apt-repository command
RUN apt-get -y install apt-transport-https ca-certificates gnupg wget

RUN wget -O - https://apt.kitware.com/keys/kitware-archive-latest.asc 2>/dev/null | apt-key add -

# http://ubuntuhandbook.org/index.php/2019/02/install-gnu-emacs-26-1-ubuntu-18-04-16-04-18-10/
RUN add-apt-repository ppa:kelleyk/emacs # for emacs26  (default emacs is not compile with module support)
RUN apt-get update

RUN apt-add-repository 'deb https://apt.kitware.com/ubuntu/ bionic main' # this is to install cmake > 11 on ubuntu 18.04, the latest at this time
RUN apt-get update

RUN apt-get -y install cmake make git libtool-bin

# add the emacs-snapshot for ubuntu ppa
RUN add-apt-repository ppa:ubuntu-elisp/ppa
RUN apt-get update

RUN apt-get -y install emacs-snapshot #run emacs-snapshot

# RUN apt-get -y install emacs26 #run emacs26
RUN mkdir -p ~/.emacs.d/

RUN echo "(require 'package)" > ~/.emacs.d/init.el
RUN echo "(add-to-list 'package-archives '(\"melpa\" . \"http://melpa.org/packages/\"))" >> ~/.emacs.d/init.el
RUN echo "(or (file-exists-p package-user-dir) (package-refresh-contents))" >> ~/.emacs.d/init.el
RUN echo "(package-initialize)" >> ~/.emacs.d/init.el
RUN echo "(package-install 'vterm)" >> ~/.emacs.d/init.el
RUN echo "(let (vterm-install) (require 'vterm))" >> ~/.emacs.d/init.el

I assume this is not a vterm problem, as it does not reproduce on the standard ppa and neither when compiling emacs from source, so I should open an issue on the ppa itself.

i can now close this if you want.

@jixiuf
Copy link
Collaborator

jixiuf commented Dec 6, 2019

feel free to close

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

No branches or pull requests

2 participants