POV-Ray : Newsgroups : povray.beta-test : splinefollow Server Time
28 Dec 2024 17:42:28 EST (-0500)
  splinefollow (Message 1 to 10 of 20)  
Goto Latest 10 Messages Next 10 Messages >>>
From: ThH
Subject: splinefollow
Date: 27 Feb 2016 04:41:24
Message: <56d16f44$1@news.povray.org>
could some kind soul please check this...

Trying scenes/animation/splinefollow.pov I got this:

thh@quadro:~/POV_Master/share/povray-3.7/scenes/animations/splinefollow$ 
povray splinefollow.pov +p +w320 +h240
Persistence of Vision(tm) Ray Tracer Version 
3.7.1-alpha.8492620.unofficial (g++
  4.9.2 @ x86_64-unknown-linux-gnu)
This is an unofficial version compiled by:
  ThH <no.spam@address>
  The POV-Ray Team is not responsible for supporting this version.

8< snip >8

==== [Parsing...] ==========================================================
Speicherzugriffsfehler

-- 
Thorsten aka ThH


Post a reply to this message

From: clipka
Subject: Re: splinefollow
Date: 27 Feb 2016 04:49:18
Message: <56d1711e$1@news.povray.org>
Am 27.02.2016 um 10:42 schrieb ThH:
> could some kind soul please check this...
> 
> Trying scenes/animation/splinefollow.pov I got this:
> 
> thh@quadro:~/POV_Master/share/povray-3.7/scenes/animations/splinefollow$
> povray splinefollow.pov +p +w320 +h240
> Persistence of Vision(tm) Ray Tracer Version
> 3.7.1-alpha.8492620.unofficial (g++
>  4.9.2 @ x86_64-unknown-linux-gnu)
> This is an unofficial version compiled by:
>  ThH <no.spam@address>
>  The POV-Ray Team is not responsible for supporting this version.
> 
> 8< snip >8
> 
> ==== [Parsing...]
> ==========================================================
> Speicherzugriffsfehler

Can't confirm for the Windows version.


Post a reply to this message

From: Le Forgeron
Subject: Re: splinefollow
Date: 27 Feb 2016 08:04:33
Message: <56d19ee1$1@news.povray.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Le 27/02/2016 10:49, clipka a écrit :
> Am 27.02.2016 um 10:42 schrieb ThH:
>> could some kind soul please check this...
>> 
>> Trying scenes/animation/splinefollow.pov I got this:
>> 
>> thh@quadro:~/POV_Master/share/povray-3.7/scenes/animations/splinefoll
ow$
>>
>> 
povray splinefollow.pov +p +w320 +h240
>> Persistence of Vision(tm) Ray Tracer Version 
>> 3.7.1-alpha.8492620.unofficial (g++ 4.9.2 @
>> x86_64-unknown-linux-gnu) This is an unofficial version compiled
>> by: ThH <no.spam@address> The POV-Ray Team is not responsible for
>> supporting this version.
>> 
>> 8< snip >8
>> 
>> ==== [Parsing...] 
>> ========================================================== 
>> Speicherzugriffsfehler
> 
> Can't confirm for the Windows version.
> 

I can confirm for the master branch ( 3.7.1-alpha.8497793.unofficial )

Segmentation fault (core dumped)

No such problem on stable branch, and not yet either on my two branches.
So, it's new, it's fresh... (less than a year old)

traced to se.resize()

void mkfree(GenericSpline * sp, SplineEntryList::size_type i)
{
    SplineEntryList::size_type j;
    SplineEntryList& se = sp->SplineEntries;

    se.resize(se.size()+1);
    for (j=sp->SplineEntries.size()-1; j>i; j--)
        se[j] = se[j-1];
}

But it might be due to a previous memory corruption because the
segfault is due to malloc.c, a code that is safe as long as memory is
not corrupted.

I would bet for, somewhere else, a write out of allocated area.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iJwEAQEIAAYFAlbRnuAACgkQhKAm8mTpkW2wcwQA0kis+HZ0zkrjkpgdxvgeC2K6
R6KKULjeHiamzUhiZy14BLvONh13YqAbk0Tjh3V7D9CuNuuh6eHsLv3ImeAA3QhZ
vksF78lF7oGaJGRFI1r3Q8aO63jf58gtW5uw2eg4c6mdOFcWXfFzK+xuvF5qVdms
1FDrUDfkeAUtJUjpf18=
=Nu25
-----END PGP SIGNATURE-----


Post a reply to this message

From: ThH
Subject: Re: splinefollow
Date: 27 Feb 2016 08:33:50
Message: <56d1a5be$1@news.povray.org>
Am 27.02.2016 um 14:04 schrieb Le_Forgeron:

> I can confirm for the master branch ( 3.7.1-alpha.8497793.unofficial )
>
> Segmentation fault (core dumped)

Thank you for checking and confirming Le_Forgeron :)

> No such problem on stable branch, and not yet either on my two branches.
> So, it's new, it's fresh... (less than a year old)
>
> traced to se.resize()
>
> void mkfree(GenericSpline * sp, SplineEntryList::size_type i)
> {
>      SplineEntryList::size_type j;
>      SplineEntryList& se = sp->SplineEntries;
>
>      se.resize(se.size()+1);
>      for (j=sp->SplineEntries.size()-1; j>i; j--)
>          se[j] = se[j-1];
> }
>
> But it might be due to a previous memory corruption because the
> segfault is due to malloc.c, a code that is safe as long as memory is
> not corrupted.
>
> I would bet for, somewhere else, a write out of allocated area.

This part is for real coders, right? At least I can read it but am not 
understanding it ;)


Post a reply to this message

From: Le Forgeron
Subject: Re: splinefollow
Date: 27 Feb 2016 08:46:01
Message: <56d1a899@news.povray.org>
Le 27/02/2016 14:34, ThH a écrit :
> Am 27.02.2016 um 14:04 schrieb Le_Forgeron:
> 
>> I can confirm for the master branch ( 3.7.1-alpha.8497793.unofficial )

>>
>> Segmentation fault (core dumped)
> 
> Thank you for checking and confirming Le_Forgeron :)
> 
>> No such problem on stable branch, and not yet either on my two branche
s.
>> So, it's new, it's fresh... (less than a year old)
>>
>> traced to se.resize()
>>
>> void mkfree(GenericSpline * sp, SplineEntryList::size_type i)
>> {
>>      SplineEntryList::size_type j;
>>      SplineEntryList& se = sp->SplineEntries;
>>
>>      se.resize(se.size()+1);
>>      for (j=sp->SplineEntries.size()-1; j>i; j--)
>>          se[j] = se[j-1];
>> }
>>
>> But it might be due to a previous memory corruption because the
>> segfault is due to malloc.c, a code that is safe as long as memory is
>> not corrupted.
>>
>> I would bet for, somewhere else, a write out of allocated area.
> 
> This part is for real coders, right? At least I can read it but am not
> understanding it ;)

Attached is a log from valgrind (a memory checker) about trying to run
splinefollow.

The spline parsing code should be checked, because it seems to have
miscounted its number of entries.


Post a reply to this message


Attachments:
Download 'memcheck.txt' (16 KB)

From: ThH
Subject: Re: splinefollow
Date: 27 Feb 2016 08:54:01
Message: <56d1aa79$1@news.povray.org>
Am 27.02.2016 um 14:45 schrieb Le_Forgeron:

> Attached is a log from valgrind (a memory checker) about trying to run
> splinefollow.
>
> The spline parsing code should be checked, because it seems to have
> miscounted its number of entries.

I see 8)

Thank you again. Always learning something new :))


Post a reply to this message

From: clipka
Subject: Re: splinefollow
Date: 27 Feb 2016 08:55:18
Message: <56d1aac6@news.povray.org>
Am 27.02.2016 um 14:04 schrieb Le_Forgeron:

> traced to se.resize()
> 
> void mkfree(GenericSpline * sp, SplineEntryList::size_type i)
> {
>     SplineEntryList::size_type j;
>     SplineEntryList& se = sp->SplineEntries;
> 
>     se.resize(se.size()+1);
>     for (j=sp->SplineEntries.size()-1; j>i; j--)
>         se[j] = se[j-1];
> }
> 
> But it might be due to a previous memory corruption because the
> segfault is due to malloc.c, a code that is safe as long as memory is
> not corrupted.

`se.resize()` is `std::vector::resize()`, so yes, I guess we can safely
presume that the error is somewhere else ;)


Post a reply to this message

From: Le Forgeron
Subject: Re: splinefollow
Date: 27 Feb 2016 09:11:07
Message: <56d1ae7b@news.povray.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Le 27/02/2016 14:55, clipka a écrit :
> Am 27.02.2016 um 14:04 schrieb Le_Forgeron:
> 
>> traced to se.resize()
>> 
>> void mkfree(GenericSpline * sp, SplineEntryList::size_type i) { 
>> SplineEntryList::size_type j; SplineEntryList& se =
>> sp->SplineEntries;
>> 
>> se.resize(se.size()+1); for (j=sp->SplineEntries.size()-1; j>i;
>> j--) se[j] = se[j-1]; }
>> 
>> But it might be due to a previous memory corruption because the 
>> segfault is due to malloc.c, a code that is safe as long as
>> memory is not corrupted.
> 
> `se.resize()` is `std::vector::resize()`, so yes, I guess we can
> safely presume that the error is somewhere else ;)
> 
Yes... And in fact, I already encountered that problem on my master
branch (which try to follow the official master... when I have time to
follow)

The problem is in Insert_Spline_Entry, the condition try to handle too
much and fails.

I rewrote it

https://bitbucket.org/LeForgeron/povray/src/8813d261f3c529cb734c0f5697b86e9dbf916966/source/backend/math/splines.cpp?at=default&fileviewer=file-view-default

>
https://bitbucket.org/LeForgeron/povray/src/8813d261f3c529cb734c0f5697b86e9dbf916966/source/backend/math/splines.cpp?at=default&fileviewer=file-view-default
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iJwEAQEIAAYFAlbRrnoACgkQhKAm8mTpkW2JwAP/cMQfYj7+N/rsONb1pADU3g3J
jW7hVB0agTuWk5+A2JXTPRLQY8gB4Ib34uGyou5Nu8kU55+H1ezcobmPYsmPKDUx
SngVsUesaDpeiSLYNXuemkSEr/Yo8LfZ73GhZEzqvpL/fPxunXN+KHnnQZz69NlE
cz9jRSt43BUAqSFySEQ=
=WTV+
-----END PGP SIGNATURE-----


Post a reply to this message

From: Le Forgeron
Subject: Re: splinefollow
Date: 27 Feb 2016 09:24:00
Message: <56d1b180@news.povray.org>
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

If it can help, it's already in github

https://github.com/LeForgeron/povray/commit/489e2eaf8e655eacdf102b6d5961
3f0f725584b8

> https://github.com/LeForgeron/povray/commit/489e2eaf8e655eacdf102b6d59
613f0f725584b8

But
> 
I do not know how to create a pull request for a single commit..
Just do it if you can.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iJwEAQEIAAYFAlbRsX4ACgkQhKAm8mTpkW1mqAQAjqYKwURLp8tSWg2/grQ32t2w
T7rs84l84xdCYaryIjRN8yxz9gcCJHf4XQCylSL5jAbwcQUSpL0rEfhwj9XrU7wd
lh2L2M0cPiOY7mFckZgfrMtO9L+ldpylQAXLShg1FPhZpaw6lrXxXVoKxLdw1Itc
Ny5OuHmz+Ou0Pr8/Yyw=
=2SFD
-----END PGP SIGNATURE-----


Post a reply to this message

From: clipka
Subject: Re: splinefollow
Date: 27 Feb 2016 09:35:38
Message: <56d1b43a@news.povray.org>
Am 27.02.2016 um 15:11 schrieb Le_Forgeron:

> The problem is in Insert_Spline_Entry, the condition try to handle too
> much and fails.

Yup, the comparison is bogus: It tests `sp->SplineEntries[i].par == p`
before even verifying that i is within bounds.


Post a reply to this message

Goto Latest 10 Messages Next 10 Messages >>>

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