Segfault when processing contacts

Report any bugs here and we'll post fixes

Moderators: Sascha Willems, Thomas

Re: Segfault when processing contacts

Postby Julio Jerez » Thu Jan 08, 2009 2:59 am

Well after about tow hours of trying different install mode I got ogre to go this far

make[5]: Leaving directory `/home/julio/ogre/RenderSystems/GL/src/GLSL/src'
make[5]: Entering directory `/home/julio/ogre/RenderSystems/GL/src/GLSL'
make[5]: Nothing to be done for `all-am'.
make[5]: Leaving directory `/home/julio/ogre/RenderSystems/GL/src/GLSL'
make[4]: Leaving directory `/home/julio/ogre/RenderSystems/GL/src/GLSL'
make[4]: Entering directory `/home/julio/ogre/RenderSystems/GL/src'
/bin/bash ../../../libtool --tag=CXX --mode=link g++ -g -O2 -fPIC -module -shared -avoid-version -L../../../OgreMain/src -Wl,-z,defs -o RenderSystem_GL.la -rpath /usr/local/lib/OGRE OgreGLEngineDll.lo OgreGLPlugin.lo OgreGLGpuProgram.lo OgreGLGpuNvparseProgram.lo OgreGLGpuProgramManager.lo OgreGLRenderSystem.lo OgreGLSupport.lo OgreGLTexture.lo OgreGLTextureManager.lo OgreGLHardwareBufferManager.lo OgreGLHardwareIndexBuffer.lo OgreGLHardwareOcclusionQuery.lo OgreGLHardwareVertexBuffer.lo OgreGLHardwarePixelBuffer.lo OgreGLDefaultHardwareBufferManager.lo OgreGLContext.lo OgreGLPixelFormat.lo OgreGLRenderTexture.lo OgreGLRenderToVertexBuffer.lo OgreGLFBORenderTexture.lo OgreGLPBRenderTexture.lo OgreGLFBOMultiRenderTarget.lo OgreGLFrameBufferObject.lo glew.lo ../../../RenderSystems/GL/src/GLX/libsupport.la ../../../RenderSystems/GL/src/GLSL/src/libGLSL.la ../../../RenderSystems/GL/src/nvparse/libnvparse.la ../../../RenderSystems/GL/src/atifs/src/libatifs.la -lGL -lGLU -lX11 -lXext -lGL -lXrandr -lXxf86vm -lOgreMain -lfreeimage -lpthread -lz -lm -ldl
libtool: link: g++ -shared -nostdlib /usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/crti.o /usr/lib/gcc/x86_64-linux-gnu/4.3.2/crtbeginS.o .libs/OgreGLEngineDll.o .libs/OgreGLPlugin.o .libs/OgreGLGpuProgram.o .libs/OgreGLGpuNvparseProgram.o .libs/OgreGLGpuProgramManager.o .libs/OgreGLRenderSystem.o .libs/OgreGLSupport.o .libs/OgreGLTexture.o .libs/OgreGLTextureManager.o .libs/OgreGLHardwareBufferManager.o .libs/OgreGLHardwareIndexBuffer.o .libs/OgreGLHardwareOcclusionQuery.o .libs/OgreGLHardwareVertexBuffer.o .libs/OgreGLHardwarePixelBuffer.o .libs/OgreGLDefaultHardwareBufferManager.o .libs/OgreGLContext.o .libs/OgreGLPixelFormat.o .libs/OgreGLRenderTexture.o .libs/OgreGLRenderToVertexBuffer.o .libs/OgreGLFBORenderTexture.o .libs/OgreGLPBRenderTexture.o .libs/OgreGLFBOMultiRenderTarget.o .libs/OgreGLFrameBufferObject.o .libs/glew.o -Wl,--whole-archive ../../../RenderSystems/GL/src/GLX/.libs/libsupport.a ../../../RenderSystems/GL/src/GLSL/src/.libs/libGLSL.a ../../../RenderSystems/GL/src/nvparse/.libs/libnvparse.a ../../../RenderSystems/GL/src/atifs/src/.libs/libatifs.a -Wl,--no-whole-archive -Wl,-rpath -Wl,/home/julio/ogre/OgreMain/src/.libs -L/home/julio/ogre/OgreMain/src -lGLU -lXext -lGL -lXrandr -lXxf86vm /home/julio/ogre/OgreMain/src/.libs/libOgreMain.so /usr/lib/libfreetype.so /usr/lib/libzzip.so -lX11 -lXaw -lXt -lSM -lICE -lfreeimage -lpthread -lz -ldl -L/usr/lib/gcc/x86_64-linux-gnu/4.3.2 -L/usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib -L/lib/../lib -L/usr/lib/../lib -L/usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../.. -lstdc++ -lm -lc -lgcc_s /usr/lib/gcc/x86_64-linux-gnu/4.3.2/crtendS.o /usr/lib/gcc/x86_64-linux-gnu/4.3.2/../../../../lib/crtn.o -Wl,-z -Wl,defs -Wl,-soname -Wl,RenderSystem_GL.so -o .libs/RenderSystem_GL.so
/usr/bin/ld: cannot find -lXxf86vm
collect2: ld returned 1 exit status
make[4]: *** [RenderSystem_GL.la] Error 1
make[4]: Leaving directory `/home/julio/ogre/RenderSystems/GL/src'
make[3]: *** [all-recursive] Error 1
make[3]: Leaving directory `/home/julio/ogre/RenderSystems/GL/src'
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory `/home/julio/ogre/RenderSystems/GL'
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory `/home/julio/ogre/RenderSystems'
make: *** [all-recursive] Error 1
julio@julio:~/ogre$


I do not really know what else to do, I do not think my brain is smart enough to understand the extremes complexity of Ogre installation.

When I check the Synaptic in ubuntu, i see there is a ogre 1.4.9-dev
but not for 1.6 which is the version you are using, maybe you can get the people of the Ogre community to make the synaptic stuff work, Newton is not a welcome tool over there so I won't even try..
Other than that I do not really what else to do to get this running.


when I build using the current test you email me I get this error
"can not open shared library linogremain-1.6.1.so"
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Segfault when processing contacts

Postby hpesoj » Thu Jan 08, 2009 10:55 am

I think there are attempts (though how ongoing I know not) to maintain a package for Ogre. How come Newton isn't a welcome tool? In what sense? Just because it isn't open source? I mean, OgreNewt has its own board.

Anyway, you should check your private messages, I sent you a download which should work straight off without needing to compile Ogre.

And building from makefiles is not a question of smarts (you've written a freaking amazing Physics engine :P), just experience (i.e. tedious repetition). It looks like you are almost there:

/usr/bin/ld: cannot find -lXxf86vm

That means the linker (ld) cannot find the library Xxf86vm. In synaptic and you will find a library called libxxf86vm1, this will install that library (library packages usually begin with lib). Sometimes you may also need the library headers, who's package ends in -dev. Anyway, hopefully you can forget about this unless you like a challenge :). Tell me how the file I uploaded goes.
hpesoj
 
Posts: 90
Joined: Sun Jan 09, 2005 4:36 pm
Location: Cambridge/Bristol, UK

Re: Segfault when processing contacts

Postby Julio Jerez » Thu Jan 08, 2009 11:32 am

Ok I downloaded the file you send me, and did this

make
gcc -m64 -O0 -mtune=generic -c -Wall -D_LINUX_VER -g -I sdkDemos -I sdkDemos/demos -I ../sdk/dMath -I ../sdk -I ogre -o sdkDemos/OgreCrash.o sdkDemos/OgreCrash.cpp
gcc -m64 -O0 -mtune=generic -c -Wall -D_LINUX_VER -g -I sdkDemos -I sdkDemos/demos -I ../sdk/dMath -I ../sdk -I ogre -o ../sdk/dMath/dMathDefines.o ../sdk/dMath/dMathDefines.cpp
gcc -m64 -O0 -mtune=generic -c -Wall -D_LINUX_VER -g -I sdkDemos -I sdkDemos/demos -I ../sdk/dMath -I ../sdk -I ogre -o ../sdk/dMath/dMatrix.o ../sdk/dMath/dMatrix.cpp
gcc -m64 -O0 -mtune=generic -c -Wall -D_LINUX_VER -g -I sdkDemos -I sdkDemos/demos -I ../sdk/dMath -I ../sdk -I ogre -o ../sdk/dMath/dQuaternion.o ../sdk/dMath/dQuaternion.cpp
gcc sdkDemos/OgreCrash.o ../sdk/dMath/dMathDefines.o ../sdk/dMath/dMatrix.o ../sdk/dMath/dQuaternion.o ../sdk/libNewton.a ogre/libOgreMain-1.6.0.so -L/usr/X11R6/lib -lGL -lGLU -lglut -lglui -lpthread -lGLEW -o CrashTest.elf
julio@julio:~/OgreCrash/samples$


but when I run it it print this message
error while loading shared libraries: libOgreMain-1.6.0.so: cannot open object file: no such file or directory


when do I need to copy the library so that the elf can see it?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Segfault when processing contacts

Postby Julio Jerez » Thu Jan 08, 2009 11:44 am

correct me I am am wrong but isn't this as simple as copieng the library in some folder so that the elf can load it?
If I am write, is the reason that it is virtually inppossible to have the library libOgreMain-1.6.1.so because some open source rule that you have to download and compile it.

I do no understant why it is that the library you send me is name RenderSystem_GL.so when the library that the elf is asking for is name libOgreMain-1.6.1.so
should I rename it,
How can I have a copy of libOgreMain-1.6.1.so ?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Segfault when processing contacts

Postby Julio Jerez » Thu Jan 08, 2009 11:50 am

O see you put the file in /home/julio/OgreCrash/samples/ogre/libOgreMain-1.6.0.so

so it is then a matter of placing it in some system fordel,
I place it in the same folder as the elf but that do no works, do you know what folder I have to place it so the it is visible to the loader?

when I installed Ogre 1.4.9 it copyes teh libraries in teh folder systemfiel/usr/lib64
but i can no copied the file to that folder Linux do no let me write there. It says permission denied.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Segfault when processing contacts

Postby Julio Jerez » Thu Jan 08, 2009 12:30 pm

on my last attend to see if I can get this running I change teh make file to link to the system Ogre library which will be OgreMain 1.4.9

I found something very interesting, take a look

make
gcc sdkDemos/OgreCrash.o ../sdk/dMath/dMathDefines.o ../sdk/dMath/dMatrix.o ../sdk/dMath/dQuaternion.o ../sdk/libNewton.a -L/usr/X11R6/lib -lGL -lGLU -lglut -lglui -lpthread -lGLEW -lOgreMain -o CrashTest.elf
sdkDemos/OgreCrash.o: In function `Ogre::NedAllocPolicy::allocateBytes(unsigned long, char const*, int, char const*)':
/home/julio/OgreCrash/samples/ogre/OgreMemoryNedAlloc.h:65: undefined reference to `Ogre::NedAllocImpl::allocBytes(unsigned long, char const*, int, char const*)'
sdkDemos/OgreCrash.o: In function `Ogre::NedAllocPolicy::deallocateBytes(void*)':
/home/julio/OgreCrash/samples/ogre/OgreMemoryNedAlloc.h:69: undefined reference to `Ogre::NedAllocImpl::deallocBytes(void*)'
collect2: ld returned 1 exit status
make: *** [CrashTest] Error 1
julio@julio:~/OgreCrash/samples$


It appears that one of the different between Ogre 1.4.9 and 1.6.0 is the memory manager.
they are using, my guess is the allocator is crashing there, maybe the new allocator is using a fix size Heap fo allocation and is crashing of the heap goes beyond the limit. It is a speculation but, but does stht sound a bell, does Ogre has some control for memory Heap size?
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Segfault when processing contacts

Postby Julio Jerez » Thu Jan 08, 2009 12:58 pm

This is unbelievable, I try to change so that teh app build using Ogre 1.4.9
after I compile and link, the game still do not launch, it does no find the library RenderSystem_GL

The pass teh chanleging, the sublime and or the amusing, the is plain and simple ridicules.
Does Ogre links to all of the open source libraries there are in the internet?

This is too tough fo me.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Segfault when processing contacts

Postby hpesoj » Thu Jan 08, 2009 2:07 pm

Sorry Julio, I feel like I'm really messing you around here. I absolutely hate linking and libraries with a passion, so we have something in common.

When you run the .elf file, it looks for the shared libraries it needs, first in the current directory, then in directories like /usr/lib and /usr/local/lib. It can't find it for you because the library is inside the ogre/ directory. It ran for me because I have a copy of OgreMain.so in /usr/local/lib, which is why I mistakenly thought everything was fine. Solution: either copy the library to same directory as the .elf, or copy it to your /usr/local/lib folder using:

Code: Select all
sudo cp OgreMain.so /usr/local/lib


sudo is needed to get administrator privileges, because most things outside of /home/<username> are protected.

As for RenderSystem_Gl not loading, it may be because I gave you the 1.6.0 RenderSystem_GL library, which is most likely incompatible with the 1.4.9 OgreMain library. Otherwise, make sure that the pluginPath variable in OgreCrash.cpp points to the directory containing RenderSystem_GL.so; it is loaded dynamically in-code at the following line:

Code: Select all
root->loadPlugin(pluginPath + "RenderSystem_GL");


As for the memory manager, I was aware that it has been introduced in 1.6.0, but I don't know anything about it. This may help:

http://www.ogre3d.org/docs/api/html/memory_manager.html

Sorry if I'm not explaining things well enough, I'm trying my hardest :P.
hpesoj
 
Posts: 90
Joined: Sun Jan 09, 2005 4:36 pm
Location: Cambridge/Bristol, UK

Re: Segfault when processing contacts

Postby hpesoj » Thu Jan 08, 2009 2:34 pm

Ok, so after testing myself, it seems that you do need to have the OgreMain library in a system directory (grr, linking). If you want to know what shared libraries the binary is looking for/using, use the ldd command line tool:

Code: Select all
ldd ./CrashTest.elf


You may also need to run:

Code: Select all
sudo ldconfig


after copying the OgreMain library into /usr/local/lib.

This is why I hate linking...
hpesoj
 
Posts: 90
Joined: Sun Jan 09, 2005 4:36 pm
Location: Cambridge/Bristol, UK

Re: Segfault when processing contacts

Postby Julio Jerez » Fri Jan 09, 2009 11:49 am

hpesoj wrote:Ok, so after testing myself, it seems that you do need to have the OgreMain library in a system directory (grr, linking). If you want to know what shared libraries the binary is looking for/using, use the ldd command line tool:
Code: Select all
ldd ./CrashTest.elf


After I run that command this is what I get

julio@julio:~$ cd OgreCrash/samples/
julio@julio:~/OgreCrash/samples$ ldd ./CrashTest.elf
linux-vdso.so.1 => (0x00007fff9dfff000)
libGL.so.1 => /usr/lib/libGL.so.1 (0x00007f7395c64000)
libGLU.so.1 => /usr/lib/libGLU.so.1 (0x00007f73959b4000)
libglut.so.3 => /usr/lib/libglut.so.3 (0x00007f7395771000)
libglui.so.2 => /usr/lib/libglui.so.2 (0x00007f7395633000)
libpthread.so.0 => /lib/libpthread.so.0 (0x00007f7395417000)
libGLEW.so.1.5 => /usr/lib/libGLEW.so.1.5 (0x00007f73951d2000)
libOgreMain-1.4.9.so => /usr/lib/libOgreMain-1.4.9.so (0x00007f7394c02000)
libgcc_s.so.1 => /lib/libgcc_s.so.1 (0x00007f73949ea000)
libc.so.6 => /lib/libc.so.6 (0x00007f7394678000)
libm.so.6 => /lib/libm.so.6 (0x00007f73943f3000)
libstdc++.so.6 => /usr/lib/libstdc++.so.6 (0x00007f73940e6000)
libGLcore.so.1 => /usr/lib/libGLcore.so.1 (0x00007f739302c000)
libnvidia-tls.so.1 => /usr/lib/tls/libnvidia-tls.so.1 (0x00007f7392f2b000)
libXext.so.6 => /usr/lib/libXext.so.6 (0x00007f7392d19000)22You may also need to run:


libX11.so.6 => /usr/lib/libX11.so.6 (0x00007f7392a11000)
libdl.so.2 => /lib/libdl.so.2 (0x00007f739280d000)
/lib64/ld-linux-x86-64.so.2 (0x00007f7395c26000)
libXmu.so.6 => /usr/lib/libXmu.so.6 (0x00007f73925f4000)
libXi.so.6 => /usr/lib/libXi.so.6 (0x00007f73923e9000)
libfreetype.so.6 => /usr/lib/libfreetype.so.6 (0x00007f7392165000)
libzzip-0.so.13 => /usr/lib/libzzip-0.so.13 (0x00007f7391f5e000)
libXaw.so.7 => /usr/lib/libXaw.so.7 (0x00007f7391cef000)
libXt.so.6 => /usr/lib/libXt.so.6 (0x00007f7391a8b000)
libSM.so.6 => /usr/lib/libSM.so.6 (0x00007f7391882000)
libICE.so.6 => /usr/lib/libICE.so.6 (0x00007f7391667000)
libfreeimage.so.3 => /usr/lib/libfreeimage.so.3 (0x00007f73911c3000)
libz.so.1 => /usr/lib/libz.so.1 (0x00007f7390fab000)
libXau.so.6 => /usr/lib/libXau.so.6 (0x00007f7390da9000)
libxcb-xlib.so.0 => /usr/lib/libxcb-xlib.so.0 (0x00007f7390ba7000)
libxcb.so.1 => /usr/lib/libxcb.so.1 (0x00007f739098b000)
libXpm.so.4 => /usr/lib/libXpm.so.4 (0x00007f739077a000)
libXdmcp.so.6 => /usr/lib/libXdmcp.so.6 (0x00007f7390575000)
julio@julio:~/OgreCrash/samples$
[/quote]

no where I find reference to to library RenderSystem_GL, which is what I expect since the elf is no linked to that library, instead is loading it like a piece of data.
You can see the code is using library libOgreMain-1.4.9.so
and the appropriate RenderSystem_GL is in folder /usr/OGRE

I have try all permutation of this already and nothing seem to work, the is no way the code can load that library.
I do no really know why it is necessary to load the library when it can be link a compiler time.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Segfault when processing contacts

Postby Julio Jerez » Fri Jan 09, 2009 11:54 am

who would the path to the system library?

you wrote in teh cpp file this

const Ogre::String pluginPath = "ogre/";


but the library is at usr/lib/OGRE/
but if I chage that line to

const Ogre::String pluginPath = "usr/lib/OGRE/";

I assume it is because the path is still uncompleted, do you know how to specify an absolute path in linux
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Segfault when processing contacts

Postby Julio Jerez » Fri Jan 09, 2009 12:37 pm

Hey I chenge teh path for this:

const Ogre::String pluginPath = "usr/lib/OGRE/";

to this
const Ogre::String pluginPath = "/usr/lib/OGRE/";

and now it works.

the program runs and is does a bunch of allocations, the it shot down ogre and prints

Success! Damn...

I did not see any crash, Of coruse I build this with Ogre 1.4.9.
Maybe the crash happens only with Ogre 1.6.0

But Man installing that is a Task bugger then the 12 labours of Hercules, I do no really have the linux skills to Install Ogre without a Synaptic Manager that does for me autmatically.

Like I sad I beleieve this is related to Ogre Memory Manager trying to be to smart and running other Libraries.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Segfault when processing contacts

Postby agi_shi » Fri Jan 09, 2009 5:12 pm

Hm... Yes, we didn't notice this crash under Ogre 1.4.x, I think the earliest we saw it was when we upgraded to 1.6.x ... hm. This is very intriguing.
agi_shi
 
Posts: 263
Joined: Fri Aug 17, 2007 6:54 pm

Re: Segfault when processing contacts

Postby hpesoj » Fri Jan 09, 2009 9:17 pm

Very intriguing indeed. Well at least now you have it working with Ogre 1.4 it should be easy to link to Ogre 1.6; all you need to do is:

1. Copy the OgreMain library I sent you (the 1.6.0 one) into /usr/local/lib, and link against that one instead. Remember you can use ldd to see which library the .elf file is using, and you may need to sudo ldconfig to refresh the shared library records.
2. Make sure you specify the 1.6 include directory instead of the 1.4 include directory (i.e. ./ogre instead of /usr/include/OGRE or whatever).

I only wish I could set this whole thing up for you. No doubt it will turn out to be Ogre's fault after all this :(...
hpesoj
 
Posts: 90
Joined: Sun Jan 09, 2005 4:36 pm
Location: Cambridge/Bristol, UK

Re: Segfault when processing contacts

Postby agi_shi » Fri Jan 09, 2009 11:09 pm

Lets see what happens with 1.6, if it occurs then I will raise the issue on the Ogre forums (I'm nullsquared on there) and see what we can come up that would cause this...
agi_shi
 
Posts: 263
Joined: Fri Aug 17, 2007 6:54 pm

PreviousNext

Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 9 guests

cron