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 » Sun Jan 11, 2009 1:55 pm

Well id decide, to bite the bullet,
-format my linux partition
-Install linux 64
-download Ogre 1.6 for SVN
-Read the Bible, teh bible the Ramadan,
-Do some Callisthenic,
-follow the step for installing Ogre

after installing the 15 to 20 libraries Ogre uses I finally build Ogre 1.6.0

The reason start with a clean slate is the I did no want to have legacy of older version of Ogre, and I do no know who to delete the so I reformat the drive, that sure do it.

Anyway I change make file to link to teh corent libraries and thsi rteh output

make
gcc -m64 -O0 -mtune=generic -c -Wall -D_LINUX_VER -g -I sdkDemos -I sdkDemos/demos -I ../sdk/dMath -I ../sdk -I /usr/local/include/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 /usr/local/include/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 /usr/local/include/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 /usr/local/include/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 -L/usr/X11R6/lib -lGL -lGLU -lglut -lglui -lpthread -lGLEW -lOgreMain-1.6.0 -o CrashTest.elf
julio@julio-desktop:~/Desktop/OgreCrash/samples$
julio@julio-desktop:~/Desktop/OgreCrash/samples$



I also change the path for the Render library to this:
const Ogre::String pluginPath = "/usr/local/lib/OGRE/";


The I run the CreatTest demo under KDGB and it do no crash.
I does the same thin it did when runnig under Ogree 1.4.9
I runs until if finish and print Success! Dams..

are you sure thsi demo crash in your system?
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 » Sun Jan 11, 2009 4:52 pm

Well I was plain with the SDK demo to see if I can recreate the crash and I thonk you are right there is a crash bug in 64 bit mode.
It do no seem to be in 32 bit.
It is not a Ogre of linux thing, so I should be able to reproduce it in Window 64 as well.
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 » Sun Jan 11, 2009 7:07 pm

Yes they is bug in teh memory allocation in 64 bit mode when allocation very large island.

I build the 64 bit version on win xp 64 and I get the crash on exit.
It does no happens int 32 biut mode, so it most be some wher I am doing pointe arithmetic with integers.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Segfault when processing contacts

Postby hpesoj » Sun Jan 11, 2009 7:53 pm

Well, this is good news (in the sense that I haven't been leading you on a wild goose chase :D ). So have you now also managed to reproduce the bug on 64-bit Linux?

Thanks again for sticking at it; me and all the 64-bit users out there (helloooo... ;) ) really appreciate it.
hpesoj
 
Posts: 90
Joined: Sun Jan 09, 2005 4:36 pm
Location: Cambridge/Bristol, UK

Re: Segfault when processing contacts

Postby Julio Jerez » Sun Jan 11, 2009 9:20 pm

I think I fixed, I was doing some stupid pointer arithmetic that fai bad when the pointer size was not 4.
It only happens all the time but it will be seen only when the array size grow very large.

I change the memory chunk size of 64 bit system to be 16k instead of 8K, and the triggered in one of the demos.
I am positive this is the same bug in you system, and I also believe that the memory manger in Ogre exposed since heap allocation depends on the memory manger implementation.
anyway I beleive is fix now.

I also enable the Simd code for linux, but GCC is is very mediocre with intrisic, an dteh code is only 10 to 20%

the same code in VS8 is over 100% faster, that write SSE code in VS8 and the new core duo get over twice as fast some time even tree time faster.
In the end the engine is about twice as fast in windows, tan it is in Linux.

I am wondering f for Linux I should try Intel for 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 » Mon Jan 12, 2009 3:24 am

OK the bug is fixed you can download the SDK.

I am sorry for thr peoplr woh use GCC. Now That I have Linux 64 and XP 64 in the same machine for the first time I confirm that GCC 4.3.1 at its higher optimization setting halh teh performance of Visual studio at it highest.
Linux code generation using SSE intrinsics and x87 is atrocios.

the 900 boxes pyramid in my system runs at 60 fps in x87, and 120 in SSE with auto sleep off
In linux is about 30 in x87 and about 35 with SSE.
I will try to download the intill compiler trial to see if I get better result, because GCC is completly unaceptable.

I still need to make an optimization to the solver, but I wish GCC was better at code generation.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Segfault when processing contacts

Postby martinsm » Mon Jan 12, 2009 7:20 am

Are you sure you have turned on code optimizations for your GCC build? I can not believe you get such worse performance comparing to MSVC. Some time ago I was playing with raytracing rendering and there GCC latest versions with optimzation settings turned on was usually superior to MSVC. Even on Windows (with unofficial MinGW builds). Also many people says that latest GCC versions are much much better comparing to old GCC versions, which indeed generated slower executables than MSVC.

I strongly suspect that you have not enabled correct compiler settings for optimization (at least -O3 and correct -march), because GCC performance should be approximately same, not twice (!) slower. For some information about GCC compiler you can read this forum topic on ompf.org site: http://ompf.org/forum/viewtopic.php?f=11&t=896

Also - do you have rendering your simulation? Because maybe linux video drivers are slower than on Windows. That also could be an explanation of performance differences.
martinsm
 
Posts: 86
Joined: Mon Dec 19, 2005 3:15 pm
Location: Latvia

Re: Segfault when processing contacts

Postby Julio Jerez » Mon Jan 12, 2009 10:00 am

It is absoltly truth, in fact I was off bu abput 30% if I compared VS in 64 bit mode.
The performace I am talking about is only the physics sismulation, do not include anything.

teh same scene in VS 64 mode run at abput 100 fps, and over 200 fos in SSE
in GCC 64 is no more than 30 and 35, is is a apuling performce, but is is somethong I suspefet fo ra long time.

It codul no undertan why teh engoen was so slow on MAC pro, whick was far superion that teh PC, and the was teh reason
these are the compiler switch I am using to buidl teh enegine

# Linux options gcc 4.2.2
CPU_FLAGS = -fPIC -m64 -O3 -mtune=generic
FLAGS = -c -Wall -Wno-strict-aliasing -D_LINUX_VER -ffloat-store -ffast-math -fomit-frame-pointer -fsingle-precision-constant $(CPU_FLAGS) -I$(DG_INCLUDED_PATH) -I$(DG_INCLUDED_PHYSICS_PATH)
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Segfault when processing contacts

Postby hpesoj » Mon Jan 12, 2009 1:48 pm

Works fine now Julio, thank's a lot!

That speed issue sounds kind of suspect; I too can't reasonably believe that GCC is inherently that much slower. You must be missing some kind of optimization option somewhere. If GCC were that insanely slow, no-one would use it.
hpesoj
 
Posts: 90
Joined: Sun Jan 09, 2005 4:36 pm
Location: Cambridge/Bristol, UK

Re: Segfault when processing contacts

Postby Julio Jerez » Mon Jan 12, 2009 2:11 pm

Has anyone experimented with teh Intel compiler.
I truied to download the free version but teh intaller stop, on some missing 32 bit libraries.

I would like to try to see if it is any better.
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 » Mon Jan 12, 2009 3:35 pm

Jesus I really, realy do not understand what it is with the Linux poeple that they refuse to make a standarized installation prossess for software.
In Window you have setup, in the Mac you unpack package. In Linux everything is different

It appears that the intel compiler in 64 bit required a tone of 32 bit libraries that no one seems to know how to get them going.
when you look for informatiobn about linux 99.99% of the questions are related to Installition failures, and most questions go un anwered.
Take a look at this:
http://software.intel.com/en-us/forums/ ... pic/54359/

Intel blame unbunto, unbuntu blame intel, and the truth is that if you use this with Fedora, or Debian, or RedHat you will run into a new set of errors.
Don't Linux people realize that this is a real problem that hamper Linux popularity?
This is why only nerds use linux, they get a rush from seen GGCC compiling, running ./config, or ./boostrap, doing teh sudo stuff, and what other mombojumbo they have.
but people who use the computer for production do not really have time for that,.
Julio Jerez
Moderator
Moderator
 
Posts: 12249
Joined: Sun Sep 14, 2003 2:18 pm
Location: Los Angeles

Re: Segfault when processing contacts

Postby martinsm » Mon Jan 12, 2009 5:59 pm

Julio Jerez wrote:# Linux options gcc 4.2.2
CPU_FLAGS = -fPIC -m64 -O3 -mtune=generic
FLAGS = -c -Wall -Wno-strict-aliasing -D_LINUX_VER -ffloat-store -ffast-math -fomit-frame-pointer -fsingle-precision-constant $(CPU_FLAGS) -I$(DG_INCLUDED_PATH) -I$(DG_INCLUDED_PHYSICS_PATH)


hm.. nothing strange here.
Maybe you could try to remove -mtune=generic? Also can you try it with -O2 and with -Os instead of -O3?
martinsm
 
Posts: 86
Joined: Mon Dec 19, 2005 3:15 pm
Location: Latvia

Re: Segfault when processing contacts

Postby agi_shi » Mon Jan 12, 2009 6:18 pm

Thanks for the bug fix! :D

Yes, the GCC slowness does seem very odd. I've noticed -O2 is sometimes better than -O3.
agi_shi
 
Posts: 263
Joined: Fri Aug 17, 2007 6:54 pm

Re: Segfault when processing contacts

Postby Julio Jerez » Fri Jan 23, 2009 5:48 pm

I think this is why linux is much slower that windows
http://software.intel.com/en-us/blogs/2 ... x-threads/

It is some thong taht I suposted for a long time but I codu no verify sine I am no linux experet. All I knwo taht every think I do in window is at minimun twice as fast as it is 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 hpesoj » Sun Jan 25, 2009 10:16 pm

I've had a look through that thread, and I can't see any arguments for POSIX threads being slower than windows threads. If anything there are people arguing the exact opposite (though the most informed poster seems to think there is negligible difference). The thread seems to in fact be about the Windows API being more user friendly than the POSIX API. I am confused as to what you think is causing the problem Julio, could you point it out?

So I guess this speed issue only a problem when multi-threading is enabled?
hpesoj
 
Posts: 90
Joined: Sun Jan 09, 2005 4:36 pm
Location: Cambridge/Bristol, UK

PreviousNext

Return to Bugs and Fixes

Who is online

Users browsing this forum: No registered users and 4 guests