Discussion:
C++ exceptions on 32-bit Windows
Matt Campbell
2012-11-12 16:51:16 UTC
Permalink
Hello:

I read that LuaJIT is not compatible with C++ exceptions on 32-bit
Windows. Is this an inherent limitation in the way LuaJIT works, or is
it just something that hasn't been addressed yet?

Thanks,
Matt
Mike Pall
2012-11-12 17:56:31 UTC
Permalink
Post by Matt Campbell
I read that LuaJIT is not compatible with C++ exceptions on 32-bit
Windows. Is this an inherent limitation in the way LuaJIT works, or
is it just something that hasn't been addressed yet?
I can't do anything about it. Exception handling for Windows/x86
uses SEH, which is patented.

--Mike
Finn Wilcox
2012-11-12 19:05:29 UTC
Permalink
Post by Mike Pall
I can't do anything about it. Exception handling for Windows/x86
uses SEH, which is patented.
Wasn't SEH in the first Windows NT release (1993?) It would probably
have been invented & filed at least a year before that.
So the patent must be due to expire soon.
Chris
2012-11-12 19:26:35 UTC
Permalink
Post by Finn Wilcox
Wasn't SEH in the first Windows NT release (1993?) It would probably
have been invented & filed at least a year before that.
So the patent must be due to expire soon.
June 15, 1994.

http://www.google.com/patents/US5628016
--
Chris
http://luadev.com
Coda Highland
2012-11-12 19:46:47 UTC
Permalink
Post by Chris
Post by Finn Wilcox
Wasn't SEH in the first Windows NT release (1993?) It would probably
have been invented & filed at least a year before that.
So the patent must be due to expire soon.
June 15, 1994.
http://www.google.com/patents/US5628016
--
Chris
http://luadev.com
So... soon, but not soon enough. Alas.

That said, Borland PR did make a claim that they weren't going to
prosecute the SEH patent aggressively; I imagine that an
implementation designed to interoperate with an existing platform (as
opposed to trying to copy SEH onto a different platform) would be
okay. Borland PR says people should contact them before assuming the
answer is "no".

That said, it may get sticky with open-source code, but it can't hurt to ask.

/s/ Adam
Jeff Slutter
2012-11-13 05:17:50 UTC
Permalink
Post by Chris
Post by Finn Wilcox
Wasn't SEH in the first Windows NT release (1993?) It would probably
have been invented & filed at least a year before that.
So the patent must be due to expire soon.
June 15, 1994.
http://www.google.com/patents/US5628016
So, according to Wikipedia
(http://en.wikipedia.org/wiki/Term_of_patent_in_the_United_States) it is
expired in the United States because it was filed in 1994, so it has a
17 year term -- which is June 15, 2011. Though I don't know how it works
outside of the US.
Jeff Slutter
2012-11-13 05:19:53 UTC
Permalink
Ignore my previous message, I think I misread Issue Date vs. Filing
Date, so I guess it is 2014.
Daurnimator
2012-11-13 05:29:13 UTC
Permalink
Post by Jeff Slutter
Ignore my previous message, I think I misread Issue Date vs. Filing
Date, so I guess it is 2014.
15 June 2014 to be exact :)
Daurnimator
2014-09-03 17:43:07 UTC
Permalink
Post by Daurnimator
15 June 2014 to be exact :)
Patent 5,628,016 should be expired by now,
Can we get SEH now? :D
Mike Pall
2014-09-03 18:38:28 UTC
Permalink
Post by Daurnimator
Can we get SEH now? :D
I don't think so. The problem is the assembler code can't rely on
a C++ compiler to do this. Which means one needs to reimplement
SEH handling, but in a way that's compatible with various versions
of Windows and various versions of MSVC.

Ok, so you'll need to dig deep inside the MSVCRT DLLs to find all
of these details and test it on lots of OS/compiler combinations.
Only to find out that AFAIK all newer versions of Windows block
any attempt at subverting SEH handling, because this has been
extensively abused by malware. I'm not sure you can even implement
this outside of a DLL signed by Microsoft nowadays. And even if
you find a way, the resulting executable might be flagged as
malware by heuristic analysis tools.

But if you still want to have a go ... good luck!

[Note we're only talking about Win32 SEH. Win64 exception handling
is data-driven, compiler-independent and documented. It has little
in common with the original meaning of 'SEH' from a technical
point of view -- it has simply inherited the name.]

--Mike

Continue reading on narkive:
Loading...