Light sampling

Discussion related to the implementation of new features & algorithms to the Core Engine.

Moderators: jromang, tomb, zcott, coordinators

Re: Light sampling

Postby jensverwiebe » Sun May 13, 2012 4:06 am

After last changes lightstrategy "one" seems to crash lux in all modes bidir-hybrid or bidir.

Code: Select all
Thread 12 Crashed:
0   libsystem_kernel.dylib           0x00007fff8dfdace2 __pthread_kill + 10
1   libsystem_c.dylib                0x00007fff898bf7d2 pthread_kill + 95
2   libsystem_c.dylib                0x00007fff898b0a7a abort + 143
3   libsystem_c.dylib                0x00007fff8990f84c free + 389
4   liblux.dylib                     0x00000001003095b7 std::vector<unsigned int, std::allocator<unsigned int> >::_M_insert_aux(__gnu_cxx::__normal_iterator<unsigned int*, std::vector<unsigned int, std::allocator<unsigned int> > >, unsigned int const&) + 295
5   liblux.dylib                     0x00000001003867b8 lux::BidirIntegrator::RequestSamples(lux::Sample*, lux::Scene const&) + 1128
6   liblux.dylib                     0x00000001003f0e53 lux::SamplerRenderer::RenderThread::RenderImpl(lux::SamplerRenderer::RenderThread*) + 99
7   liblux.dylib                     0x00000001006241a0 thread_proxy + 160
8   libsystem_c.dylib                0x00007fff898bd8bf _pthread_start + 335
9   libsystem_c.dylib                0x00007fff898c0b75 thread_start + 13


or

Code: Select all
Thread 10 Crashed:
0   liblux.dylib                     0x000000010042e8c0 lux::MetropolisSampler::GetOneD(lux::Sample const&, unsigned int, unsigned int) + 32
1   liblux.dylib                     0x000000010038c328 lux::BidirPathState::Init(lux::Scene const&) + 568
2   liblux.dylib                     0x0000000100404c40 lux::SurfaceIntegratorStateBuffer::SurfaceIntegratorStateBuffer(lux::Scene const&, lux::ContributionBuffer*, lux::RandomGenerator*, luxrays::RayBuffer*) + 208
3   liblux.dylib                     0x000000010040767d lux::HybridSamplerRenderer::RenderThread::RenderImpl(lux::HybridSamplerRenderer::RenderThread*) + 1197
4   liblux.dylib                     0x00000001006241a0 thread_proxy + 160
5   libsystem_c.dylib                0x00007fff898bd8bf _pthread_start + 335
6   libsystem_c.dylib                0x00007fff898c0b75 thread_start + 13


"Auto" works fine. Needs more investigation still.

luxrender(3324,0x10b887000) malloc: *** error for object 0x103c3c2d0: pointer being freed was not allocated

Edit: cleaned the build and recompiled and cannot reproduce with bidir anymore, onyl with hybrid bidir atm....
Edit2: bisected culprit down to [b]4a773ea2940b[/b]

Jens
Last edited by jensverwiebe on Sun May 13, 2012 5:59 am, edited 5 times in total.
User avatar
jensverwiebe
Developer
 
Posts: 2124
Joined: Wed Apr 02, 2008 4:34 pm

Re: Light sampling

Postby SATtva » Sun May 13, 2012 4:13 am

Linux builds packager
聞くのは一時の恥、聞かぬのは一生の恥
User avatar
SATtva
Developer
 
Posts: 5496
Joined: Tue Apr 07, 2009 12:19 pm
Location: from Siberia with love

Re: Light sampling

Postby jeanphi » Sun May 13, 2012 3:19 pm

Hi,

Thanks for the report, it should now be fixed.

Jeanphi
jeanphi
Developer
 
Posts: 6577
Joined: Mon Jan 14, 2008 7:21 am

Re: Light sampling

Postby J the Ninja » Thu May 17, 2012 2:34 pm

I've been having a weird, intermittent crash with bidir that cropped up recently. I have gotten it to happen with attached scene, but not consistently. You might need to try it a few times. It should crash eventually:

importance_test.zip
(5.04 KiB) Downloaded 11 times



The scene is simple, just two cubes, one of them emitting light, sitting on a plane with an area light overhead. Here's the postmortem from the OS, if it helps at all:

Code: Select all
Process:         luxrender [15007]
Path:            /Users/USER/*/LuxRender.app/Contents/MacOS/luxrender
Identifier:      org.luxrender.luxrender
Version:         0.9.dev (0.9.dev)
Code Type:       X86-64 (Native)
Parent Process:  launchd [230]

Date/Time:       2012-05-17 12:33:53.992 -0700
OS Version:      Mac OS X 10.7.4 (11E53)
Report Version:  9

Crashed Thread:  13

Exception Type:  EXC_CRASH (SIGABRT)
Exception Codes: 0x0000000000000000, 0x0000000000000000

Application Specific Information:
*** error for object 0x101ddea00: pointer being freed was not allocated

objc[15007]: garbage collection is OFF

Thread 13 Crashed:
0   libsystem_kernel.dylib           0x00007fff8dc94ce2 __pthread_kill + 10
1   libsystem_c.dylib                0x00007fff8bd077d2 pthread_kill + 95
2   libsystem_c.dylib                0x00007fff8bcf8a7a abort + 143
3   libsystem_c.dylib                0x00007fff8bd5784c free + 389
4   liblux.dylib                     0x0000000100308b47 std::vector<unsigned int, std::allocator<unsigned int> >::_M_insert_aux(__gnu_cxx::__normal_iterator<unsigned int*, std::vector<unsigned int, std::allocator<unsigned int> > >, unsigned int const&) + 295
5   liblux.dylib                     0x0000000100385d58 lux::BidirIntegrator::RequestSamples(lux::Sample*, lux::Scene const&) + 1144
6   liblux.dylib                     0x00000001003f03f3 lux::SamplerRenderer::RenderThread::RenderImpl(lux::SamplerRenderer::RenderThread*) + 99
7   liblux.dylib                     0x0000000100624000 thread_proxy + 160
8   libsystem_c.dylib                0x00007fff8bd058bf _pthread_start + 335
9   libsystem_c.dylib                0x00007fff8bd08b75 thread_start + 13


EDIT: Ignore the fact that the OS thinks this is an 0.9 build, it's reading the info.plist file that we forgot to update until now. It's the latest from the repo.
-Jason

Material DB Admin
User avatar
J the Ninja
Developer
 
Posts: 2210
Joined: Wed May 19, 2010 9:54 pm
Location: Portland, USA

Re: Light sampling

Postby jeanphi » Fri May 18, 2012 3:11 am

Hi,

The crash is in RequestSamples which is quite strange as there is nothing crash prone.

Jeanphi
jeanphi
Developer
 
Posts: 6577
Joined: Mon Jan 14, 2008 7:21 am

Re: Light sampling

Postby jensverwiebe » Fri May 18, 2012 4:29 am

Same here, i´ll debug this soon....

Code: Select all
luxrender(3017,0x10ede3000) malloc: *** error for object 0x106162b60: double free
*** set a breakpoint in malloc_error_break to debug
(lldb) bt
* thread #10: tid = 0x3903, 0x00007fff95c47ce2 libsystem_kernel.dylib`__pthread_kill + 10, stop reason = signal SIGABRT
    frame #0: 0x00007fff95c47ce2 libsystem_kernel.dylib`__pthread_kill + 10
    frame #1: 0x00007fff9152c7d2 libsystem_c.dylib`pthread_kill + 95
    frame #2: 0x00007fff9151da7a libsystem_c.dylib`abort + 143
    frame #3: 0x00007fff9153f4ac libsystem_c.dylib`szone_error + 459
    frame #4: 0x00007fff91540e2a libsystem_c.dylib`free_tiny_botch + 93
    frame #5: 0x00007fff9157c789 libsystem_c.dylib`free + 194
    frame #6: 0x0000000100311577 liblux.dylib`std::vector<unsigned int, std::allocator<unsigned int> >::_M_insert_aux(__gnu_cxx::__normal_iterator<unsigned int*, std::vector<unsigned int, std::allocator<unsigned int> > >, unsigned int const&) + 295
    frame #7: 0x000000010038e788 liblux.dylib`lux::BidirIntegrator::RequestSamples(lux::Sample*, lux::Scene const&) + 1144
    frame #8: 0x00000001003f8e43 liblux.dylib`lux::SamplerRenderer::RenderThread::RenderImpl(lux::SamplerRenderer::RenderThread*) + 99
    frame #9: 0x000000010062c120 liblux.dylib`thread_proxy + 160
    frame #10: 0x00007fff9152a8bf libsystem_c.dylib`_pthread_start + 335
    frame #11: 0x00007fff9152db75 libsystem_c.dylib`thread_start + 13
(lldb)


EDIT: from debug build:
Code: Select all
(lldb) bt
* thread #15: tid = 0x3a03, 0x00007fff91503e08 libsystem_c.dylib`memcpy$VARIANT$sse42 + 331, stop reason = EXC_BAD_ACCESS (code=1, address=0x164d056e7)
    frame #0: 0x00007fff91503e08 libsystem_c.dylib`memcpy$VARIANT$sse42 + 331
    frame #1: 0x00000001002b1b8f liblux.dylib`unsigned int* std::__copy<true, std::random_access_iterator_tag>::copy<unsigned int>(unsigned int const*, unsigned int const*, unsigned int*) + 63
    frame #2: 0x00000001002b1b49 liblux.dylib`unsigned int* std::__copy_aux<unsigned int*, unsigned int*>(unsigned int*, unsigned int*, unsigned int*) + 41
    frame #3: 0x00000001002b1b15 liblux.dylib`unsigned int* std::__copy_normal<false, false>::__copy_n<unsigned int*, unsigned int*>(unsigned int*, unsigned int*, unsigned int*) + 37
    frame #4: 0x00000001002b1add liblux.dylib`unsigned int* std::copy<unsigned int*, unsigned int*>(unsigned int*, unsigned int*, unsigned int*) + 45
    frame #5: 0x00000001002b1aa5 liblux.dylib`unsigned int* std::__uninitialized_copy_aux<unsigned int*, unsigned int*>(unsigned int*, unsigned int*, unsigned int*, std::__true_type) + 37
    frame #6: 0x00000001002b1a75 liblux.dylib`unsigned int* std::uninitialized_copy<unsigned int*, unsigned int*>(unsigned int*, unsigned int*, unsigned int*) + 37
    frame #7: 0x00000001002b14d5 liblux.dylib`unsigned int* std::__uninitialized_copy_a<unsigned int*, unsigned int*, unsigned int>(unsigned int*, unsigned int*, unsigned int*, std::allocator<unsigned int>) + 37
    frame #8: 0x000000010047d416 liblux.dylib`std::vector<unsigned int, std::allocator<unsigned int> >::_M_insert_aux(__gnu_cxx::__normal_iterator<unsigned int*, std::vector<unsigned int, std::allocator<unsigned int> > >, unsigned int const&) + 502
    frame #9: 0x000000010047c944 liblux.dylib`std::vector<unsigned int, std::allocator<unsigned int> >::push_back(unsigned int const&) + 116
    frame #10: 0x000000010054f0ec liblux.dylib`lux::BidirIntegrator::RequestSamples(lux::Sample*, lux::Scene const&) + 748
    frame #11: 0x00000001005df157 liblux.dylib`lux::SamplerRenderer::RenderThread::RenderImpl(lux::SamplerRenderer::RenderThread*) + 151
    frame #12: 0x00000001005e0c65 liblux.dylib`void boost::_bi::list1<boost::_bi::value<lux::SamplerRenderer::RenderThread*> >::operator()<void (*)(lux::SamplerRenderer::RenderThread*), boost::_bi::list0>(boost::_bi::type<void>, void (*&)(lux::SamplerRenderer::RenderThread*), boost::_bi::list0&, int) + 85
    frame #13: 0x00000001005e0bff liblux.dylib`boost::_bi::bind_t<void, void (*)(lux::SamplerRenderer::RenderThread*), boost::_bi::list1<boost::_bi::value<lux::SamplerRenderer::RenderThread*> > >::operator()() + 63
    frame #14: 0x00000001005e0bac liblux.dylib`boost::detail::thread_data<boost::_bi::bind_t<void, void (*)(lux::SamplerRenderer::RenderThread*), boost::_bi::list1<boost::_bi::value<lux::SamplerRenderer::RenderThread*> > > >::run() + 28
    frame #15: 0x000000010088ea90 liblux.dylib`thread_proxy + 160
    frame #16: 0x00007fff9152a8bf libsystem_c.dylib`_pthread_start + 335
    frame #17: 0x00007fff9152db75 libsystem_c.dylib`thread_start + 13
(lldb)


console too: luxconsole(7968,0x103987000) malloc: *** error for object 0x100b20c80: pointer being freed was not allocated

Code: Select all
luxconsole(8057,0x104ad1000) malloc: *** error for object 0x100b20690: double free
*** set a breakpoint in malloc_error_break to debug
[Lux 2012-May-18 13:23:31 INFO : 0] Thread 2 uses seed: 2512194109
[Lux
Program received signal SIGABRT, Aborted.
[Switching to process 8057 thread 0x3303]
0x00007fff95c47ce2 in __pthread_kill ()
(gdb) bt
#0  0x00007fff95c47ce2 in __pthread_kill ()
#1  0x00007fff9152c7d2 in pthread_kill ()
#2  0x00007fff9151da7a in abort ()
#3  0x00007fff9153f4ac in szone_error ()
#4  0x00007fff91540e2a in free_tiny_botch ()
#5  0x00007fff9157c789 in free ()
#6  0x00000001001dd577 in std::vector<unsigned int, std::allocator<unsigned int> >::_M_insert_aux ()
#7  0x000000010025a788 in lux::BidirIntegrator::RequestSamples ()
#8  0x00000001002c4e43 in lux::SamplerRenderer::RenderThread::RenderImpl ()
#9  0x00000001004f8120 in thread_proxy ()
#10 0x00007fff9152a8bf in _pthread_start ()
#11 0x00007fff9152db75 in thread_start ()
(gdb)


Edit2: also pylux crashes ocassinally, prefered when starting blender with preview pane "on top" , same crashlog.

I verified this does not happen with rc1.
Culprit is still 4a773ea2940b, the hybrid lightstrategy was seperate it seems.
Hard to track, perhaps pointer is allocated but block gets bad and cannot found back ( allignment ? ). Or possibly we overshoot the indizes in the loops ?
Jens
Last edited by jensverwiebe on Fri May 18, 2012 4:33 pm, edited 1 time in total.
User avatar
jensverwiebe
Developer
 
Posts: 2124
Joined: Wed Apr 02, 2008 4:34 pm

Re: Light sampling

Postby jeanphi » Fri May 18, 2012 4:32 pm

Hi,

I'm positive I can't reproduce it on Linux! It looks like a stdlib bug of some sort.

Jeanphi
jeanphi
Developer
 
Posts: 6577
Joined: Mon Jan 14, 2008 7:21 am

Re: Light sampling

Postby jensverwiebe » Fri May 18, 2012 4:37 pm

jeanphi wrote:Hi,

I'm positive I can't reproduce it on Linux! It looks like a stdlib bug of some sort.

Jeanphi


Edit: testing some hours now i found that the crashes go away when i only use 1 thread. With my standart 12 threads i can get a crash for sure within 10 runs.
Again: it seems to be an initializing problem only happening at renderstart, once a scene renders nothing will crash !!!!!
So looks more as a timing problem, like as we use a var in BidirIntegrator::RequestSamples that is sometimes not ready to readout.
I also verified problem exists in OSX 10.6/7 32/64bit. All the same.
IMHO it may be a race condition ( http://solarianprogrammer.com/2012/02/2 ... al-part-2/ )

Jens
User avatar
jensverwiebe
Developer
 
Posts: 2124
Joined: Wed Apr 02, 2008 4:34 pm

Re: Light sampling

Postby J the Ninja » Sat May 19, 2012 7:47 pm

On some happier news, I did a test to see how well setting importance to 0 helps with dim, highly tessellated lights. The sphere has about 64k tris, all emitting with low gain and importance=0. There's an area light (plane) overhead providing most of the light:

Sphere importance=1
sampled copy.jpg


Sphere importance=0
unsampled copy.jpg




This should help a TON for things like bioluminescence, lightsabers, tron lines, and such.
-Jason

Material DB Admin
User avatar
J the Ninja
Developer
 
Posts: 2210
Joined: Wed May 19, 2010 9:54 pm
Location: Portland, USA

Re: Light sampling

Postby SATtva » Sun May 20, 2012 1:07 am

This is really impressive!
Linux builds packager
聞くのは一時の恥、聞かぬのは一生の恥
User avatar
SATtva
Developer
 
Posts: 5496
Joined: Tue Apr 07, 2009 12:19 pm
Location: from Siberia with love

PreviousNext

Return to Architecture & Design

Who is online

Users browsing this forum: No registered users and 1 guest