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

Multiple errors: Cannot open/create empty project using GLES2-only machine - I guess memory leaks (8c435a343*) #21451

Closed
prenex opened this issue Aug 26, 2018 · 16 comments
Assignees
Milestone

Comments

@prenex
Copy link

prenex commented Aug 26, 2018

Remark

I will try the version of today (08.26) as it seems there have been memory leak or resource leak fixes and autoclose this issue if it will fix my problem...

I open the issue for documenting the thing and because I am not sure the new build will fix it or not and I already collected the relevant information...

Godot version:
8c435a3

OS/device including version:

  • Ubuntu 16.04
  • 32 bit Intel CPU @ 1.6Ghz
  • Ati Mobility radeon Xpress 200M @ 128Mb
  • OpenGL ES 2.0 Renderer: Gallium 0.4 on ATI RC410

Issue description:

I must use the GLES 2.x renderer as that is what my machine supports. Tried to run the editor built from latest version with godot.x11.tools.32.llvm --video-driver GLES2 which works, but when tried to create a project I get the error of not having GLES 3.x capable card. I figured from an unofficial godot 3.0 backport that also uses the GLES 2.x renderer, that I can get around this using "-e" and starting godot from the directory of the (created) project.

<path-to-godot>/godot.x11.tools.32.llvm --video-driver GLES2 -e

This lead to properly use the GLES 2.x renderer, but I got into some endless resouce leak - I can see all of my memory and swap slowly eaten up until my 800mb ram + 1Gb swap completely get exhausted.

Also I kind of dislike the errors in the terminal that says the depth buffer cannot be written to. That seems to be harmless, just I added the full logs so it is visible to others as maybe it only happens on my machine.

Steps to reproduce:

  • godot.x11.tools.32.llvm --video-driver GLES2
  • Create a new project
  • Editor crashes because it tries to use GLES3 renderer
  • Go to the directory of the created project
  • /godot.x11.tools.32.llvm --video-driver GLES2 -e

Log of the terminal

prenex@ubuntu:~/munka/Godot_projets/TestProject$ /media/prenex/Plan9\(Outer\ Space\)/godot31/bin/godot.x11.tools.32.llvm --video-driver GLES2 -eOpenGL ES 2.0 Renderer: Gallium 0.4 on ATI RC410
ERROR: _gl_debug_print: GL ERROR: Source: OpenGL	Type: Error	ID: 1	Severity: High	Message: GL_INVALID_OPERATION in glTexImage2D(bad target for depth texture)
   At: drivers/gles2/rasterizer_gles2.cpp:111.
ERROR: _gl_debug_print: GL ERROR: Source: OpenGL	Type: Error	ID: 1	Severity: High	Message: GL_INVALID_OPERATION in glTexImage2D(bad target for depth texture)
   At: drivers/gles2/rasterizer_gles2.cpp:111.
ERROR: _gl_debug_print: GL ERROR: Source: OpenGL	Type: Error	ID: 1	Severity: High	Message: GL_INVALID_OPERATION in glTexImage2D(bad target for depth texture)
   At: drivers/gles2/rasterizer_gles2.cpp:111.
ERROR: _gl_debug_print: GL ERROR: Source: OpenGL	Type: Error	ID: 1	Severity: High	Message: GL_INVALID_OPERATION in glTexImage2D(bad target for depth texture)
   At: drivers/gles2/rasterizer_gles2.cpp:111.
ERROR: _gl_debug_print: GL ERROR: Source: OpenGL	Type: Error	ID: 1	Severity: High	Message: GL_INVALID_OPERATION in glTexImage2D(bad target for depth texture)
   At: drivers/gles2/rasterizer_gles2.cpp:111.
ERROR: _gl_debug_print: GL ERROR: Source: OpenGL	Type: Error	ID: 1	Severity: High	Message: GL_INVALID_OPERATION in glTexImage2D(bad target for depth texture)
   At: drivers/gles2/rasterizer_gles2.cpp:111.
ERROR: _gl_debug_print: GL ERROR: Source: OpenGL	Type: Error	ID: 1	Severity: High	Message: GL_INVALID_OPERATION in glTexImage2D(bad target for depth texture)
   At: drivers/gles2/rasterizer_gles2.cpp:111.
ERROR: _gl_debug_print: GL ERROR: Source: OpenGL	Type: Error	ID: 1	Severity: High	Message: GL_INVALID_OPERATION in glTexImage2D(bad target for depth texture)
   At: drivers/gles2/rasterizer_gles2.cpp:111.
ERROR: _gl_debug_print: GL ERROR: Source: OpenGL	Type: Error	ID: 1	Severity: High	Message: GL_INVALID_OPERATION in glTexImage2D(bad target for depth texture)
   At: drivers/gles2/rasterizer_gles2.cpp:111.
ERROR: _gl_debug_print: GL ERROR: Source: OpenGL	Type: Error	ID: 1	Severity: High	Message: GL_INVALID_OPERATION in glTexImage2D(bad target for depth texture)
   At: drivers/gles2/rasterizer_gles2.cpp:111.
ERROR: _gl_debug_print: GL ERROR: Source: OpenGL	Type: Error	ID: 1	Severity: High	Message: GL_INVALID_OPERATION in glTexImage2D(bad target for depth texture)
   At: drivers/gles2/rasterizer_gles2.cpp:111.
ERROR: _gl_debug_print: GL ERROR: Source: OpenGL	Type: Error	ID: 1	Severity: High	Message: GL_INVALID_OPERATION in glTexImage2D(bad target for depth texture)
   At: drivers/gles2/rasterizer_gles2.cpp:111.
ERROR: _gl_debug_print: GL ERROR: Source: OpenGL	Type: Error	ID: 1	Severity: High	Message: GL_INVALID_OPERATION in glTexImage2D(bad target for depth texture)
   At: drivers/gles2/rasterizer_gles2.cpp:111.
ERROR: _gl_debug_print: GL ERROR: Source: OpenGL	Type: Error	ID: 1	Severity: High	Message: GL_INVALID_OPERATION in glTexImage2D(bad target for depth texture)
   At: drivers/gles2/rasterizer_gles2.cpp:111.
ERROR: _gl_debug_print: GL ERROR: Source: OpenGL	Type: Error	ID: 1	Severity: High	Message: GL_INVALID_OPERATION in glTexImage2D(bad target for depth texture)
   At: drivers/gles2/rasterizer_gles2.cpp:111.
ERROR: _gl_debug_print: GL ERROR: Source: OpenGL	Type: Error	ID: 1	Severity: High	Message: GL_INVALID_OPERATION in glTexImage2D(bad target for depth texture)
   At: drivers/gles2/rasterizer_gles2.cpp:111.
ERROR: _gl_debug_print: GL ERROR: Source: OpenGL	Type: Error	ID: 1	Severity: High	Message: GL_INVALID_OPERATION in glTexImage2D(bad target for depth texture)
   At: drivers/gles2/rasterizer_gles2.cpp:111.
ERROR: _gl_debug_print: GL ERROR: Source: OpenGL	Type: Error	ID: 1	Severity: High	Message: GL_INVALID_OPERATION in glTexImage2D(bad target for depth texture)
   At: drivers/gles2/rasterizer_gles2.cpp:111.
ERROR: _gl_debug_print: GL ERROR: Source: OpenGL	Type: Error	ID: 1	Severity: High	Message: GL_INVALID_OPERATION in glTexImage2D(bad target for depth texture)
   At: drivers/gles2/rasterizer_gles2.cpp:111.
ERROR: _gl_debug_print: GL ERROR: Source: OpenGL	Type: Error	ID: 1	Severity: High	Message: GL_INVALID_OPERATION in glTexImage2D(bad target for depth texture)
   At: drivers/gles2/rasterizer_gles2.cpp:111.
ERROR: _gl_debug_print: GL ERROR: Source: OpenGL	Type: Error	ID: 1	Severity: High	Message: GL_INVALID_OPERATION in glTexImage2D(bad target for depth texture)
   At: drivers/gles2/rasterizer_gles2.cpp:111.
ERROR: _gl_debug_print: GL ERROR: Source: OpenGL	Type: Error	ID: 1	Severity: High	Message: GL_INVALID_OPERATION in glTexImage2D(bad target for depth texture)
   At: drivers/gles2/rasterizer_gles2.cpp:111.
ERROR: _gl_debug_print: GL ERROR: Source: OpenGL	Type: Error	ID: 1	Severity: High	Message: GL_INVALID_OPERATION in glTexImage2D(bad target for depth texture)
   At: drivers/gles2/rasterizer_gles2.cpp:111.
ERROR: _gl_debug_print: GL ERROR: Source: OpenGL	Type: Error	ID: 1	Severity: High	Message: GL_INVALID_OPERATION in glTexImage2D(bad target for depth texture)
   At: drivers/gles2/rasterizer_gles2.cpp:111.
ERROR: _gl_debug_print: GL ERROR: Source: OpenGL	Type: Error	ID: 1	Severity: High	Message: GL_INVALID_OPERATION in glTexImage2D(bad target for depth texture)
   At: drivers/gles2/rasterizer_gles2.cpp:111.
ERROR: _gl_debug_print: GL ERROR: Source: OpenGL	Type: Error	ID: 1	Severity: High	Message: GL_INVALID_OPERATION in glTexImage2D(bad target for depth texture)
   At: drivers/gles2/rasterizer_gles2.cpp:111.
ERROR: _gl_debug_print: GL ERROR: Source: OpenGL	Type: Error	ID: 1	Severity: High	Message: GL_INVALID_OPERATION in glTexImage2D(bad target for depth texture)
   At: drivers/gles2/rasterizer_gles2.cpp:111.
ERROR: _gl_debug_print: GL ERROR: Source: OpenGL	Type: Error	ID: 1	Severity: High	Message: GL_INVALID_OPERATION in glTexImage2D(bad target for depth texture)
   At: drivers/gles2/rasterizer_gles2.cpp:111.
ERROR: _gl_debug_print: GL ERROR: Source: OpenGL	Type: Error	ID: 1	Severity: High	Message: GL_INVALID_OPERATION in glTexImage2D(bad target for depth texture)
   At: drivers/gles2/rasterizer_gles2.cpp:111.
ERROR: _gl_debug_print: GL ERROR: Source: OpenGL	Type: Error	ID: 1	Severity: High	Message: GL_INVALID_OPERATION in glTexImage2D(bad target for depth texture)
   At: drivers/gles2/rasterizer_gles2.cpp:111.
ERROR: _gl_debug_print: GL ERROR: Source: OpenGL	Type: Error	ID: 1	Severity: High	Message: GL_INVALID_VALUE in glTexImage2D(invalid width or height or depth)
   At: drivers/gles2/rasterizer_gles2.cpp:111.
ERROR: initialize: Directional shadow framebuffer status invalid
   At: drivers/gles2/rasterizer_scene_gles2.cpp:2474.
WARNING: _get: Property not found: _global_script_class_icons
   At: core/project_settings.cpp:194.
handle_crash: Program crashed with signal 11
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
ERROR: execute: Condition ' !f ' is true. returned: ERR_CANT_OPEN
   At: drivers/unix/os_unix.cpp:281.
[1] [0xb7736c14] ()
ERROR: execute: Condition ' !f ' is true. returned: ERR_CANT_OPEN
   At: drivers/unix/os_unix.cpp:281.
[2] /usr/lib/i386-linux-gnu/dri/r300_dri.so(+0x544fd7) [0xb5d0dfd7] ()
ERROR: execute: Condition ' !f ' is true. returned: ERR_CANT_OPEN
   At: drivers/unix/os_unix.cpp:281.
[3] /usr/lib/i386-linux-gnu/dri/r300_dri.so(+0x55b85b) [0xb5d2485b] ()
ERROR: execute: Condition ' !f ' is true. returned: ERR_CANT_OPEN
   At: drivers/unix/os_unix.cpp:281.
[4] /usr/lib/i386-linux-gnu/dri/r300_dri.so(+0x552b48) [0xb5d1bb48] ()
ERROR: execute: Condition ' !f ' is true. returned: ERR_CANT_OPEN
   At: drivers/unix/os_unix.cpp:281.
[5] /usr/lib/i386-linux-gnu/dri/r300_dri.so(+0x5532b6) [0xb5d1c2b6] ()
ERROR: execute: Condition ' !f ' is true. returned: ERR_CANT_OPEN
   At: drivers/unix/os_unix.cpp:281.
[6] /usr/lib/i386-linux-gnu/dri/r300_dri.so(+0x54e45a) [0xb5d1745a] ()
ERROR: execute: Condition ' !f ' is true. returned: ERR_CANT_OPEN
   At: drivers/unix/os_unix.cpp:281.
[7] /usr/lib/i386-linux-gnu/dri/r300_dri.so(+0x54e514) [0xb5d17514] ()
ERROR: execute: Condition ' !f ' is true. returned: ERR_CANT_OPEN
   At: drivers/unix/os_unix.cpp:281.
[8] /usr/lib/i386-linux-gnu/dri/r300_dri.so(+0x547a23) [0xb5d10a23] ()
ERROR: execute: Condition ' !f ' is true. returned: ERR_CANT_OPEN
   At: drivers/unix/os_unix.cpp:281.
[9] /usr/lib/i386-linux-gnu/dri/r300_dri.so(+0x5323c5) [0xb5cfb3c5] ()
ERROR: execute: Condition ' !f ' is true. returned: ERR_CANT_OPEN
   At: drivers/unix/os_unix.cpp:281.
[10] /usr/lib/i386-linux-gnu/dri/r300_dri.so(+0x533316) [0xb5cfc316] ()
ERROR: execute: Condition ' !f ' is true. returned: ERR_CANT_OPEN
   At: drivers/unix/os_unix.cpp:281.
[11] /usr/lib/i386-linux-gnu/dri/r300_dri.so(+0x53f6e3) [0xb5d086e3] ()
ERROR: execute: Condition ' !f ' is true. returned: ERR_CANT_OPEN
   At: drivers/unix/os_unix.cpp:281.
[12] /usr/lib/i386-linux-gnu/dri/r300_dri.so(+0x533f06) [0xb5cfcf06] ()
ERROR: execute: Condition ' !f ' is true. returned: ERR_CANT_OPEN
   At: drivers/unix/os_unix.cpp:281.
[13] /usr/lib/i386-linux-gnu/dri/r300_dri.so(+0x535e32) [0xb5cfee32] ()
ERROR: execute: Condition ' !f ' is true. returned: ERR_CANT_OPEN
   At: drivers/unix/os_unix.cpp:281.
[14] /usr/lib/i386-linux-gnu/dri/r300_dri.so(+0x31fb4d) [0xb5ae8b4d] ()
ERROR: execute: Condition ' !f ' is true. returned: ERR_CANT_OPEN
   At: drivers/unix/os_unix.cpp:281.
[15] /usr/lib/i386-linux-gnu/dri/r300_dri.so(+0x1c5e9c) [0xb598ee9c] ()
ERROR: execute: Condition ' !f ' is true. returned: ERR_CANT_OPEN
   At: drivers/unix/os_unix.cpp:281.
[16] /usr/lib/i386-linux-gnu/dri/r300_dri.so(+0x18b6a9) [0xb59546a9] ()
ERROR: execute: Condition ' !f ' is true. returned: ERR_CANT_OPEN
   At: drivers/unix/os_unix.cpp:281.
[17] RasterizerStorageGLES2::sky_set_texture(RID, RID, int) ()
ERROR: execute: Condition ' !f ' is true. returned: ERR_CANT_OPEN
   At: drivers/unix/os_unix.cpp:281.
[18] VisualServerRaster::sky_set_texture(RID, RID, int) ()
ERROR: execute: Condition ' !f ' is true. returned: ERR_CANT_OPEN
   At: drivers/unix/os_unix.cpp:281.
[19] VisualServerWrapMT::sky_set_texture(RID, RID, int) ()
ERROR: execute: Condition ' !f ' is true. returned: ERR_CANT_OPEN
   At: drivers/unix/os_unix.cpp:281.
[20] ProceduralSky::_radiance_changed() ()
ERROR: execute: Condition ' !f ' is true. returned: ERR_CANT_OPEN
   At: drivers/unix/os_unix.cpp:281.
[21] ProceduralSky::_update_sky() ()
ERROR: execute: Condition ' !f ' is true. returned: ERR_CANT_OPEN
   At: drivers/unix/os_unix.cpp:281.
[22] MethodBind0<ProceduralSky>::call(Object*, Variant const**, int, Variant::CallError&) ()
ERROR: execute: Condition ' !f ' is true. returned: ERR_CANT_OPEN
   At: drivers/unix/os_unix.cpp:281.
[23] Object::call(StringName const&, Variant const**, int, Variant::CallError&) ()
ERROR: execute: Condition ' !f ' is true. returned: ERR_CANT_OPEN
   At: drivers/unix/os_unix.cpp:281.
[24] MessageQueue::_call_function(Object*, StringName const&, Variant const*, int, bool) ()
ERROR: execute: Condition ' !f ' is true. returned: ERR_CANT_OPEN
   At: drivers/unix/os_unix.cpp:281.
[25] MessageQueue::flush() ()
ERROR: execute: Condition ' !f ' is true. returned: ERR_CANT_OPEN
   At: drivers/unix/os_unix.cpp:281.
[26] SceneTree::iteration(float) ()
ERROR: execute: Condition ' !f ' is true. returned: ERR_CANT_OPEN
   At: drivers/unix/os_unix.cpp:281.
[27] Main::iteration() ()
ERROR: execute: Condition ' !f ' is true. returned: ERR_CANT_OPEN
   At: drivers/unix/os_unix.cpp:281.
[28] OS_X11::run() ()
ERROR: execute: Condition ' !f ' is true. returned: ERR_CANT_OPEN
   At: drivers/unix/os_unix.cpp:281.
[29] /media/prenex/Plan9(Outer Space)/godot31/bin/godot.x11.tools.32.llvm(main+0x12c) [0x8c8051c] ()
ERROR: execute: Condition ' !f ' is true. returned: ERR_CANT_OPEN
   At: drivers/unix/os_unix.cpp:281.
[30] /lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf7) [0xb6efb637] ()
ERROR: execute: Condition ' !f ' is true. returned: ERR_CANT_OPEN
   At: drivers/unix/os_unix.cpp:281.
[31] /media/prenex/Plan9(Outer Space)/godot31/bin/godot.x11.tools.32.llvm() [0x8c8031b] ()
-- END OF BACKTRACE --
Aborted (core dumped)
@prenex
Copy link
Author

prenex commented Aug 26, 2018

Also I needed use_llvm=yes to build, otherwise gcc could not build the project because of some ordering issues... See below for the g++ build error messages.

prenex@ubuntu:/media/prenex/Plan9(Outer Space)/godot31$ scons platform=x11
scons: Reading SConscript files ...
Enabling ALSA
Enabling PulseAudio
YASM is necessary for WebM SIMD optimizations.
WebM SIMD optimizations are disabled. Check if your CPU architecture, CPU bits or platform are supported!
Checking for C header file mntent.h... (cached) yes
scons: done reading SConscript files.
scons: Building targets ...
[  5%] Compiling ==> main/main.cpp
[  6%] Linking Static Library ==> main/libmain.x11.tools.32.a
Ranlib Library         ==> main/libmain.x11.tools.32.a
[  6%] Linking Static Library ==> main/tests/libtests.x11.tools.32.a
Ranlib Library         ==> main/tests/libtests.x11.tools.32.a
[ 17%] Compiling ==> thirdparty/cvtt/ConvectionKernels.cpp
thirdparty/cvtt/ConvectionKernels.cpp: In member function 'void cvtt::Internal::IndexSelectorHDR<TVectorSize>::InitHDR(int, bool, bool, const float*)':
thirdparty/cvtt/ConvectionKernels.cpp:3157:32: error: 'MakeBoolInt16' is not a member of 'cvtt::ParallelMath'
                 m_isInverted = ParallelMath::MakeBoolInt16(false);
                                ^
thirdparty/cvtt/ConvectionKernels.cpp: In static member function 'static void cvtt::Internal::BC7Computer::TrySinglePlane(uint32_t, const MUInt15 (*)[4], const MFloat (*)[4], const float*, int, int, cvtt::Internal::BC7Computer::WorkInfo&, const cvtt::ParallelMath::RoundTowardNearestForScope*)':
thirdparty/cvtt/ConvectionKernels.cpp:3820:62: error: 'MakeBoolInt16' is not a member of 'cvtt::ParallelMath'
                 ParallelMath::Int16CompFlag isPunchThrough = ParallelMath::MakeBoolInt16(true);
                                                              ^
thirdparty/cvtt/ConvectionKernels.cpp:4047:58: error: 'MakeBoolInt16' is not a member of 'cvtt::ParallelMath'
                             punchThroughInvalid[pIter] = ParallelMath::MakeBoolInt16(false);
                                                          ^
thirdparty/cvtt/ConvectionKernels.cpp: In static member function 'static void cvtt::Internal::BC6HComputer::EvaluatePartitionedLegality(const MAInt16 (*)[3], const MAInt16 (*)[3], int, const int*, bool, cvtt::Internal::BC6HComputer::MAInt16 (*)[2][3], cvtt::ParallelMath::Int16CompFlag&)':
thirdparty/cvtt/ConvectionKernels.cpp:5315:56: error: 'MakeBoolInt16' is not a member of 'cvtt::ParallelMath'
                 ParallelMath::Int16CompFlag allLegal = ParallelMath::MakeBoolInt16(true);
                                                        ^
thirdparty/cvtt/ConvectionKernels.cpp: In static member function 'static void cvtt::Internal::BC6HComputer::EvaluateSingleLegality(const MAInt16 (*)[3], int, const int*, bool, cvtt::Internal::BC6HComputer::MAInt16 (*)[3], cvtt::ParallelMath::Int16CompFlag&)':
thirdparty/cvtt/ConvectionKernels.cpp:5356:56: error: 'MakeBoolInt16' is not a member of 'cvtt::ParallelMath'
                 ParallelMath::Int16CompFlag allLegal = ParallelMath::MakeBoolInt16(true);
                                                        ^
thirdparty/cvtt/ConvectionKernels.cpp: In static member function 'static void cvtt::Internal::BC6HComputer::Pack(uint32_t, const cvtt::PixelBlockF16*, uint8_t*, const float*, bool, int, int)':
thirdparty/cvtt/ConvectionKernels.cpp:5571:83: error: 'MakeBoolInt16' is not a member of 'cvtt::ParallelMath'
                                             ParallelMath::Int16CompFlag anySame = ParallelMath::MakeBoolInt16(false);
                                                                                   ^
thirdparty/cvtt/ConvectionKernels.cpp:5577:84: error: 'MakeBoolInt16' is not a member of 'cvtt::ParallelMath'
                                                 ParallelMath::Int16CompFlag same = ParallelMath::MakeBoolInt16(true);
                                                                                    ^
scons: *** [thirdparty/cvtt/ConvectionKernels.x11.tools.32.o] Error 1
scons: building terminated because of errors.

@prenex
Copy link
Author

prenex commented Aug 26, 2018

Still have the errors after building with the named fixes...

Version

db55d8a

@prenex
Copy link
Author

prenex commented Aug 26, 2018

Gdb backtrace (core)

This seems to be more helpful than the above backtrace as this has more line numbers in it. As far as I see the bug constantly happens in the point described by this stack trace (for the sky texture). I will see if I can fix this, but I am completely noob when it comes to your codebase :-). This would be the first try of your engine - except I installed 2.1 some days ago and tried very basic hello world in that.

The core file is 1.2Gb so I did not dare to upload here, but I can put it out to somewhere downloadable if some of you are interested - also just tell me what more info you want and I will try my best to tell so ;-)

I think Godot 3.1 will be great if it can work on my machine. Looks like a much better engine (for my liking) than others. The scene handling ideas seem to be great.

(gdb) bt
#0  0xb7775c31 in __kernel_vsyscall ()
#1  0xb6f4de89 in __GI_raise (sig=6) at ../sysdeps/unix/sysv/linux/raise.c:54
#2  0xb6f4f3e7 in __GI_abort () at abort.c:89
#3  0x08c8302d in handle_crash (sig=11) at platform/x11/crash_handler_x11.cpp:113
#4  <signal handler called>
#5  0xb5d4cfd7 in ?? () from /usr/lib/i386-linux-gnu/dri/r300_dri.so
#6  0xb5d6385b in ?? () from /usr/lib/i386-linux-gnu/dri/r300_dri.so
#7  0xb5d5ab48 in ?? () from /usr/lib/i386-linux-gnu/dri/r300_dri.so
#8  0xb5d5b2b6 in ?? () from /usr/lib/i386-linux-gnu/dri/r300_dri.so
#9  0xb5d5645a in ?? () from /usr/lib/i386-linux-gnu/dri/r300_dri.so
#10 0xb5d56514 in ?? () from /usr/lib/i386-linux-gnu/dri/r300_dri.so
#11 0xb5d4fa23 in ?? () from /usr/lib/i386-linux-gnu/dri/r300_dri.so
#12 0xb5d3a3c5 in ?? () from /usr/lib/i386-linux-gnu/dri/r300_dri.so
#13 0xb5d3b316 in ?? () from /usr/lib/i386-linux-gnu/dri/r300_dri.so
#14 0xb5d476e3 in ?? () from /usr/lib/i386-linux-gnu/dri/r300_dri.so
#15 0xb5d3bf06 in ?? () from /usr/lib/i386-linux-gnu/dri/r300_dri.so
#16 0xb5d3de32 in ?? () from /usr/lib/i386-linux-gnu/dri/r300_dri.so
#17 0xb5b27b4d in ?? () from /usr/lib/i386-linux-gnu/dri/r300_dri.so
#18 0xb59cde9c in ?? () from /usr/lib/i386-linux-gnu/dri/r300_dri.so
#19 0xb59936a9 in ?? () from /usr/lib/i386-linux-gnu/dri/r300_dri.so
#20 0x09aed0fd in RasterizerStorageGLES2::sky_set_texture (this=0x103dadd0, p_sky=..., p_panorama=..., p_radiance_size=512)
    at drivers/gles2/rasterizer_storage_gles2.cpp:969
#21 0x0c6d622a in VisualServerRaster::sky_set_texture (this=0x102869b8, arg1=..., arg2=..., arg3=512)
    at servers/visual/visual_server_raster.h:183
#22 0x0c74fd58 in VisualServerWrapMT::sky_set_texture (this=0xb2b4a018, p1=..., p2=..., p3=512) at servers/visual/visual_server_wrap_mt.h:117
#23 0x0c0e89fd in ProceduralSky::_radiance_changed (this=0x10bc18d8) at scene/resources/sky_box.cpp:129
#24 0x0c0ec61d in ProceduralSky::_update_sky (this=0x10bc18d8) at scene/resources/sky_box.cpp:410
#25 0x0c0f6e8e in MethodBind0<ProceduralSky>::call (this=0x109ba460, p_object=0x10bc18d8, p_args=0x0, p_arg_count=0, r_error=...)
    at core/method_bind.gen.inc:137
#26 0x0d1816c6 in Object::call (this=0x10bc18d8, p_method=..., p_args=0x0, p_argcount=0, r_error=...) at core/object.cpp:968
#27 0x0d167440 in MessageQueue::_call_function (this=0x1025d5b8, p_target=0x10bc18d8, p_func=..., p_args=0xb64e3028, p_argcount=0, 
    p_show_error=false) at core/message_queue.cpp:256
#28 0x0d16774d in MessageQueue::flush (this=0x1025d5b8) at core/message_queue.cpp:300
#29 0x0af3dc70 in SceneTree::iteration (this=0x10b5ea48, p_time=0,0166666675) at scene/main/scene_tree.cpp:476
#30 0x08cd5a84 in Main::iteration () at main/main.cpp:1773
#31 0x08c92f77 in OS_X11::run (this=0xbfbdd760) at platform/x11/os_x11.cpp:2695
#32 0x08c805ec in main (argc=4, argv=0xbfbddc44) at platform/x11/godot_x11.cpp:55

@prenex
Copy link
Author

prenex commented Aug 26, 2018

Further GDB information

(gdb) f 20
#20 0x09aed0fd in RasterizerStorageGLES2::sky_set_texture (this=0x103dadd0, p_sky=..., p_panorama=..., p_radiance_size=512)
    at drivers/gles2/rasterizer_storage_gles2.cpp:969
969				glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
(gdb) f
#20 0x09aed0fd in RasterizerStorageGLES2::sky_set_texture (this=0x103dadd0, p_sky=..., p_panorama=..., p_radiance_size=512)
    at drivers/gles2/rasterizer_storage_gles2.cpp:969
969				glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
(gdb) list
964				shaders.cubemap_filter.set_uniform(CubemapFilterShaderGLES2::FACE_ID, i);
965	
966				float roughness = mm_level ? lod / (float)(mipmaps - 1) : 1;
967				shaders.cubemap_filter.set_uniform(CubemapFilterShaderGLES2::ROUGHNESS, roughness);
968	
969				glDrawArrays(GL_TRIANGLE_FAN, 0, 4);
970			}
971	
972			size >>= 1;
973	
(gdb) print size
$1 = 512
(gdb) print i
$2 = 0
(gdb) print mipmaps
$3 = 6
(gdb) print mm_level
$4 = 6
(gdb) p p_sky 
$5 = {_data = 0x10bc04d8}
(gdb) p p_radiance_size
$6 = 512
(gdb) p sky->panorama.is_valid()
Cannot evaluate function -- may be inlined
(gdb) p sky->panorama
$7 = {_data = 0x10bc1a60}
(gdb) p sky->radiance
$8 = 1474
(gdb) p lod
$9 = 0
(gdb) p roughness
$10 = 0
(gdb) p ize
No symbol "ize" in current context.
(gdb) p size
$11 = 512
(gdb) p texture
$12 = (RasterizerStorageGLES2::Texture *) 0x10bc1a60
(gdb) p texture->target
$13 = 3553
(gdb) p texture->tex_id
$14 = 132
(gdb) p resources.radical_inverse_vdc_cache_tex
$15 = 5
(gdb) p tmp_fb
$16 = 49
(gdb) p GL_TEXTURE_2D
No symbol "GL_TEXTURE_2D" in current context.
(gdb) quit

^^By looking at the code I do not see any clean error but there might be some small hidden error maybe that works on most machines except mine? I will try to change this function into a NO-OP to see if I can go further (just not having a sky texture).

@prenex
Copy link
Author

prenex commented Aug 26, 2018

RELEVANT INFO

It seems that if I change the whole method to just "return" without doing anything, then I can start the editor. I did not try too many things, but I see the editor and can move the camera with my mouse.

Also I added a simple stderr log in this function that sets the sky texture and so far I see it is only called once and not many-many times, so it is really weird to have the memory depletion problem. I wonder what causes the issue.

Is this function rendering something to an offscreen frame buffer to do something for the sky (generate a sky texture)?

Also I still get the texture errors from drivers/gles2/rasterizer_gles2.cpp:111 - just as you can see above. I don't know how bad is that.

@prenex
Copy link
Author

prenex commented Aug 26, 2018

Test results with the fake (no-op) sky-function

Actually things quite work if I exchange the sky-texture setter method with a no-operation. I tried to add an obj file and some textures as results and I can see them show up if I drag the obj into the scene add a material and set its main texture. I can click on "play" and see my little starship on screen - well textured. I have a camera,a light, the starship and a main spatial (3d) node that has all the other three below it. The material is a "spatial material" which seemed to be the default godot thingy. A slight user experience issue is that clicking play first crashed the newly starting app until I changed the GLES2 backend in its project settings, but that was not a big deal.

What was weird to me is that only basic texturing seemed to work: In any way I was positioning my light I always saw the object in the same way so it seems no lightning calculations are in effect. Maybe this is normal as I used all the defaults when creating the material so I thought I should (maybe) enable "vertex lightning" on the material, but when I clicked that I got the memory leak once again and the editor have crashed. The backtrace is the following one.

ERROR: _get_uniform: Condition ' !version ' is true. returned: -1
   At: drivers/gles2/shader_gles2.h:509.
ERROR: _gl_debug_print: GL ERROR: Source: OpenGL	Type: Error	ID: 1	Severity: High	Message: GL_INVALID_VALUE in glGetProgramiv(program)
   At: drivers/gles2/rasterizer_gles2.cpp:111.
ERROR: alloc_static: Condition ' !mem ' is true. returned: __null
   At: core/os/memory.cpp:85.
ERROR: resize: Condition ' !ptr ' is true. returned: ERR_OUT_OF_MEMORY
   At: core/cowdata.h:262.
ERROR: _gl_debug_print: GL ERROR: Source: OpenGL	Type: Error	ID: 1	Severity: High	Message: GL_INVALID_VALUE in glGetActiveUniform
   At: drivers/gles2/rasterizer_gles2.cpp:111.
ERROR: operator[]: FATAL: Index p_index=0 out of size (_parent->size()=0)
   At: core/vector.h:54.
handle_crash: Program crashed with signal 4
Dumping the backtrace. Please include this when reporting the bug on https://github.com/godotengine/godot/issues
[1] [0xb7789c14] (??:0)
[2] ShaderGLES2::bind() (/media/prenex/Plan9(Outer Space)/godot31/./core/vector.h:54 (discriminator 7))
[3] RasterizerSceneGLES2::_setup_material(RasterizerStorageGLES2::Material*, bool, bool, Vector2i) (/media/prenex/Plan9(Outer Space)/godot31/drivers/gles2/rasterizer_scene_gles2.cpp:848)
[4] RasterizerSceneGLES2::_render_render_list(RasterizerSceneGLES2::RenderList::Element**, int, RID const*, int, Transform const&, CameraMatrix const&, RID, RasterizerSceneGLES2::Environment*, unsigned int, float, float, bool, bool, bool, bool) (/media/prenex/Plan9(Outer Space)/godot31/drivers/gles2/rasterizer_scene_gles2.cpp:1460 (discriminator 4))
[5] RasterizerSceneGLES2::render_scene(Transform const&, CameraMatrix const&, bool, RasterizerScene::InstanceBase**, int, RID*, int, RID*, int, RID, RID, RID, RID, int) (/media/prenex/Plan9(Outer Space)/godot31/drivers/gles2/rasterizer_scene_gles2.cpp:2085)
[6] VisualServerScene::_render_scene(Transform, CameraMatrix const&, bool, RID, RID, RID, RID, int) (/media/prenex/Plan9(Outer Space)/godot31/servers/visual/visual_server_scene.cpp:2113)
[7] VisualServerScene::render_camera(RID, RID, Vector2, RID) (/media/prenex/Plan9(Outer Space)/godot31/servers/visual/visual_server_scene.cpp:1687 (discriminator 1))
[8] VisualServerViewport::_draw_viewport(VisualServerViewport::Viewport*, ARVRInterface::Eyes) (/media/prenex/Plan9(Outer Space)/godot31/servers/visual/visual_server_viewport.cpp:70)
[9] VisualServerViewport::draw_viewports() (/media/prenex/Plan9(Outer Space)/godot31/servers/visual/visual_server_viewport.cpp:306)
[10] VisualServerRaster::draw(bool, double) (/media/prenex/Plan9(Outer Space)/godot31/servers/visual/visual_server_raster.cpp:108)
[11] VisualServerWrapMT::draw(bool, double) (/media/prenex/Plan9(Outer Space)/godot31/servers/visual/visual_server_wrap_mt.cpp:104)
[12] Main::iteration() (/media/prenex/Plan9(Outer Space)/godot31/main/main.cpp:1806)
[13] OS_X11::run() (/media/prenex/Plan9(Outer Space)/godot31/platform/x11/os_x11.cpp:2695)
[14] /media/prenex/Plan9(Outer Space)/godot31/bin/godot.x11.tools.32.llvm(main+0x12c) [0x8c805ec] (/media/prenex/Plan9(Outer Space)/godot31/platform/x11/godot_x11.cpp:55)
[15] /lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf7) [0xb6f4e637] (??:0)
[16] /media/prenex/Plan9(Outer Space)/godot31/bin/godot.x11.tools.32.llvm() [0x8c803eb] (??:?)
-- END OF BACKTRACE --
Aborted (core dumped)

But at least some basic functionality works. Actually that is even more than I expected as I did not know the system can start on my machine! I am waiting for 3.1 because that supports older cards like I have and just got bored waiting and thought maybe it already "kind of works" if I get the latest git sources. I think godot has a big potential and other than the issues the whole editor works charming-fast on my decade old computer which is really awsome!!! I can imagine there are a lot of work now closing on the 3.1 version, so please not be offended by my results so far. I am just trying to give all the information I can readily provide and help in sorting out the things.

I know some opengl, but I do not feel so sure about that I can fix these issues on my own - surely not without help - but it seems if RasterizerStorageGLES2::sky_set_texture(...) could be fixed then people like me would be at least able to start the engine properly and do some basic stuff.

I guess 2D things would somewhat work. I tested 3D immediately just out of curiosity ;-)

@prenex
Copy link
Author

prenex commented Aug 26, 2018

Now as I read in the "spatial material" docs I kind of think I should see the effect of lights in the scene as per default setup without enabling "vertex lightning" flag as it is per-pixel the docs say:

http://docs.godotengine.org/en/3.0/tutorials/3d/spatial_material.html

I also read there about a "depth pre-pass". Maybe that is not working on my machine then and those are the error messages about the "GL_INVALID_OPERATION in glTexImage2D(bad target for depth texture)"? Those are mostly only coming on startup, so maybe the initialization of the depth prepass might be wrong too? I am just thinking. But first I think it would be good to fix the original main problem with the sky texture generation.

@prenex
Copy link
Author

prenex commented Aug 26, 2018

Anyone? I just wonder if people read this or not. :-)

@LikeLakers2
Copy link
Contributor

@prenex Someone will get to your issue eventually. Some issues take longer than others. :)

That being said, @karroffel I believe GLES2 is your domain?

@prenex
Copy link
Author

prenex commented Aug 26, 2018

@LikeLakers2 Thank you for your fast answer. I try not to be impatient, just I did fear a bit "what if they see there are many comments and not read the issue as everyone will think maybe already someone works on it" haha. Sorry. I am still happy that at least I can start the engine and see something on screen even though not everthing is completely well.

@karroffel I am not sure about the architecture but are the shaders always the very same or they get recompiled according to what features I use? I am asking because I have also spotted these kind of errors lately:

r300 FP: Compiler Error:
Too many constants. Max: 32, Got: 39
Using a dummy shader instead.
r300 FP: Compiler Error:
Too many constants. Max: 32, Got: 39
Using a dummy shader instead.
r300 FP: Compiler Error:
Too many constants. Max: 32, Got: 39
Using a dummy shader instead.
r300 FP: Compiler Error:
Too many constants. Max: 32, Got: 39
Using a dummy shader instead.
r300 FP: Compiler Error:
../../../../../src/gallium/drivers/r300/compiler/r300_fragprog_emit.c::emit_alu(): Too many ALU instructions
Using a dummy shader instead.
r300 FP: Compiler Error:
Too many constants. Max: 32, Got: 39
Using a dummy shader instead.

The r300_fragprog_emit.c one is coming very rarely (only one I saw so I pasted that), but the other seems to come both when I open the project and maybe when I mess with the material. It can be that it is only unlit because of this issue of the driver needing a "dummy shader instead". 32 constants does not seem to be too much and these messages seems to come from the driver, but maybe I can get the shader code somewhere and remove some parts I will never need? I mean...Maybe there is a way to get the otherwise used standard spatial material and copy its code into a shader-material so parameterization is nearly the same but fits into my limits or whatever... Just for testing...

Also I tried to turn off things in the shader to see what affects this usage number, but I could not change anything to affect it so far.

@prenex
Copy link
Author

prenex commented Aug 26, 2018

I see I can convert the standard stuff into a shader material according to this info:
http://docs.godotengine.org/en/latest/tutorials/shading/shader_materials.html

I have found it but it does not seem to work or do anything...

@prenex
Copy link
Author

prenex commented Aug 26, 2018

Does anyone have the shader material corresponding to the main spatial-material?

@prenex
Copy link
Author

prenex commented Aug 26, 2018

When I write my own "shadermaterial" to only show the normals of the object or just simple color I see it is working and that must mean the shader runs - but I still get errors complaining there are 35-36 constants. I wonder how I can go below 32 but I also wonder to see the effect of my vertex and fragment shader despite this error message.

@prenex
Copy link
Author

prenex commented Aug 27, 2018

I also tried to add a simple "light" shader but it seems that way I got endless error messages. Gonna sleep now. I guess in a simple space game I might add a "hacky directional light" encoded into the fragment shader, but that seems like a really hacky thing to do. I would prefer to have these problems properly sorted out - if that is possible...

@akien-mga
Copy link
Member

This sounds similar to #21551 - does removing the default environment (and/or just its ProceduralSky) solve the issue for you?

@akien-mga akien-mga assigned reduz and unassigned karroffel Jan 23, 2019
@akien-mga
Copy link
Member

As per the above, assuming fixed in the current master branch. Please comment if you can still reproduce it.

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

No branches or pull requests

6 participants