-
Notifications
You must be signed in to change notification settings - Fork 58
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
[BUG] mlx_terminate segfaults #133
Comments
Well that's a whole new error i've never seen before. - docker build -t mlx42-test .
- docker run -it mlx42-test
Failed to initialize GLFW Which makes sense as there is no display to launch with docker, even with |
Yes, there was a lot of work to overcome 'Failed to initialize GLFW' for me too :D I used xquartz and
|
Ok so this took a bit of digging but I found a docker file that handles exactly all of this stuff. I suggest forking: https://github.com/BoundfoxStudios/docker-opengl FROM boundfoxstudios/opengl:latest
# Install necessary dependencies
RUN apk update && apk add --no-cache gcc g++ make openssl-dev cmake git bash glfw-dev mesa-dev git
# Clone the repo
RUN git clone https://github.com/codam-coding-college/MLX42.git /MLX42
# Copy your minilibx.c file
COPY minilibx.c /tmp
# Set the working directory
WORKDIR /tmp
# Build the project
RUN cd /MLX42 && \
cmake -B build && \
cmake --build build -j4
# Set the default command to compile and run your program
CMD gcc /tmp/minilibx.c -g /MLX42/build/libmlx42.a -I/MLX42/include -ldl -lglfw -pthread -lm && ./a.out I modified the # include "MLX42/MLX42.h"
# include <stdio.h>
# include <stdlib.h>
# define WIDTH 512
# define HEIGHT 512
int main(void)
{
mlx_t *mlx;
mlx_set_setting(MLX_HEADLESS, true);
if (!(mlx = mlx_init(WIDTH, HEIGHT, "MLX42", true)))
{
puts(mlx_strerror(mlx_errno));
return(EXIT_FAILURE);
}
printf("mlx_init: %p\n", mlx);
} And instead of an error now you get: Starting Xvfb
Waiting for Xvfb (PID: 7) to be ready...
Xvfb is running.
mlx_init: 0xffff915dd1b0
Waiting for Xvfb (PID: 7) to shut down... |
I tested it with the program in the If this works for you too i'll add it to the readme or create a Docker example so in the future others can look into how to make it work with Docker and avoid doing all this annoying Xvfb non-sense. |
I assume for now, yes, if not, please re-open. |
NOTE
Before creating a bug report! Make sure you git pull from master and check if the bug still exists!
Describe the bug
mlx_terminate segfaults with minimal program
To Reproduce
Expected behavior
Either open a window and quickly close it, or terminate with an error
Desktop (please complete the following information):
Additional context
I first had these errors on our linux cluster computers:
all on the same code. I tried to find the issue with address sanitizer, but then the bug goes away and never comes back, even without the sanitizer. So then I couldn't reproduce it anymore and I tried a docker. This segfault could be the issue. Maybe there are multiple issues.
The text was updated successfully, but these errors were encountered: