# Segmentation fault on ARMv7 (Linaro 11.10)

**URL:** <https://discourse.glfw.org/t/segmentation-fault-on-armv7-linaro-11-10/14>\
**Category:** support\
**Created:** [November 2, 2013, 2:29pm UTC](https://discourse.glfw.org/t/segmentation-fault-on-armv7-linaro-11-10/14 "2013-11-02T14:29:41Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [November 2, 2013, 2:29pm UTC](https://discourse.glfw.org/t/segmentation-fault-on-armv7-linaro-11-10/14/1 "2013-11-02T14:29:41Z")

</div>

**[killkrt](https://sourceforge.net/u/killkrt/)** wrote on [Saturday, November 02, 2013](https://sourceforge.net/p/glfw/discussion/247562/thread/6bca3e40/#c6d3):

Hi,

I’ve successfully compiled GLFW on Linaro 11.10 (on a UDOO board), but when I try to execute a basic test ([http://www.glfw.org/documentation.html](http://www.glfw.org/documentation.html)) I got a segmentation fault just after the call to **glfwCreateWindow**.  
Of course no of the examples included in the git package is running.

How can I solve it? Maybe there is some options in the make process for GLFW on an AMRv7 processor?

Thank you.

P.S.:  
As specified in the subject I’m running Linaro 11.10 for an ARMv7 (UDOO board), gcc version 4.6.1

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [November 3, 2013, 12:03pm UTC](https://discourse.glfw.org/t/segmentation-fault-on-armv7-linaro-11-10/14/2 "2013-11-03T12:03:44Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Sunday, November 03, 2013](https://sourceforge.net/p/glfw/discussion/247562/thread/6bca3e40/#970f):

It would be very useful to see the call stack for the crash.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [November 3, 2013, 4:08pm UTC](https://discourse.glfw.org/t/segmentation-fault-on-armv7-linaro-11-10/14/3 "2013-11-03T16:08:36Z")

</div>

**[killkrt](https://sourceforge.net/u/killkrt/)** wrote on [Sunday, November 03, 2013](https://sourceforge.net/p/glfw/discussion/247562/thread/6bca3e40/#0b23):

Here it is:

0 0x2ac2ec18 in \_\_glXInitializeVisualConfigFromTags () from /usr/lib/libGL.so.1  
1 0x2ac2d4e8 in glXChooseFBConfigSGIX () from /usr/lib/libGL.so.1  
2 0x000147b4 in chooseFBConfig ()  
3 0x00014e40 in \_glfwCreateContext ()  
4 0x00013d42 in \_glfwPlatformCreateWindow ()  
5 0x0000e996 in glfwCreateWindow ()  
6 0x0000ca82 in main ()

Thank you.

P.S.:  
More details about the board used: [http://www.udoo.org/features/](http://www.udoo.org/features/)

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [November 3, 2013, 8:41pm UTC](https://discourse.glfw.org/t/segmentation-fault-on-armv7-linaro-11-10/14/4 "2013-11-03T20:41:18Z")

</div>

**[killkrt](https://sourceforge.net/u/killkrt/)** wrote on [Sunday, November 03, 2013](https://sourceforge.net/p/glfw/discussion/247562/thread/6bca3e40/#3ddf):

Anyway I noticed that for UDOO I should select glesv2 as client API.

So I used ccmake to change this option, cleaned the CMake cache, and now I got another problem. When I compile GLFX I got an error including “/usr/include/EGL/eglvivante.h”, it complaints “Platform not recognized”.  
Giving a brief overview to that include it seems that it cannot identify my architecture, so the error is generated.

So I tried to force Linux as system and ARMV7 as architecture setting the option CMAKE\_C\_FLAGS as follow:  
-march=armv7-a -DLINUX=1

But I got a lot of errors in function \_glfwCreateContext about undeclared value (such as: “EGL\_CONTEXT\_OPENGL\_CORE\_PROFILE\_BIT\_KHR”…)

Could you help me?

Thank you.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [November 3, 2013, 10:30pm UTC](https://discourse.glfw.org/t/segmentation-fault-on-armv7-linaro-11-10/14/5 "2013-11-03T22:30:57Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Sunday, November 03, 2013](https://sourceforge.net/p/glfw/discussion/247562/thread/6bca3e40/#f6b6):

Do you really mean [GLFX](https://code.google.com/p/glfx/) or did you misspell GLFW?

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [November 3, 2013, 10:39pm UTC](https://discourse.glfw.org/t/segmentation-fault-on-armv7-linaro-11-10/14/6 "2013-11-03T22:39:20Z")

</div>

**[killkrt](https://sourceforge.net/u/killkrt/)** wrote on [Sunday, November 03, 2013](https://sourceforge.net/p/glfw/discussion/247562/thread/6bca3e40/#d3b9):

Of course it was a typo, I meant GLFW!

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [November 3, 2013, 10:57pm UTC](https://discourse.glfw.org/t/segmentation-fault-on-armv7-linaro-11-10/14/7 "2013-11-03T22:57:51Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Sunday, November 03, 2013](https://sourceforge.net/p/glfw/discussion/247562/thread/6bca3e40/#7949):

It might be including its own `eglext.h`, which would then block the up-to-date version that ships with GLFW. It’s difficult to know without more information. Seeing the actual errors might help.

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [November 4, 2013, 9:57pm UTC](https://discourse.glfw.org/t/segmentation-fault-on-armv7-linaro-11-10/14/8 "2013-11-04T21:57:59Z")

</div>

**[killkrt](https://sourceforge.net/u/killkrt/)** wrote on [Monday, November 04, 2013](https://sourceforge.net/p/glfw/discussion/247562/thread/6bca3e40/#3234):

These are the errors I got if I only set glesv2 as client API:

```
[5%] Building C object src/CMakeFiles/glfw.dir/clipboard.c.o
In file included from /usr/include/EGL/eglplatform.h:38:0,
                from /usr/include/EGL/egl.h:34,
                from /home/ubuntu/development/armika/deps/glfw/src/egl_platform.h:31,
                from /home/ubuntu/development/armika/deps/glfw/src/x11_platform.h:57,
                from /home/ubuntu/development/armika/deps/glfw/src/internal.h:69,
                from /home/ubuntu/development/armika/deps/glfw/src/clipboard.c:27:
/usr/include/EGL/eglvivante.h:244:2: error: #error "Platform not recognized"
make[2]: ** [src/CMakeFiles/glfw.dir/clipboard.c.o] Error 1
make[1]: ** [src/CMakeFiles/glfw.dir/all] Error 2
make: ** [all] Error 2

And these are the errors if I also set my CMAKE_C_FLAGS to -march=armv7-a -DLINUX=1:

[100%] Building C object src/CMakeFiles/glfw.dir/egl_context.c.o
/home/ubuntu/development/armika/deps/glfw/src/egl_context.c: In function ‘_glfwCreateContext’:
/home/ubuntu/development/armika/deps/glfw/src/egl_context.c:347:25: error: ‘EGL_CONTEXT_OPENGL_CORE_PROFILE_BIT_KHR’ undeclared (first use in this function)
/home/ubuntu/development/armika/deps/glfw/src/egl_context.c:347:25: note: each undeclared identifier is reported only once for each function it appears in
/home/ubuntu/development/armika/deps/glfw/src/egl_context.c:349:25: error: ‘EGL_CONTEXT_OPENGL_COMPATIBILITY_PROFILE_BIT_KHR’ undeclared (first use in this function)
/home/ubuntu/development/armika/deps/glfw/src/egl_context.c:352:26: error: ‘EGL_CONTEXT_OPENGL_FORWARD_COMPATIBLE_BIT_KHR’ undeclared (first use in this function)
/home/ubuntu/development/armika/deps/glfw/src/egl_context.c:355:26: error: ‘EGL_CONTEXT_OPENGL_DEBUG_BIT_KHR’ undeclared (first use in this function)
/home/ubuntu/development/armika/deps/glfw/src/egl_context.c:361:28: error: ‘EGL_NO_RESET_NOTIFICATION_KHR’ undeclared (first use in this function)
/home/ubuntu/development/armika/deps/glfw/src/egl_context.c:363:28: error: ‘EGL_LOSE_CONTEXT_ON_RESET_KHR’ undeclared (first use in this function)
/home/ubuntu/development/armika/deps/glfw/src/egl_context.c:365:22: error: ‘EGL_CONTEXT_OPENGL_ROBUST_ACCESS_BIT_KHR’ undeclared (first use in this function)
/home/ubuntu/development/armika/deps/glfw/src/egl_context.c:370:13: error: ‘EGL_CONTEXT_MAJOR_VERSION_KHR’ undeclared (first use in this function)
/home/ubuntu/development/armika/deps/glfw/src/egl_context.c:371:13: error: ‘EGL_CONTEXT_MINOR_VERSION_KHR’ undeclared (first use in this function)
/home/ubuntu/development/armika/deps/glfw/src/egl_context.c:375:13: error: ‘EGL_CONTEXT_OPENGL_PROFILE_MASK_KHR’ undeclared (first use in this function)
/home/ubuntu/development/armika/deps/glfw/src/egl_context.c:378:13: error: ‘EGL_CONTEXT_FLAGS_KHR’ undeclared (first use in this function)
/home/ubuntu/development/armika/deps/glfw/src/egl_context.c:381:13: error: ‘EGL_CONTEXT_OPENGL_RESET_NOTIFICATION_STRATEGY_KHR’ undeclared (first use in this function)
make[2]: ** [src/CMakeFiles/glfw.dir/egl_context.c.o] Error 1
make[1]: ** [src/CMakeFiles/glfw.dir/all] Error 2
make: ** [all] Error 2

```

Thank you

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex035/uploads/glfw/original/1X/b8cdefe6b61b8d5aee6c43b2c56e9cf5eabecfe4.svg) [@system](https://discourse.glfw.org/u/system)\
**Post date:** [November 5, 2013, 9:31am UTC](https://discourse.glfw.org/t/segmentation-fault-on-armv7-linaro-11-10/14/9 "2013-11-05T09:31:08Z")

</div>

**[elmindreda](https://sourceforge.net/u/elmindreda/)** wrote on [Tuesday, November 05, 2013](https://sourceforge.net/p/glfw/discussion/247562/thread/6bca3e40/#3408):

Since you probably don’t have EGL\_KHR\_create\_context on that machine anyway, try removing that bit of the code and see if it works then.
