Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6693503
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T05:59:25+00:00 2026-05-26T05:59:25+00:00

I have a very strange problem in my code. I’m using Ogre and I’m

  • 0

I have a very strange problem in my code. I’m using Ogre and I’m trying to manually create a material but I don’t think the problem is Ogre specific. Links: Header file, Source file, Stack trace. Please excuse random names, comments and std::cout <<‘s. I am in despair and enjoy fun coding 😀

Here is a summary of my code if you don’t wish to read it:

  1. Create root
  2. Load plugins
  3. Setup render system
  4. Load resources
  5. Setup input system
  6. Create scene manager
  7. Create scene
    a. Setup lighting
    b. Manually create material
    c. Add entity to scene with manually created material
  8. Add frame update callback
  9. Begin rendering

Now, If I omit steps 7b and 7c, the code works fine and as expected, and the program outputs to a log, as expected. But if I include steps 7b and 7c, nothing happens and no log is written. The code never finishes step one. I believe this is a deadlock from looking at the stack trace but have no idea how to solve it – I don’t understand how adding code later on will affect code earlier on as it will run after the initial code, this is why I suspected a threading issue. Any suggestions welcome! Thanks in advance, ell.

Edit: Removed most code, leaving in only steps 1, 7a, 7b and 7c. I’m leaving the stack trace in because its not so long!

Here is the offending code:

Step 1 (line 13)

mRoot = new Ogre::Root("", "", "ogre.log");

Steps 7a,b,c (lines 146-169)

mSceneManager->setAmbientLight(Ogre::ColourValue(0.5, 0.5, 0.5));

std::cout << "Before material creation" << std::endl;


//Make cube material
Ogre::MaterialPtr cube_material_ptr = Ogre::MaterialManager::getSingleton().create(
    "trolcherry",
    Ogre::ResourceGroupManager::DEFAULT_RESOURCE_GROUP_NAME
    );
std::cout << "After material creation" << std::endl;

// Get a material pass
Ogre::Pass *pass = cube_material_ptr->getTechnique(0)->getPass(0);
pass->setDiffuse(Ogre::ColourValue(1.0, 0.2, 0.2));


//Make cube
Ogre::Entity& cube_entity = *(mSceneManager->createEntity("Head", "Prefab_Cube"));
cube_entity.setMaterialName("trolcherry");

Ogre::SceneNode& cube_node = *(mSceneManager->getRootSceneNode()->createChildSceneNode());
cube_node.attachObject(&cube_entity);
cube_node.scale(0.3, 0.3, 0.3);

Stack trace

#0 (    0x0012e416 in __kernel_vsyscall() (??:??)
#1 0x9b20b9 __lll_lock_wait() (../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/lowlevellock.S:142)
#2 0x9af566 pthread_cond_wait@@GLIBC_2.3.2() (../nptl/sysdeps/unix/sysv/linux/i386/i686/../i486/pthread_cond_wait.S:299)
#3 0x9223fd __pthread_cond_wait(cond=0xb7bd727c, mutex=0xb7bd7264) (forward.c:139)
#4 0x804c65b    boost::recursive_mutex::lock(this=0xb7bd7264) (lib/boost_1_47_0/boost/thread/pthread/recursive_mutex.hpp:133)
#5 0x804d4af    boost::unique_lock<boost::recursive_mutex>::lock(this=0xbffff3c4) (lib/boost_1_47_0/boost/thread/locks.hpp:412)
#6 0x47dd96 unique_lock(this=0xb7bd7260, name=..., inGlobalPool=true) (/usr/include/boost/thread/locks.hpp:227)
#7 (    Ogre::ResourceGroupManager::createResourceGroup(this=0xb7bd7260, name=..., inGlobalPool=true) (/home/elliot/Programming/C and C++/Project MuffinSnatcher/lib/ogre_src_v1-7-3/OgreMain/src/OgreResourceGroupManager.cpp:84)
#8 0x47eaa6 Ogre::ResourceGroupManager::ResourceGroupManager(this=0xb7bd7260) (/home/elliot/Programming/C and C++/Project MuffinSnatcher/lib/ogre_src_v1-7-3/OgreMain/src/OgreResourceGroupManager.cpp:61)
#9 0x497bc2 Ogre::Root::Root(this=0xb7ed7260, pluginFileName=..., configFileName=..., logFileName=...) (/home/elliot/Programming/C and C++/Project MuffinSnatcher/lib/ogre_src_v1-7-3/OgreMain/src/OgreRoot.cpp:154)
#10 0x804adfe   ProjectMuffinSnatcher::Client::Run(this=0xbffff6ec) (/home/elliot/Programming/C and C++/Project MuffinSnatcher/src/Client.cpp:13)
#11 0x804e0da   main() (/home/elliot/Programming/C and C++/Project MuffinSnatcher/src/main.cpp:6)

Output of ldd

linux-gate.so.1 =>  (0x009a3000)
libboost_system.so.1.42.0 => /usr/lib/libboost_system.so.1.42.0 (0x00c14000)
libOgreMain.so.1.7.3 => /usr/local/lib/libOgreMain.so.1.7.3 (0x00110000)
libOIS-1.3.0.so => /usr/local/lib/libOIS-1.3.0.so (0x006d3000)
libstdc++.so.6 => /usr/lib/i386-linux-gnu/libstdc++.so.6 (0x00ce8000)
libm.so.6 => /lib/i386-linux-gnu/libm.so.6 (0x006f4000)
libgcc_s.so.1 => /lib/i386-linux-gnu/libgcc_s.so.1 (0x00f66000)
libc.so.6 => /lib/i386-linux-gnu/libc.so.6 (0x0071a000)
libpthread.so.0 => /lib/i386-linux-gnu/libpthread.so.0 (0x0087b000)
librt.so.1 => /lib/i386-linux-gnu/librt.so.1 (0x00e7b000)
libfreetype.so.6 => /usr/lib/i386-linux-gnu/libfreetype.so.6 (0x008da000)
libSM.so.6 => /usr/lib/i386-linux-gnu/libSM.so.6 (0x00e2d000)
libICE.so.6 => /usr/lib/i386-linux-gnu/libICE.so.6 (0x00894000)
libX11.so.6 => /usr/lib/i386-linux-gnu/libX11.so.6 (0x009a4000)
libXext.so.6 => /usr/lib/i386-linux-gnu/libXext.so.6 (0x008ac000)
libXt.so.6 => /usr/lib/i386-linux-gnu/libXt.so.6 (0x00abf000)
libXaw.so.7 => /usr/lib/libXaw.so.7 (0x00b11000)
libdl.so.2 => /lib/i386-linux-gnu/libdl.so.2 (0x008bb000)
libboost_thread.so.1.42.0 => /usr/lib/libboost_thread.so.1.42.0 (0x008bf000)
libboost_date_time.so.1.42.0 => /usr/lib/libboost_date_time.so.1.42.0 (0x00960000)
libfreeimage.so.3 => /usr/lib/libfreeimage.so.3 (0x00f82000)
libzzip-0.so.13 => /usr/lib/libzzip-0.so.13 (0x00973000)
libz.so.1 => /lib/i386-linux-gnu/libz.so.1 (0x0097a000)
/lib/ld-linux.so.2 (0x00c2e000)
libuuid.so.1 => /lib/i386-linux-gnu/libuuid.so.1 (0x008d4000)
libxcb.so.1 => /usr/lib/i386-linux-gnu/libxcb.so.1 (0x00b6e000)
libXmu.so.6 => /usr/lib/libXmu.so.6 (0x00b87000)
libXpm.so.4 => /usr/lib/libXpm.so.4 (0x0098f000)
libXau.so.6 => /usr/lib/i386-linux-gnu/libXau.so.6 (0x00b9d000)
libXdmcp.so.6 => /usr/lib/i386-linux-gnu/libXdmcp.so.6 (0x00ba1000)
  • 1 1 Answer
  • 1 View
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T05:59:25+00:00Added an answer on May 26, 2026 at 5:59 am

    I’ve finally fixed my problem. I deleted all boost & ogre related libraries and recompiled boost and then ogre and reinstalled them. Now things work fine (apparently!). Thanks for all the help but I guess a fresh reinstall is all I needed. Few, I’m glad that’s over!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very strange problem. (fyi - I'm using forms authentication and manually
I have a very strange problem and the following code wont compile: #ifndef MYWINDOW_HPP_INCLUDED
I've got a very strange problem recently. I have a code which processes inApp
I have very strange problem with Doxygen: I used it to create documentation from
I have a strange problem. Using wsimport I generated als JAX-WS Code from a
I have a very strange problem with my code. It will fully run the
I have a very strange problem when it comes to create shadows with the
I have encountered a very strange problem in using jQuery load() . I used
We have very strange problem, one of our applications is continually querying server by
I have a very strange problem. Under some elusive circumstances I fail to apply

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.