Recursion check doesn't work in the version I compiled myself.

classic Classic list List threaded Threaded
13 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Recursion check doesn't work in the version I compiled myself.

nophead
I built OpenSCAD from source with MSYS2 and noticed it crashes with infinite recursion but the last snapshot I download gives a recursion error. This is on Win7 64 but launched from the MSYS2 command line.

I can't launch it with Explorer because it complains that libgcc_s_seh-1.dll is missing.

Another odd thing is my build says it is OpenSCAD version 2017.05.02, which is in the future but I built it on 10/02/2017.

Can anybody shed any light of these oddities?





_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Recursion check doesn't work in the version I compiled myself.

thehans
The format is YYYY.MM.DD so in that case it would be the past.

That's still 5 days before you claim to have built it, not sure what
that's about, maybe its something based on the latest commit date
you've pulled from git?

On Mon, Feb 13, 2017 at 6:32 PM, nop head <[hidden email]> wrote:

> I built OpenSCAD from source with MSYS2 and noticed it crashes with infinite
> recursion but the last snapshot I download gives a recursion error. This is
> on Win7 64 but launched from the MSYS2 command line.
>
> I can't launch it with Explorer because it complains that libgcc_s_seh-1.dll
> is missing.
>
> Another odd thing is my build says it is OpenSCAD version 2017.05.02, which
> is in the future but I built it on 10/02/2017.
>
> Can anybody shed any light of these oddities?
>
>
>
>
>
> _______________________________________________
> OpenSCAD mailing list
> [hidden email]
> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Recursion check doesn't work in the version I compiled myself.

thehans
Agh, I mixed myself up.  But YYYY.MM.DD is how its displayed on my
computer.  Your date formatting seems to be different, it may be a
locale based setting?

On Mon, Feb 13, 2017 at 7:21 PM, Hans L <[hidden email]> wrote:

> The format is YYYY.MM.DD so in that case it would be the past.
>
> That's still 5 days before you claim to have built it, not sure what
> that's about, maybe its something based on the latest commit date
> you've pulled from git?
>
> On Mon, Feb 13, 2017 at 6:32 PM, nop head <[hidden email]> wrote:
>> I built OpenSCAD from source with MSYS2 and noticed it crashes with infinite
>> recursion but the last snapshot I download gives a recursion error. This is
>> on Win7 64 but launched from the MSYS2 command line.
>>
>> I can't launch it with Explorer because it complains that libgcc_s_seh-1.dll
>> is missing.
>>
>> Another odd thing is my build says it is OpenSCAD version 2017.05.02, which
>> is in the future but I built it on 10/02/2017.
>>
>> Can anybody shed any light of these oddities?
>>
>>
>>
>>
>>
>> _______________________________________________
>> OpenSCAD mailing list
>> [hidden email]
>> http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
>>

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Recursion check doesn't work in the version I compiled myself.

kintel
Administrator
In reply to this post by nophead

> On Feb 13, 2017, at 19:32, nop head <[hidden email]> wrote:
>
> I built OpenSCAD from source with MSYS2 and noticed it crashes with infinite recursion but the last snapshot I download gives a recursion error. This is on Win7 64 but launched from the MSYS2 command line.
>
The last snapshot was build using the MXE cross compiler environment, so that’s one reason why the binaries differ.
Could it be that the MXE binary chooses the POSIX code path, while the MSYS2 one chooses Win32, thus hitting a different stack size check?
See here, where we just assume the default stack size on Win32:
https://github.com/openscad/openscad/blob/master/src/PlatformUtils-win.cc#L98


> Another odd thing is my build says it is OpenSCAD version 2017.05.02, which is in the future but I built it on 10/02/2017.
>
We have some ugly code for detecting today’s date on Windows - it’s likely broken:
https://github.com/openscad/openscad/blob/master/version.pri

Ideas/patches for that would be welcome. We don’t have many Windows natives on our team :)

As you can see, the MSYS2 native Windows build could really need some love.

 -Marius


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
tp3
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Recursion check doesn't work in the version I compiled myself.

tp3
In reply to this post by nophead
On 02/14/2017 01:32 AM, nop head wrote:
> I built OpenSCAD from source with MSYS2 and noticed it crashes
> with infinite recursion but the last snapshot I download gives
> a recursion error. This is on Win7 64 but launched from the MSYS2
> command line.
>
My first guess would be that the stack size is not set to 8MB
which, I think, is currently hard coded on Windows as the MinGW
build fixes that at link time:

in mingw-cross-env.pri

  WINSTACKSIZE = 8388608 # 8MB # github issue 116
  QMAKE_CXXFLAGS += -Wl,--stack,$$WINSTACKSIZE
  LIBS += -Wl,--stack,$$WINSTACKSIZE

That might be missing in the MSYS2 build (and maybe there is
a way to actually retrieve the stack size).

ciao,
  Torsten.


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
-- Torsten
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Recursion check doesn't work in the version I compiled myself.

MichaelAtOz
Administrator
I'll have to search back, but I'm pretty sure there is no fixed stack in Windows (maybe just 64? maybe not) apps, virtual memory just grows.
Admin - PM me if you need anything,
or if I've done something stupid...

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work.
Obviously inclusion of works of previous authors is not included in the above.


The TPP is no simple “trade agreement.” Fight it! http://www.ourfairdeal.org/ time is running out!
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Recursion check doesn't work in the version I compiled myself.

nophead
Isn't that the problem the stack limit is trying to solve. If it grows forever eventually it will bring the machine to it knees and then crash when it finally runs out of swap space because OpenSCAD doesn't seem to notice when there is no more memory virtual memory left.

On 14 February 2017 at 09:54, MichaelAtOz <[hidden email]> wrote:
I'll have to search back, but I'm pretty sure there is no fixed stack in
Windows (maybe just 64? maybe not) apps, virtual memory just grows.



-----
Admin - PM me if you need anything, or if I've done something stupid...

Unless specifically shown otherwise above, my contribution is in the Public Domain; to the extent possible under law, I have waived all copyright and related or neighbouring rights to this work. Obviously inclusion of works of previous authors is not included in the above.

The TPP is no simple “trade agreement.”   Fight it! http://www.ourfairdeal.org/   time is running out!
--
View this message in context: http://forum.openscad.org/Recursion-check-doesn-t-work-in-the-version-I-compiled-myself-tp20421p20429.html
Sent from the OpenSCAD mailing list archive at Nabble.com.

_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Recursion check doesn't work in the version I compiled myself.

cacb
In reply to this post by MichaelAtOz
On 2017-02-14 10:54, MichaelAtOz wrote:
> I'll have to search back, but I'm pretty sure there is no fixed stack
> in
> Windows (maybe just 64? maybe not) apps, virtual memory just grows.

I am pretty sure there is a fixed stack size on windows (and probably
other architectures). That is why you can get stack overflow long before
you run out of physical or virtual memory. Stack memory is fixed size,
but heap memory is only limited to the virtual address space. I think
you refer to heap memory.

Try stuff like this in C++ and you will get stack problems:

     char buffer[1024*1024];

I guess the stack size depends on the compiler. The MSVC compiler has a
default stack size of 1MB.

Carsten Arnholm



_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Recursion check doesn't work in the version I compiled myself.

nophead
In reply to this post by kintel
I ran the qmake again and touched openscad.cc to force a recompile and now the version number is today's date in the correct format, so I have no idea what went wrong.

It was 5th of Feb when I last ran qmake but my date format has always been DD/MM/YYYY so I don't see why it would change between then and now.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Recursion check doesn't work in the version I compiled myself.

kintel
Administrator
> On Feb 14, 2017, at 10:09, nophead <[hidden email]> wrote:
>
> It was 5th of Feb when I last ran qmake but my date format has always been
> DD/MM/YYYY so I don't see why it would change between then and now.
>
Perhaps there is some heuristic somewhere which tries to guess which is MM vs. DD based on the magnitude of the number?

 -Marius


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Recursion check doesn't work in the version I compiled myself.

nophead
There is a heuristic that gets the day like this:
QDATE = $$_DATE_
QDATE_SPLIT
= $$split(QDATE)
QDAY
= $$member(QDATE_SPLIT,2)

And then finds that in the date fields it got from the system date. Why doesn't it simply use $$__DATE as the date?

On 14 February 2017 at 15:51, Marius Kintel <[hidden email]> wrote:
> On Feb 14, 2017, at 10:09, nophead <[hidden email]> wrote:
>
> It was 5th of Feb when I last ran qmake but my date format has always been
> DD/MM/YYYY so I don't see why it would change between then and now.
>
Perhaps there is some heuristic somewhere which tries to guess which is MM vs. DD based on the magnitude of the number?

 -Marius


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Recursion check doesn't work in the version I compiled myself.

kintel
Administrator
> On Feb 14, 2017, at 11:10, nop head <[hidden email]> wrote:
>
> There is a heuristic that gets the day like this:
> QDATE = $$_DATE_
> QDATE_SPLIT = $$split(QDATE)
> QDAY = $$member(QDATE_SPLIT,2)
>
> And then finds that in the date fields it got from the system date. Why doesn't it simply use $$__DATE as the date?
>
I have no idea where $$__DATE would come from..

As you’re one of the few people having built OpenSCAD on Windows natively, you might very well be the first person to encounter this.
If you have any ideas for how to clean this up, please do.

 -Marius
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Recursion check doesn't work in the version I compiled myself.

nophead
Sorry I meant to type $$_DATE_. Googling around it seems to be an undocumented variable in QMake. https://wiki.qt.io/Undocumented_QMake

It currently looks like this: Tue Feb 14 16:59:08 2017

So it seems that the day and year could be extracted from that but the month is not in numeric form. So it gets the Windows date, which is all numeric, but the order depends on the locale. So it finds the year by looking for the four digit field and, if first, it assumes  YYYY/MM/DD, If last it decides between DD/MM/YYYY and MM/DD/YYYY by looking for a match on the day field from $$_DATE_. That would be ambiguous when the day equals the month but it doesn't matter which order if they are both the same.

I am guessing it goes wrong when the day is less than 10 because the _DATE_ format probably doesn't include the leading 0 but Windows date /t probably does. I will have to wait until next month to be sure because _DATE_ is undocumented!


On 14 February 2017 at 16:22, Marius Kintel <[hidden email]> wrote:
> On Feb 14, 2017, at 11:10, nop head <[hidden email]> wrote:
>
> There is a heuristic that gets the day like this:
> QDATE = $$_DATE_
> QDATE_SPLIT = $$split(QDATE)
> QDAY = $$member(QDATE_SPLIT,2)
>
> And then finds that in the date fields it got from the system date. Why doesn't it simply use $$__DATE as the date?
>
I have no idea where $$__DATE would come from..

As you’re one of the few people having built OpenSCAD on Windows natively, you might very well be the first person to encounter this.
If you have any ideas for how to clean this up, please do.

 -Marius
_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org


_______________________________________________
OpenSCAD mailing list
[hidden email]
http://lists.openscad.org/mailman/listinfo/discuss_lists.openscad.org
Loading...