tweag / tweag/HaskellR

ihaskell-inline-r: unhandled ELF relocation error on initialization

Open
#331 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Haskell
Stars
587
Forks
42
PR merge metrics
No merged PRs in 30d

Description

when this cell from the ihaskell-inline-r tutorial notebook

import qualified H.Prelude as H
H.initialize H.defaultConfig

is executed, the kernel crashes with an unhandled ELF relocation error.

[I 13:01:19.673 NotebookApp] Starting buffering for 40c8b7e3-1274-4d9d-848c-833849772c61:d83e18f345a24386a5fd27413041e783
ihaskell: /home/jovyan/HaskellR/.stack-work/install/x86_64-linux/lts-10.2/8.2.2/lib/x86_64-linux-ghc-8.2.2/inline-r-0.9.2-L1KdC8sOsmwVIDNVdfxkQ/libHSinline-r-0.9.2-L1KdC8sOsmwVIDNVdfxkQ.a: unhandled ELF relocation(RelA) type 42

ihaskell: /home/jovyan/HaskellR/.stack-work/install/x86_64-linux/lts-10.2/8.2.2/lib/x86_64-linux-ghc-8.2.2/inline-r-0.9.2-L1KdC8sOsmwVIDNVdfxkQ/libHSinline-r-0.9.2-L1KdC8sOsmwVIDNVdfxkQ.a: unknown symbol `isRInitialized'
ihaskell: ^^ Could not load 'inlinezmrzm0zi9zi2zmL1KdC8sOsmwVIDNVdfxkQ_LanguageziRziInstance_defaultConfig_closure', dependency unresolved. See top entry above.

ihaskell: /home/jovyan/HaskellR/.stack-work/install/x86_64-linux/lts-10.2/8.2.2/lib/x86_64-linux-ghc-8.2.2/inline-r-0.9.2-L1KdC8sOsmwVIDNVdfxkQ/libHSinline-r-0.9.2-L1KdC8sOsmwVIDNVdfxkQ.a: unhandled ELF relocation(RelA) type 42

ihaskell: /home/jovyan/HaskellR/.stack-work/install/x86_64-linux/lts-10.2/8.2.2/lib/x86_64-linux-ghc-8.2.2/inline-r-0.9.2-L1KdC8sOsmwVIDNVdfxkQ/libHSinline-r-0.9.2-L1KdC8sOsmwVIDNVdfxkQ.a: unhandled ELF relocation(RelA) type 42

ihaskell: 
[I 13:01:28.076 NotebookApp] KernelRestarter: restarting kernel (1/5), keep random ports
WARNING:root:kernel b18f0a81-2092-4dbd-8bae-1b31708b8e2f restarted

reproduce

(a) build the following Dockerfile [docker build -t haskellr:latest .]
(b) run the image [docker run -it -p 8888:8888 haskellr:latest]
(c) open /HaskellR/IHaskell/examples/tutorial-ihaskell-inline-r.ipynb and execute the first two cells

FROM fpco/stack-build:lts-11.17

# Install all necessary Ubuntu packages
RUN apt-get update && apt-get install -y python3-pip libgmp-dev libmagic-dev libtinfo-dev libzmq3-dev libcairo2-dev libpango1.0-dev libblas-dev liblapack-dev gcc g++ r-base r-base-core && \
    rm -rf /var/lib/apt/lists/*

RUN R -e "install.packages(c('ggplot2'), repos='http://cran.rstudio.com/')"

# Install Jupyter notebook
RUN pip3 install -U jupyter

# setup the haskell environment
ENV LANG en_US.UTF-8
ENV NB_USER jovyan
ENV NB_UID 1000
ENV HOME /home/${NB_USER}

RUN adduser --disabled-password \
    --gecos "Default user" \
    --uid ${NB_UID} \
    ${NB_USER}

# Set up a working directory for HaskellR
WORKDIR ${HOME}

USER root
RUN chown -R ${NB_UID} ${HOME}
USER ${NB_UID}

RUN git clone https://github.com/tweag/HaskellR.git

WORKDIR ${HOME}/HaskellR

USER root
RUN chown -R ${NB_UID} ${HOME}
USER ${NB_UID}

RUN stack setup
RUN stack build && stack install
RUN stack exec -- ihaskell install --stack

USER root
RUN chown -R ${NB_UID} ${HOME}
USER ${NB_UID}

EXPOSE 8888

# Run the notebook
CMD ["stack", "exec", "--", "jupyter", "notebook", "--ip", "0.0.0.0"]

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the crash by building the provided Dockerfile, starting Jupyter, and executing the first two cells of HaskellR/IHaskell/examples/tutorial-ihaskell-inline-r.ipynb. Start with H.initialize H.defaultConfig and the reported inline-r ELF loading errors; done means the kernel initializes without the relocation, unknown-symbol, or restart errors.

Written by the indexing model from the issue text.

Assessment

Tech stack
docker, haskell, jupyter-notebook, r
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.