Jump to content
The Dark Mod Forums
Sign in to follow this  
greebo

Background Image

Recommended Posts

I get a segfault with the latest build.

 

Thread [1] (Suspended: Signal 'SIGSEGV' received. Description: Segmentation fault.)	
38 <symbol is not available> 0x74786574	
37 OpenGLShader::construct() at /workspace/darkradiant/radiant/render/backend/OpenGLShader.cpp:405 0x08235331	
36 OpenGLShader::realise() at /workspace/darkradiant/radiant/render/backend/OpenGLShader.cpp:103 0x082355c5	
35 OpenGLShaderCache::realise() at /workspace/darkradiant/radiant/renderstate.cpp:506 0x081197a5	
34 TexturesMap::realise() at /workspace/darkradiant/plugins/textures/TexturesCache.cpp:466 0xb62f96a8	
33 Textures_Realise() at /workspace/darkradiant/radiant/textures.cpp:28 0x08139524	
32 GlobalGL_sharedContextCreated() at /workspace/darkradiant/radiant/mainframe.cpp:2609 0x080a6a5f	
31 glwidget_context_created() at /workspace/darkradiant/libs/gtkutil/glwidget.cpp:201 0x0823e776	
30 g_cclosure_marshal_VOID__VOID()  0xb785a423	
29 g_closure_invoke()  0xb784e79f	
28 g_signal_stop_emission()  0xb785d2ea	
27 g_signal_emit_valist()  0xb785eb19	
26 g_signal_emit()  0xb785ee89	
25 gtk_widget_realize()  0xb7d1f3d1	
24 glwidget_enable_gl() at /workspace/darkradiant/libs/gtkutil/glwidget.cpp:229 0x0823e6ba	
23 g_cclosure_marshal_VOID__OBJECT()  0xb785adb7	
22 g_closure_invoke()  0xb784e79f	
21 g_signal_stop_emission()  0xb785d2ea	
20 g_signal_emit_valist()  0xb785eb19	
19 g_signal_emit()  0xb785ee89	
18 gtk_widget_set_parent_window()  0xb7d1b1ac	
17 gtk_frame_new()  0xb7bf8fc5	
16 gtk_container_forall()  0xb7badc36	
15 gtk_widget_set_parent_window()  0xb7d1b1f4	
14 gtk_box_reorder_child()  0xb7b74fd8	
13 gtk_container_forall()  0xb7badc36	
12 gtk_widget_set_parent_window()  0xb7d1b1f4	
11 gtk_box_reorder_child()  0xb7b75009	
10 gtk_container_forall()  0xb7badc36	
9 gtk_widget_set_parent_window()  0xb7d1b1f4	
8 _gtk_widget_propagate_hierarchy_changed()  0xb7d1b6fd	
7 gtk_widget_set_parent()  0xb7d1faa3	
6 gtk_notebook_insert_page_menu()  0xb7c51a17	
5 gtk_notebook_insert_page()  0xb7c51cee	
4 GroupDialog_addPage() at /workspace/darkradiant/radiant/groupdialog.cpp:152 0x0808f489	
3 MainFrame::Create() at /workspace/darkradiant/radiant/mainframe.cpp:2290 0x080afed1	
2 MainFrame() at /workspace/darkradiant/radiant/mainframe.cpp:2059 0x080b0c72	
1 main() at /workspace/darkradiant/radiant/main.cpp:532 0x08096868

 

The fault occurs on the following line in OpenGLShader.cpp

 

else
{
  state.m_texture = m_shader->getTexture()->texture_number;

  state.m_state = RENDER_FILL|RENDER_TEXTURE|RENDER_DEPTHT
EST|RENDER_COLOURWRITE|RENDER_LIGHTING|R
E
NDER_SMOOTH;
  if((m_shader->getFlags() & QER_CULL) != 0) // *** SEGFAULT HERE ****
  {
	if(m_shader->getCull() == IShader::eCullBack)
	{
	  state.m_state |= RENDER_CULLFACE;

 

I would guess that m_shader is NULL or invalid in this case, although GDB isn't helping much.

Share this post


Link to post
Share on other sites

Ok, my build seems to work, but I'll try to look into it.

 

(I changed the Texture* pointers to boost::shared_ptr yesterday, I don't think I changed the shader, but it's most probably related to it.)

 

Edit: Oh boy, another HashedCache (I just checked, this is one of the two last instances).

 

Edit2:If m_shader was invalid or NULL, how could the texture be retrieved in the first place? There is another access of m_shader two statements before the crashing one.

Share this post


Link to post
Share on other sites

I can't reproduce it, maybe I should install Ubuntu again...

 

One thing I added was the ShaderLibrary along with some methods. Its results aren't used at the moment, although there are some calls to it in shaders.cpp::Try_Shader_ForName(). Maybe these corrupt something, but I couldn't say why this would be the case.

 

I can comment out these calls if you want me to and commit them.

Share this post


Link to post
Share on other sites

I will try a full rebuild, that sometimes clears out errors. If not, I would almost be tempted to look into removing those QER_ flags, I'm pretty sure they are not actually used for anything significant (but I would have to check).

 

I also have a future task to get rid of those raw IShader pointers and replace them with boost::shared_ptr<IShader>. This will mean getting rid of the internal reference counting (IShader::IncRef() etc) and let shared_ptr take care of that automatically.

Share this post


Link to post
Share on other sites

phew, thought I screwed something up again. Ok, back to the shaders module!

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...