Age | Commit message (Collapse) | Author | Files | Lines |
|
Building on SunOS will fail with the message of "call to 'sqrt' is
ambiguous" because it can't determine the type of the constant value
passed to it. This change adds a cast to a double because every usage
uses this data type
|
|
Fixed issue where files in /opt/local/include are not found and LTTng is required on SmartOS
|
|
Modified to not require LTTng on SunOS
|
|
required for Event Logging
will be generated as part of build
|
|
This change replaces all calls of OS specific functions in the GC by a call to
a platform agnostic interface. Critical sections were abstracted too.
The logging file access was changed to use CRT functions instead of Windows specific APIs.
A "size" member was added to the card_table_info so that we can pass the right
size to the VirtualRelease method when destroying the card table.
I have also fixed a bug in the gc_heap::make_card_table error path where when VirtualCommit
failed, it called VirtualRelease with size that was not the reserved size, but
the committed size.
Other related changes
- All interlocked operations moved to Interlocked class as static methods
- Removed unused function prototypes
- Shuffled stuff in the root CMakeLists.txt to enable building the GC sample using the
settings inherited from the root CMakeLists.txt and to clean up some things that have
rotted over time, like the FEATURE_xxx macros not being in one alphabetically ordered
block
- Fixed the VOLATILE_MEMORY_BARRIER macro in the gcenv.base.h
- Replaced uint32_t thread id by EEThreadId
- Removed thread handles storage (g_gc_thread) from the GC. The thread handle is closed right after the thread is launched. That allowed me to get rid of the GCThreadHandle
- Renamed the methods of the EEThreadId to be easier to understand
- Moved the gcenv.windows.cpp and gcenv.unix.cpp to the sample folder
|
|
Enable checked builds of CoreCLR.
|
|
In checked builds coreclr, mscorlib, and the test are built optimized
but assertion checking is on. This adds additional coverage (the jit is
optimizing and assertion checking is on), speeds up testing compared to debug,
and allows testing JIT stress modes.
This doesn't affect CoreFX.
Several tests are currently failing in checked configuration due to newly
discovered bugs (JIT asserts). We didn't see these asserts in debug mode
because by default JIT is in minopt mode; we didn't see these bugs in release
mode because assertion checking is off. I will file the bugs once checked build
changes are in.
|
|
|
|
Debugger transport pipe file cleanup - Part 2
|
|
Clean up the pipe files in /tmp for unhandled managed exception termination.
Added a simple PAL shutdown API to set (one) shutdown callback handler which is used
by the debugger code to cleanup the transport thus removing the pipe files from /tmp.
This callback is executed PAL_Shutdown, ExitProcess and TerminateProcess, the later used
to terminate the process for an unhandled managed exception.
Add the __attribute__((destructor)) to the ShutdownTransport function to cover the case if
the if a third party host, the managed runtime or third party pinvoked code calls exit().
|
|
Successfully builds all binaries except sos.dll & x64 binaries
|
|
Added a PAL_Shutdown function that cleans/shutdowns the PAL without exiting/terminating
the process doing exactly what ExitProcess/TerminateProcess before exiting the process.
Removed the PAL_InitializeCoreCLR export. The new coreclr_* hosting apis should be used.
Moved the "is module manager initialized" check (exe_module.prev != NULL) inside the module
lock to prevent races during shutdown in LOADCallDllMain.
Removed LOADFreeModules so we never try to call the DLL_PROCESS_DETACH handlers. Most of this
cleanup happened because I was trying to getting the DLL_PROCESS_DETACH notifications working,
but there were too many opportunities for deadlock. Emulating Windows behavior isn't that
important and in this case will cause more problems that it fixes.
Removed PAL_RegisterLibrary*/PAL_UnregisterLibrary. They were only used in one place to load modules
that don't exist anymore (rotor_palrt and sscoree).
Renamed LOAD_SEH_CallDllMain to LoadCallDllMainSafe (we don't usually use _ in names) and use this
function in all the places we call the DllMain handler. This combines some code in a common place
and protects all DllMain calls from exceptions.
Source code formatting cleanup and moved internal functions around to be next to the rest of the
internal functions.
Initialize pDllMain to NULL in LOADAllocModule.
Get the DllMain function address into LOADAddModule so that it is initialized in the PAL_RegisterModule path.
Changed PAL_UnregisterModule not to call the DllMain function.
|
|
|
|
Enable ILASM for *nix
|
|
This enables ILASM for x-platforms.
1. Added a bunch of warning disable options mostly due to this prebuilt asmparse.cpp
2. Create a separte entry point "main" to pass WCHAR arguments.
3. PDB (CorSymWriter) part is disabled.
4. Converting/embedding resource file to binary is disabled.
5. jkotas kindly provided a code for IsTextUnicode which is unavailable on CoreCLR.
|
|
Use CLOCK_MONOTONIC_COARSE in GetTickCount64
|
|
Today, GetTickCount64 is implemented to use clock_gettime with CLOCK_MONOTONIC if it's available. This provides for high-resolution, however it trades off that accuracy for some efficiency.
This commit changes it to prefer CLOCK_MONOTONIC_COARSE if it's available (QueryPerformanceCounter still uses CLOCK_MONOTONIC). GetTickCount is typically used for coarse timings, e.g. used in a loop to determine whether more than 10 seconds have passed, and can have lower resolution in exchange for higher efficiency. For Windows, the MSDN docs explicitly state that it's likely to have no better than 10-15 millisecond resolution. Using CLOCK_MONOTONIC_COARSE instead of CLOCK_MONOTIC maps better to this notion, and improves Environment.TickCount throughput on my machine by ~20x. At the same time, on my machine it still provides well better than 10-15ms resolution, closer to ~4ms.
|
|
Fix C++ exception handling when coreclr is loaded before C++ runtime
|
|
This change fixes a problem that happens when libcoreclr.so is loaded before
C++ runtime libraries. In that case, linker resolves the C++ exception handling
functions against the libunwind8 and exception handling doesn't work.
The fix is the same as someone has already made in the past for ARM - to
add gcc_s to the library list of coreclrpal before the libunwind8. Then
the linker does the right thing.
|
|
Fixes the recursive GC crash. Added FEATURE_ENABLE_HARDWARE_EXCEPTIONS to the PAL sxs exception tests
so the h/w exceptions generated by the test dlls are caught. Also added to SOS/strike project.
Also fixed sos "clrstack -i". The sos data target needed to implement ICorDebugDataTarget4::VirtualUnwind too.
|
|
Fixes VS's problems with debugging and running different versions of coreclr.
Set RPATH for OSX is @loader_path and removed now unnecessary load of mscordaccore
in the lldb sos plugin.
Simplify the GetDacModule code to use PAL_GetPALDirectoryW instead of depending on GetModuleInst()
and the module handle passed to DllMain.
Changed PAL_RegisterModule not to also call the DllMain of the module so it wouldn't be called twice.
|
|
|
|
|
|
Implement an allocator for executable (JIT) memory in PAL
|
|
Enable the module load notification when no module or methods are found.
setclrpath/setsostid print the current path/tid if no arguments. "setsostid -clear"
now clears the tid/os id mapping.
Added better exception hook to sos plugin to catch special CLRN exception. Before
multiple lldb "Exception breakpoints" where set each time bpmd added a new bp. Added
a "DoNotDeleteOrDisable" message to the exception breakpoint created.
Fix bpmd on release builds. RtlpRaiseException was being inlined and the ExceptionRecord
parameter was being optimized away causing the GetLastEventInformation api to failed
and the special CLRN exception to be ignored.
Add sos help support. "soshelp" displays help about a command.
|
|
|
|
This change improves performance of CoreCLR with Server GC enabled by
about 30% according to ASP.NET benchmarks on Linux. The table below shows
number of requests per second that an ASP.NET benchmark could handle on my
machine before and after the change.
Pipeline Before After Improvement
16 230K Req/sec 305K Req/sec 33%
256 240K Req/sec 340K Req/sec 42%
The problem was that with Server GC enabled, the GC initialization code was
reserving a large chunck (about 18GB on my machine) of virtual address
space during runtime initialization. Unfortunately, due to implementation
details of MM on Linux, GC memory was located next to the location of
libcoreclr. As a result, the runtime could not allocate memory for JIT'ed
code close to the coreclr library. Because of that the JIT'ed code had to
use jump stubs to call functions from the runtime (which can become very
expensive, for example, for write barriers).
This change fixes this issue by implementing a simple allocator that tries
to reserve (during process startup) a chuck of virtual memory that is
located near the coreclr library (within 2GB range) that can be later used
for JIT'ed code.
|
|
Implemented QueryThreadCycleTime (time.cpp) & GetThreadTimes (thread.…
|
|
|
|
for Unix and OS X, plus tests. Also added helper methods IsCurrentThread and GetThreadTimesInternal to time.cpp. Currently, GetThreadTimes returns all time as user time on Unix, since I don't yet know of a way to get user time and kernel time separately there.
|
|
modules.
Currently disabled for FreeBSD.
|
|
Use uuid_generate_random instead of uuid_generate in CoCreateGuid
|
|
|
|
The PAL implementation of CoCreateGuid is currently using uuid_generate.
This will be based on high-quality randomness if available, otherwise it
falls back to an algorithm that incorporates the local ethernet MAC address
along with the current time and a pseudo-random generator. To avoid potential
privacy issues, this commit switches to using uuid_generate_random, which
instead falls back purely to a pseudo-random generator.
|
|
The PAL implementation of HeapFree assumes that the memory region always
have at least 4 bytes. Depending on the heap implementation, this is not
necessarily true, and can potentially cause memory corruption.
|
|
The OSX exception logic is running on a separate thread from the one that the exception happened. The CatchHardwareExceptionHolder::IsEnabled used to check for h/w exception holders assumed it was running on the thread the exception/holders happened not the exception notification thread. Moved the h/w exception holder count to the CPalThread object instead of a TLS thread variable so the OSX exception code can check it given a CPalThread instance.
The main problem was that the stubmgr when creating a thread (for the start notification) put a breakpoint in ThePreStubPatch which is in the coreclr text section and because the h/w exception holder check was broken, it thought the breakpoint wasn't the debugger's and aborted the coreclr process. The other part of this fix is to put a h/w exception holder around the called to ThePreStubPatch in prestub.cpp.
The stubmgr's delegate invoke subclass used the wrong registers for Linux/OSX to read the "this" and parameter registers. Added the proper ifdefs and registers (ecx -> rdi, rdx -> rsi) for the Unix platforms.
On both Linux and OSX, the h/w exception holder check in the exception routing logic needed to check if the int3/trap is in DBG_DebugBreak so asserts always abort/core dump. Move DBG_DebugBreak to an assembly worker so the start/end address can be used for this check.
|
|
More PAL thread cleanup (last one)
|
|
|
|
|
|
Just what it says on the tin.
|
|
Remove thread parameter from a few more places in PAL
|
|
Deleted SIGINT and SIGQUIT-related signal handling code, which means we no longer need to spin up a worker thread for all coreclr apps.
Make the debugger's SetConsoleCtrlHandler usage Windows-only (from offline conversation it sounded like we might choose to delete it entirely subsequently, but for now I've left it).
Removed all of the code related to SetConsoleCtrlHandler from the PAL.
Deleted all tests related to SetConsoleCtrlHandler from the palsuite.
|
|
|
|
|
|
|
|
|
|
|
|
Fix sos clrstack unwinding for the special HelperMethodFrame.
|
|
Add and implement new ICorDebugDataTarget4 unwind interface using lldb stack unwinder ABIs. The implementation
does a linear search of the native frames for the stack pointer provided. It doesn't happen often so the
performance is fine.
Stub out the DBI's ICorDebugDataTarget4 (in ShimDataTarget::VirtualUnwind) for now. Since PAL_VirtualUnwindOutOfProc
is disabled it makes sense to just return E_NOTIMPL.
Fix bpmd command so it doesn't stop in lldb when it isn't a CLRN exception (continues).
|
|
Clean up PAL File functions
|