-
Notifications
You must be signed in to change notification settings - Fork 601
win32: allow build with USE_ITHREADS=undef but USE_IMP_SYS=define #23178
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 2 commits
937d799
8d33f0f
29a96c3
8ecfcfb
3ff321e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -51,6 +51,7 @@ xs_init(pTHX) | |
| void | ||
| win32_checkTLS(PerlInterpreter *host_perl) | ||
| { | ||
| #ifdef USE_ITHREADS | ||
| /* GCurThdId() is lightweight, but b/c of the ctrl-c/signals sometimes firing | ||
| in other random WinOS threads, that make the TIDs go out of sync. | ||
| This isn't always an error, although high chance of a SEGV in the next | ||
|
|
@@ -67,6 +68,13 @@ win32_checkTLS(PerlInterpreter *host_perl) | |
| } | ||
| host_perl->Isys_intern.cur_tid = tid; | ||
| } | ||
| #else | ||
| dTHX; | ||
| if (host_perl != my_perl) { | ||
| int *nowhere = NULL; | ||
Leont marked this conversation as resolved.
Outdated
Show resolved
Hide resolved
|
||
| abort(); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I have zero trust, in ascii token
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
MS SDL security policy says
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Poking around inside machine code of msvcrt.dll shows, libc Although MS's SEH exception events/dispatch API is language neutral and available in Win32/64 assembly and ISO C89 lang code if someone wants to use the SEH API, 99% of real life catch frames will be random C++ lang code. But the problem is, from my opinion, P5P/me/no developer on earth, knows at "HW fault throw" time, or "SEGV event callback event listener invoke loop time", how many, if any, and where those exception frames came from, or who/what in virtual address space, put their callbacks on the non-public Win Kernel event listener array of things that want to listen to the Win Kernel's SEGV event queue in user mode. So something like MS CRT's "abort()", which uses "warning class (0x4____)" error 0x40000015 STATUS_FATAL_APP_EXIT, something in the SEH stack might have the bright idea to trap/resume, because its 0x4___ "warning class error" which supposedly means "informational" and "normal control flow sometimes" And or the 0xC___ class errors, which are "call 911/112" emergencies, since these are unrecoverable physical hardware errors, SEGVs, SIGILL, SIGBUS, integer div by zero, HW FP math exceptions, or a PCIe device disappeared from the PCIe bus randomly, etc. Nobody, even as a 1st timer coder, would try to trap resume those 0xC___ errors/or the NTSTATUS .h C constants behind those 0xC___ codes at runtime, and anything who knows what the 0xC___ class codes even are, knows what they are doing if they test for them in a SEH catch filter block. Don't quote me, and I don't feel like googling it, but some, maybe upto half the 0xC___ codes, are documented by MS as non-resumable even if the catch block specifically ask the OS to resume execution with its (end user supplied) CPU register context state snapshot. But remember, nothing will stop a catch block, from synchronously, in normal C89, from executing a whats wrong with writing a Win32 C debugger in Pure Perl and publishing it on CPAN? Nothing, it could be a 100% legit useful CPAN tool lol. |
||
| } | ||
| #endif | ||
| } | ||
|
|
||
| EXTERN_C void | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.