POV-Ray : Newsgroups : povray.beta-test : Linux Beta 28 segfaults on Slackware and Kubuntu : Re: Linux Beta 28 segfaults on Slackware and Kubuntu Server Time
29 Apr 2024 13:21:01 EDT (-0400)
  Re: Linux Beta 28 segfaults on Slackware and Kubuntu  
From: geep999
Date: 15 Sep 2008 19:00:01
Message: <web.48cee652cfc4a246d9d541e00@news.povray.org>
Le Forgeron <jgr### [at] freefr> wrote:
> Le Sat, 06 Sep 2008 06:44:24 -0400, geep999 a modifié des petits morceaux

>
> >> > If anybody get a clue, please share...

Another tidbit...

I have a workaround for the segfault on m_textures.ini. Details appended
below...

Ran povray with DUMA - Detect Unintended Memory Access -
http://duma.sourceforge.net/
DUMA pointed to this line of code: render/trace.cpp:1611
I ran this several times and the segfault always occurred here.
Simlar result with scenes/advanced/wineglass.pov
The previous inconsistent segfaults aren't present running with DUMA.

Doing a kompare of trace.cpp between beta28 and beta25b it is easy to see how
the block of code around line 1611 has been changed.
I reverted this block of code to the beta25 version, et voila, no more crashes.

The 14 .png files produced by m_textures.ini look the same as from beta25.

Would be interested if mon ami Le Forgeron can replicate this workaround.

Hope this isn't a red herring, as I admit that I don't know the functionality of
the code I reverted and any unintended consequences.

Salutations,
Peter

0/ D.U.M.A. - Detect Unintended Memory Access http://duma.sourceforge.net/

1/ I followed these instructions which are extracted from DUMA's README.txt...

You can also use dynamic linking. If you're using a Bourne shell, the statement
'export LD_PRELOAD=libduma.so.0.0' will cause DUMA to be loaded to run all
dynamic executables

CATCHING THE ERRONEOUS LINE:

1. Compile your program (with debugging information) without DUMA.
2. Set 'ulimit -c unlimited' to get core files
3. Start your program, choose one of following options
   a) Start your program (linked statically with DUMA)
   b) Start your program with duma.sh <your_program>
4. Wait for a segmentation fault. this should have created a core[.<pid>]
   file. You can get into a debugger f.e. with 'gdb <program> -c <core file>'


2/ Installed DUMA and copied the file duma.sh into the directory containing
m_textures.ini

sudo sysctl -w vm.max_map_count=1000000
ulimit -c unlimited
export LD_PRELOAD=libduma.so.0.0

../duma.sh povray m_textures.ini +Q11

../duma.sh: line 17: 30426 Segmentation fault      (core dumped) ( export
LD_PRELOAD=libduma.so.0.0.0; export DYLD_INSERT_LIBRARIES=libduma.dylib; export
DYLD_FORCE_FLAT_NAMESPACE=1; exec $* )

gdb povray -c core.30426

Stacktrace messages ended with:
Core was generated by `povray m_textures.ini +Q11'.
Program terminated with signal 11, Segmentation fault.
#0  0x0819b5c6 in pov::Trace::ComputeOneDiffuseLight (this=0xae5134c4,
lightsource=0xae3adec0, reye=@0xad91e560, finish=0xaf1a8f8c,
ipoint=@0xad91e98c, eye=@0xad91f20c, layer_normal=@0xad91ea68,
    layer_pigment_colour=@0xad91ea28, colour=@0xad91e9d8,
attenuation=0.30000001192092896, object=0xaf198f6c, light_index=0) at
render/trace.cpp:1611
1611                                    lcc.tested = true;

......and from wineglass.pov too...
Core was generated by `povray wineglass.pov'.
Program terminated with signal 11, Segmentation fault.
#0  0x0819b5c6 in pov::Trace::ComputeOneDiffuseLight (this=0xaa1bf4c4,
lightsource=0xaa219ec0, reye=@0xa9cb98f0, finish=0xaaf09f8c,
ipoint=@0xa9cb9d1c, eye=@0xa9cba5b4, layer_normal=@0xa9cb9df8,
    layer_pigment_colour=@0xa9cb9db8, colour=@0xa9cb9d68,
attenuation=0.050000011920928955, object=0xaaefbf48, light_index=0) at
render/trace.cpp:1611
1611                                    lcc.tested = true;

Source Code...

beta28 source/backend/render/trace.cpp
1601 // If light source was not blocked by any intervening object, then
1602 // calculate it's contribution to the object's overall illumination.
1603 if ((qualityFlags & Q_SHADOW) && ((lightsource->Projected_Through_Object !=
NULL) || (lightsource->Light_Type != FILL_LIGHT_SOURCE)))
1604 {
1605  if (lightColorCacheIndex != -1 && light_index != -1)
1606  {
1607   LightColorCache& lcc(lightColorCache[lightColorCacheIndex][light_index]);
1608   if (lcc.tested == false)
1609   {
1610    TraceShadowRay(lightsource, lightsourcedepth, lightsourceray, eye,
ipoint, lightcolour);
1611    lcc.tested = true;
1612    lcc.colour = lightcolour;
1613   }
1614   else
1615    lightcolour = lcc.colour;
1616  }
1617  else
1618   TraceShadowRay(lightsource, lightsourcedepth, lightsourceray, eye,
ipoint, lightcolour);
1619 }

beta25b source/backend/render/trace.cpp
1581 // If light source was not blocked by any intervening object, then
1582 // calculate it's contribution to the object's overall illumination.
1583 if((qualityFlags & Q_SHADOW) && ((lightsource->Projected_Through_Object !=
NULL) || (lightsource->Light_Type != FILL_LIGHT_SOURCE)))
1584  TraceShadowRay(lightsource, lightsourcedepth, lightsourceray, eye, ipoint,
lightcolour);


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.