DLR-RM / AugmentedAutoencoder

Official Code: Implicit 3D Orientation Learning for 6D Object Detection from RGB Images
MIT License
339 stars 97 forks source link

Running into "Segmentation fault" when creating glfw window #5

Closed ming-c closed 5 years ago

ming-c commented 5 years ago

I couldn't run the script because of a Segmentation Fault caused by glfw.CreateWindow(1, 1, "", None) in file glfw_off_screen_context.py (line 14).

The message in the terminal is

Process finished with exit code 139 (interrupted by signal 11: SIGSEGV)

System Info

And actually it dose't seem like creating a window here is the key to the problem, 'cause I also create a python script with following lines:

import logging as log
import os

import os
import numpy as np
from OpenGL.GL import *

import gl_utils as gu
from pysixd import misc

import numpy as np
import time
import hashlib
import glob
import os
import progressbar
import cv2

from OpenGL.GL import *
import cyglfw3 as glfw
class OffscreenContext(object):
    def __init__(self):
        assert glfw.Init(), 'Glfw Init failed!'
        glfw.WindowHint(glfw.VISIBLE, False);
        self._offscreen_context = glfw.CreateWindow(1, 1, "", None)
        assert self._offscreen_context, 'Could not create Offscreen Context!'
        glfw.MakeContextCurrent(self._offscreen_context)
        print("All good!")

if __name__ == '__main__':
    context = OffscreenContext()

This file runs perfectly fine without any segmentation fault.

Any suggestion?

Cheers

ming-c commented 5 years ago

Get around it by commenting line assert glfw.Init(), Glfw Init failed! (line 12 in glfw_offscreen_context.py). It's probably not the ultimate (and correct) solution but anyway the Segment fault didn't show up anymore.