{"payload":{"feedbackUrl":"https://github.com/orgs/community/discussions/53140","repo":{"id":224448884,"defaultBranch":"master","name":"runtime","ownerLogin":"janvorli","currentUserCanPush":false,"isFork":true,"isEmpty":false,"createdAt":"2019-11-27T14:27:36.000Z","ownerAvatar":"https://avatars.githubusercontent.com/u/10758568?v=4","public":true,"private":false,"isOrgOwned":false},"refInfo":{"name":"","listCacheKey":"v0:1718294459.0","currentOid":""},"activityList":{"items":[{"before":null,"after":"f7813448423a02f143384381d15aa39a8a79a205","ref":"refs/heads/fix-debugger-issue-with-unhandled-exception-on-secondary-thread","pushedAt":"2024-06-13T16:00:59.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"janvorli","name":"Jan Vorlicek","path":"/janvorli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/10758568?s=80&v=4"},"commit":{"message":"Fix VS issue with unhandled exception on secondary threads\n\nWhen \"just my code\" is disabled, unhandled exceptions on secondary\nthreads cause the VS to stop without any stack trace shown. This is\nsimilar to the recently fixed problem that was happening with user\nunhandled exception treatment.\nThe exception is rethrown as native exception after leaving the last\nmanaged frame and it propagates to the `ManagedThreadBase_DispatchOuter`\nwhere it is caught. The debugger gets notified from there, but all of\nthe managed stack frames are gone at that point, so the debugger cannot\nshow them.\nThe fix is to report exception on a secondary thread as unhandled\nearlier, right in the SfiNext where we report it for the primary\nthreads. The secondary thread is different in having the\nDebuggerU2MCatchHandlerFrame on stack while in the primary thread case,\nthere is no explicit frame.\n\nClose #103385","shortMessageHtmlLink":"Fix VS issue with unhandled exception on secondary threads"}},{"before":"4259620d0761cc72ba5b24b0c843be3bcf09561b","after":"fcf61821a8e4e469e7c5d58f21b9c1cd6b974b31","ref":"refs/heads/remove-eh-stacktrace-global-lock-new","pushedAt":"2024-06-12T23:21:45.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"janvorli","name":"Jan Vorlicek","path":"/janvorli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/10758568?s=80&v=4"},"commit":{"message":"Add comment on why trimming the stack trace by keep alive is needed\n\nI have also realized that when we need to trim, the keepAlive array is\nalways fully populated, so we don't need to check for cases where there\nwould be NULL in an entry of the array.","shortMessageHtmlLink":"Add comment on why trimming the stack trace by keep alive is needed"}},{"before":"12db638c17f983601e8c72ea3ea89b3be80fdc0e","after":"4259620d0761cc72ba5b24b0c843be3bcf09561b","ref":"refs/heads/remove-eh-stacktrace-global-lock-new","pushedAt":"2024-06-11T19:14:38.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"janvorli","name":"Jan Vorlicek","path":"/janvorli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/10758568?s=80&v=4"},"commit":{"message":"Add VolatileLoad/Store around the size / keep alive count\n\nAlso remove the memory barrier from the StackTraceArray::Append since it\nis not needed after that change.","shortMessageHtmlLink":"Add VolatileLoad/Store around the size / keep alive count"}},{"before":"20caf05e34e3147a6af6d235ff32bd6c36dc198d","after":"12db638c17f983601e8c72ea3ea89b3be80fdc0e","ref":"refs/heads/remove-eh-stacktrace-global-lock-new","pushedAt":"2024-06-11T15:24:50.000Z","pushType":"push","commitsCount":2,"pusher":{"login":"janvorli","name":"Jan Vorlicek","path":"/janvorli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/10758568?s=80&v=4"},"commit":{"message":"Move the race handling into GetStackTrace only\n\nPlus an unused method removal and a little naming / contract cleanup","shortMessageHtmlLink":"Move the race handling into GetStackTrace only"}},{"before":"8355c30c5c28733ecafffd06f74a393f479c30f6","after":"20caf05e34e3147a6af6d235ff32bd6c36dc198d","ref":"refs/heads/remove-eh-stacktrace-global-lock-new","pushedAt":"2024-06-10T23:23:29.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"janvorli","name":"Jan Vorlicek","path":"/janvorli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/10758568?s=80&v=4"},"commit":{"message":"Remove dummy field and an unused function","shortMessageHtmlLink":"Remove dummy field and an unused function"}},{"before":"0fa22adabe7f66cebb2f788b9e082b72358988c8","after":"8355c30c5c28733ecafffd06f74a393f479c30f6","ref":"refs/heads/remove-eh-stacktrace-global-lock-new","pushedAt":"2024-06-10T22:50:47.000Z","pushType":"push","commitsCount":2,"pusher":{"login":"janvorli","name":"Jan Vorlicek","path":"/janvorli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/10758568?s=80&v=4"},"commit":{"message":"Remove SaveStackTracesFromDeepCopy\n\nAlso rename GetStackTracesDeepCopy to GetFrozenStackTrace and move the\nreturn argument to return value.","shortMessageHtmlLink":"Remove SaveStackTracesFromDeepCopy"}},{"before":"d056127c9afa3aecebac8088cf61462b937acc00","after":"0fa22adabe7f66cebb2f788b9e082b72358988c8","ref":"refs/heads/remove-eh-stacktrace-global-lock-new","pushedAt":"2024-06-10T20:04:44.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"janvorli","name":"Jan Vorlicek","path":"/janvorli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/10758568?s=80&v=4"},"commit":{"message":"Fix typo","shortMessageHtmlLink":"Fix typo"}},{"before":"69d1e717cd528f35a5c7f3b04f58735d8691081e","after":"d056127c9afa3aecebac8088cf61462b937acc00","ref":"refs/heads/remove-eh-stacktrace-global-lock-new","pushedAt":"2024-06-10T19:32:21.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"janvorli","name":"Jan Vorlicek","path":"/janvorli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/10758568?s=80&v=4"},"commit":{"message":"Handle possible array size overflow\n\nIn the StackTraceArray::Allocate","shortMessageHtmlLink":"Handle possible array size overflow"}},{"before":"2d6378165474393bed65134602cf04fed6b9651a","after":"69d1e717cd528f35a5c7f3b04f58735d8691081e","ref":"refs/heads/remove-eh-stacktrace-global-lock-new","pushedAt":"2024-06-10T19:03:39.000Z","pushType":"push","commitsCount":3,"pusher":{"login":"janvorli","name":"Jan Vorlicek","path":"/janvorli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/10758568?s=80&v=4"},"commit":{"message":"Handle possible array size overflow\n\nIn the StackTraceArray::Allocate","shortMessageHtmlLink":"Handle possible array size overflow"}},{"before":"dda965c65110fc5b395e8b9766d5e25be5747aed","after":"e98caa19af694c603df0da6f3ac950c6a684cae0","ref":"refs/heads/fix-cet-remove-wrssq","pushedAt":"2024-06-07T22:19:29.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"janvorli","name":"Jan Vorlicek","path":"/janvorli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/10758568?s=80&v=4"},"commit":{"message":"Fix CET - remove writing to shadow stack\n\nIn my recent fix for failures with CET enabled, I have also added a call to\nthe _wrssq intrinsic to push an address to shadow stack. It turns out\nthat instruction is privileged and cannot be used by user code.\nMoreover, I have realized that it is not needed at all there, so I am\nremoving it.","shortMessageHtmlLink":"Fix CET - remove writing to shadow stack"}},{"before":null,"after":"dda965c65110fc5b395e8b9766d5e25be5747aed","ref":"refs/heads/fix-cet-remove-wrssq","pushedAt":"2024-06-07T18:11:49.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"janvorli","name":"Jan Vorlicek","path":"/janvorli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/10758568?s=80&v=4"},"commit":{"message":"Fix CET - remove writing to shadow stack\n\nIn my recent fix for failures with CET enabled, I have also added a call to\nthe _wrssq intrinsic to push an address to shadow stack. It turns out\nthat instruction is privileged and cannot be used by user code.\nMoreover, I have realized that it is not needed at all there, so I am\nremoving it.","shortMessageHtmlLink":"Fix CET - remove writing to shadow stack"}},{"before":"fb8cc6b890eee4acf244f329a05d2cece4ad14ea","after":"2d6378165474393bed65134602cf04fed6b9651a","ref":"refs/heads/remove-eh-stacktrace-global-lock-new","pushedAt":"2024-06-06T16:55:10.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"janvorli","name":"Jan Vorlicek","path":"/janvorli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/10758568?s=80&v=4"},"commit":{"message":"Fix several issues\n\n* Missing calls to IsOverflow at few places\n* Added a flag on StackTraceElement to indicate that the element needs a\n keepalive entry. It removes the need to call IsLCGMethod / Collectible\n check on the method table stored in the element and eliminates a\n possible problem with the method being collected in one place.\n* Returned missing call to StackFrameInfo::Init to the x86 code path\n* Removed obsolete comment and code line","shortMessageHtmlLink":"Fix several issues"}},{"before":"a9e2bbabf57409843812c82d810039e47945a598","after":null,"ref":"refs/heads/fix-eh-shadow-stack-handling","pushedAt":"2024-06-05T21:14:56.000Z","pushType":"branch_deletion","commitsCount":0,"pusher":{"login":"janvorli","name":"Jan Vorlicek","path":"/janvorli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/10758568?s=80&v=4"}},{"before":"5ea35966dc58c8adc02c2ad295dc3fc5f07e91e7","after":"6ba16e0dd1b5a26fe870371994abd8bbf8e3c1d8","ref":"refs/heads/enable-activation-sending-to-dispatch-queue-threads","pushedAt":"2024-06-05T20:51:01.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"janvorli","name":"Jan Vorlicek","path":"/janvorli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/10758568?s=80&v=4"},"commit":{"message":"Workaround until CI can switch to newer xcode","shortMessageHtmlLink":"Workaround until CI can switch to newer xcode"}},{"before":"577027ecbf8f07b23a86dbc8780aee1e1b5966ef","after":"5ea35966dc58c8adc02c2ad295dc3fc5f07e91e7","ref":"refs/heads/enable-activation-sending-to-dispatch-queue-threads","pushedAt":"2024-06-05T19:35:26.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"janvorli","name":"Jan Vorlicek","path":"/janvorli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/10758568?s=80&v=4"},"commit":{"message":"Workaround until CI can switch to newer xcode","shortMessageHtmlLink":"Workaround until CI can switch to newer xcode"}},{"before":"7cbcae1fe355536841e5479e0c309659cccd7fc5","after":"a9e2bbabf57409843812c82d810039e47945a598","ref":"refs/heads/fix-eh-shadow-stack-handling","pushedAt":"2024-06-05T18:59:52.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"janvorli","name":"Jan Vorlicek","path":"/janvorli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/10758568?s=80&v=4"},"commit":{"message":"Fix shadow stack handling during exception handling\n\nThe shadow stack pointer was not updated when resuming execution after a\ncatch handler. That was causing stack overflow crashes in some of the\ncoreclr tests when running with CET enabled.\n\nThis change adds proper updating of the shadow stack pointer in a similar\nway to what RtlRestoreContext does.","shortMessageHtmlLink":"Fix shadow stack handling during exception handling"}},{"before":"96da965c2b7a9477245d4265301b0e62b3462bad","after":"fb8cc6b890eee4acf244f329a05d2cece4ad14ea","ref":"refs/heads/remove-eh-stacktrace-global-lock-new","pushedAt":"2024-06-05T15:34:54.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"janvorli","name":"Jan Vorlicek","path":"/janvorli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/10758568?s=80&v=4"},"commit":{"message":"Fix x86 build","shortMessageHtmlLink":"Fix x86 build"}},{"before":"718f6384240f0a8261bd1513865e79da67ede755","after":"96da965c2b7a9477245d4265301b0e62b3462bad","ref":"refs/heads/remove-eh-stacktrace-global-lock-new","pushedAt":"2024-06-05T15:33:30.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"janvorli","name":"Jan Vorlicek","path":"/janvorli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/10758568?s=80&v=4"},"commit":{"message":"Fix MUSL build","shortMessageHtmlLink":"Fix MUSL build"}},{"before":"3f71c9d960bf5420fe01f3b57bf1dbf3155cd251","after":"718f6384240f0a8261bd1513865e79da67ede755","ref":"refs/heads/remove-eh-stacktrace-global-lock-new","pushedAt":"2024-06-05T15:01:31.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"janvorli","name":"Jan Vorlicek","path":"/janvorli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/10758568?s=80&v=4"},"commit":{"message":"Remove global spinlock for EH stacktrace\n\nThe global spinlock that was used to ensure that stack trace and the\nassociated dynamic methods array were updated and read atomically.\nHowever, for the new EH, it has shown to cause a high contention in case\nmany threads were handling exceptions at the same time.\n\nThis change replaces the two arrays by one object member in the\nexception class. It contains reference to either the byte[] of the\nstack trace (when there are no dynamic methods on the stack trace) or an\nobject[] where the first element contains the stack trace byte[]\nreference and the following elements contain what used to be in the\ndynamic array. That allows atomic updates and reads of the stack trace\nand dynamic method keepalive references without a need of a lock.\n\nThe original code was quite convoluted, it was difficult to reason about\nand it had some races in it that were hidden behind the global lock. So\nI have decided to rewrite the whole thing from scratch.\n\nThe way it ensures that it is race free is that whenever it updates the\nexception stack trace and the one that's on the exception was created by\na different thread, it creates a deep copy of both the stack trace and\nthe keepalive array. When making the copy, it also handles a case when\na frame that needs a keepalive entry is on the stack trace part, but the\nkeepalive array extracted from the exception is stale (the other thread\nneeded to resize the keepalive array, but not the stack trace). In that\ncase, the stack trace is trimmed at first such entry found.\n\nSince the case when multiple threads are throwing the same exception and\nso they are modifying its stack trace in parallel is pathological\nanyways, I believe the extra work spent on creating the clones of the arrays\nis a good tradeoff for ensuring easy to reason about thread safety.\n\nI have also removed a dead code path from the\nStackTraceInfo::SaveStackTrace.\n\nFinally, since with the previous iteration of this change, a bug in\nbuilding the stack trace was found, I have added a coreclr test to\nverify stack trace for an exception matches the expectations.","shortMessageHtmlLink":"Remove global spinlock for EH stacktrace"}},{"before":"8d98bf4c5c84d5069021542cd7f1d787254ffea2","after":"3f71c9d960bf5420fe01f3b57bf1dbf3155cd251","ref":"refs/heads/remove-eh-stacktrace-global-lock-new","pushedAt":"2024-06-05T14:56:46.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"janvorli","name":"Jan Vorlicek","path":"/janvorli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/10758568?s=80&v=4"},"commit":{"message":"Remove global spinlock for EH stacktrace\n\nThe global spinlock that was used to ensure that stack trace and the\nassociated dynamic methods array were updated and read atomically.\nHowever, for the new EH, it has shown to cause a high contention in case\nmany threads were handling exceptions at the same time.\n\nThis change replaces the two arrays by one object member in the\nexception class. It contains reference to either the byte[] of the\nstack trace (when there are no dynamic methods on the stack trace) or an\nobject[] where the first element contains the stack trace byte[]\nreference and the following elements contain what used to be in the\ndynamic array. That allows atomic updates and reads of the stack trace\nand dynamic method keepalive references without a need of a lock.\n\nThe original code was quite convoluted, it was difficult to reason about\nand it had some races in it that were hidden behind the global lock. So\nI have decided to rewrite the whole thing from scratch.\n\nThe way it ensures that it is race free is that whenever it updates the\nexception stack trace and the one that's on the exception was created by\na different thread, it creates a deep copy of both the stack trace and\nthe keepalive array. When making the copy, it also handles a case when\na frame that needs a keepalive entry is on the stack trace part, but the\nkeepalive array extracted from the exception is stale (the other thread\nneeded to resize the keepalive array, but not the stack trace). In that\ncase, the stack trace is trimmed at first such entry found.\n\nSince the case when multiple threads are throwing the same exception and\nso they are modifying its stack trace in parallel is pathological\nanyways, I believe the extra work spent on creating the clones of the arrays\nis a good tradeoff for ensuring easy to reason about thread safety.\n\nI have also removed a dead code path from the\nStackTraceInfo::SaveStackTrace.\n\nFinally, since with the previous iteration of this change, a bug in\nbuilding the stack trace was found, I have added a coreclr test to\nverify stack trace for an exception matches the expectations.","shortMessageHtmlLink":"Remove global spinlock for EH stacktrace"}},{"before":"2ccc8f9496a91ec871aeecd7d079f643354938ad","after":"8d98bf4c5c84d5069021542cd7f1d787254ffea2","ref":"refs/heads/remove-eh-stacktrace-global-lock-new","pushedAt":"2024-06-05T14:55:33.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"janvorli","name":"Jan Vorlicek","path":"/janvorli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/10758568?s=80&v=4"},"commit":{"message":"Remove unused members of the StackTraceInfo","shortMessageHtmlLink":"Remove unused members of the StackTraceInfo"}},{"before":"aea73b0d3f872f9c88c6dfd62c9bb40fa3b066e2","after":"2ccc8f9496a91ec871aeecd7d079f643354938ad","ref":"refs/heads/remove-eh-stacktrace-global-lock-new","pushedAt":"2024-06-05T12:55:15.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"janvorli","name":"Jan Vorlicek","path":"/janvorli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/10758568?s=80&v=4"},"commit":{"message":"Remove unused members of the StackTraceInfo","shortMessageHtmlLink":"Remove unused members of the StackTraceInfo"}},{"before":"ecf6fa3ad4e22667ee689a4c88da62dfab1f4703","after":"f3e569865e371ba628ed09bb05b499160b4bcb6b","ref":"refs/heads/fix-corrupting-exceptions-handling","pushedAt":"2024-06-04T23:23:32.000Z","pushType":"push","commitsCount":1,"pusher":{"login":"janvorli","name":"Jan Vorlicek","path":"/janvorli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/10758568?s=80&v=4"},"commit":{"message":"Remove the WinDbg first chance notification","shortMessageHtmlLink":"Remove the WinDbg first chance notification"}},{"before":null,"after":"ecf6fa3ad4e22667ee689a4c88da62dfab1f4703","ref":"refs/heads/fix-corrupting-exceptions-handling","pushedAt":"2024-06-04T21:14:53.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"janvorli","name":"Jan Vorlicek","path":"/janvorli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/10758568?s=80&v=4"},"commit":{"message":"Fix handling of corrupting state exceptions\n\nThe new EH is not correctly handling corrupting state exceptions.\nInstead of failing fast, the exceptions are actually handled like other\nexceptions and can be caught by the user code.\n\nThis change fixes it. Besides fixing the issue, I had to introduce a way\nto trim exception handling code frames from the stack trace reported by\nthe failfast, otherwise the output would be confusing.\n\nAs an additional change, I've noticed that hardware exceptions under\nWinDbg don't trigger the WinDbg first chance exception mechanism. I've\nrecently fixed the same for software exceptions, this adds the same for\nhardware ones.\n\nClose #103018","shortMessageHtmlLink":"Fix handling of corrupting state exceptions"}},{"before":"294cd8427d44277efca3ecfea3fe7fe7b5595864","after":"7cbcae1fe355536841e5479e0c309659cccd7fc5","ref":"refs/heads/fix-eh-shadow-stack-handling","pushedAt":"2024-06-04T19:44:58.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"janvorli","name":"Jan Vorlicek","path":"/janvorli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/10758568?s=80&v=4"},"commit":{"message":"Fix shadow stack handling during exception handling\n\nThe shadow stack pointer was not updated when resuming execution after a\ncatch handler. That was causing stack overflow crashes in some of the\ncoreclr tests when running with CET enabled.\n\nThis change adds proper updating of the shadow stack pointer in a similar\nway to what RtlRestoreContext does.","shortMessageHtmlLink":"Fix shadow stack handling during exception handling"}},{"before":null,"after":"294cd8427d44277efca3ecfea3fe7fe7b5595864","ref":"refs/heads/fix-eh-shadow-stack-handling","pushedAt":"2024-06-04T19:40:53.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"janvorli","name":"Jan Vorlicek","path":"/janvorli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/10758568?s=80&v=4"},"commit":{"message":"Fix shadow stack handling during exception handling\n\nThe shadow stack pointer was not updated when resuming execution after a\ncatch handler. That was causing stack overflow crashes in some of the\ncoreclr tests when running with CET enabled.\n\nThis change adds proper updating of the shadow stack pointer in a similar\nway to what RtlRestoreContext does.","shortMessageHtmlLink":"Fix shadow stack handling during exception handling"}},{"before":null,"after":"aea73b0d3f872f9c88c6dfd62c9bb40fa3b066e2","ref":"refs/heads/remove-eh-stacktrace-global-lock-new","pushedAt":"2024-06-03T20:32:41.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"janvorli","name":"Jan Vorlicek","path":"/janvorli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/10758568?s=80&v=4"},"commit":{"message":"Remove global spinlock for EH stacktrace\n\nThe global spinlock that was used to ensure that stack trace and the\nassociated dynamic methods array were updated and read atomically.\nHowever, for the new EH, it has shown to cause a high contention in case\nmany threads were handling exceptions at the same time.\n\nThis change replaces the two arrays by one object member in the\nexception class. It contains reference to either the byte[] of the\nstack trace (when there are no dynamic methods on the stack trace) or an\nobject[] where the first element contains the stack trace byte[]\nreference and the following elements contain what used to be in the\ndynamic array. That allows atomic updates and reads of the stack trace\nand dynamic method keepalive references without a need of a lock.\n\nThe original code was quite convoluted, it was difficult to reason about\nand it had some races in it that were hidden behind the global lock. So\nI have decided to rewrite the whole thing from scratch.\n\nThe way it ensures that it is race free is that whenever it updates the\nexception stack trace and the one that's on the exception was created by\na different thread, it creates a deep copy of both the stack trace and\nthe keepalive array. When making the copy, it also handles a case when\na frame that needs a keepalive entry is on the stack trace part, but the\nkeepalive array extracted from the exception is stale (the other thread\nneeded to resize the keepalive array, but not the stack trace). In that\ncase, the stack trace is trimmed at first such entry found.\n\nSince the case when multiple threads are throwing the same exception and\nso they are modifying its stack trace in parallel is pathological\nanyways, I believe the extra work spent on creating the clones of the arrays\nis a good tradeoff for ensuring easy to reason about thread safety.\n\nI have also removed a dead code path from the\nStackTraceInfo::SaveStackTrace.\n\nFinally, since with the previous iteration of this change, a bug in\nbuilding the stack trace was found, I have added a coreclr test to\nverify stack trace for an exception matches the expectations.","shortMessageHtmlLink":"Remove global spinlock for EH stacktrace"}},{"before":"5d6333aba3dd240b83e988f1c83af583b2f70549","after":"f76aaf986f89d90497011904850793be6d7bc526","ref":"refs/heads/remove-eh-stacktrace-global-lock-backup-2","pushedAt":"2024-06-03T19:58:31.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"janvorli","name":"Jan Vorlicek","path":"/janvorli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/10758568?s=80&v=4"},"commit":{"message":"Fix DAC version of ExceptionObject::GetStackTraceParts\n\nThere was a call to GetThread that doesn't make sense in DAC","shortMessageHtmlLink":"Fix DAC version of ExceptionObject::GetStackTraceParts"}},{"before":"50a6b7f54421b8d3f60b416daf4862162d2d5f18","after":"577027ecbf8f07b23a86dbc8780aee1e1b5966ef","ref":"refs/heads/enable-activation-sending-to-dispatch-queue-threads","pushedAt":"2024-05-30T18:09:41.000Z","pushType":"force_push","commitsCount":0,"pusher":{"login":"janvorli","name":"Jan Vorlicek","path":"/janvorli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/10758568?s=80&v=4"},"commit":{"message":"Enable sending activation to dispatch queue threads\n\nUntil recently, it was not possible to send activation signal to Apple\ndispatch queue threads using pthread_kill. So in case a .NET code was running\non such a thread, it could end up blocking runtime suspension in some cases.\nRecently, Apple has implemented a new API to enable sending specific signals\nto the dispatch queues, the dispatch_allow_send_signals.\n\nThis change adds a call to that API to the PAL initialization code.","shortMessageHtmlLink":"Enable sending activation to dispatch queue threads"}},{"before":null,"after":"50a6b7f54421b8d3f60b416daf4862162d2d5f18","ref":"refs/heads/enable-activation-sending-to-dispatch-queue-threads","pushedAt":"2024-05-30T17:30:16.000Z","pushType":"branch_creation","commitsCount":0,"pusher":{"login":"janvorli","name":"Jan Vorlicek","path":"/janvorli","primaryAvatarUrl":"https://avatars.githubusercontent.com/u/10758568?s=80&v=4"},"commit":{"message":"Enable sending activation to dispatch queue threads\n\nUntil recently, it was not possible to send activation signal to Apple\ndispatch queue threads using pthread_kill. So in case a .NET code was running\non such a thread, it could end up blocking runtime suspension in some cases.\nRecently, Apple has implemented a new API to enable sending specific signals\nto the dispatch queues, the dispatch_allow_send_signals.\n\nThis change adds a call to that API to the PAL initialization code.","shortMessageHtmlLink":"Enable sending activation to dispatch queue threads"}}],"hasNextPage":true,"hasPreviousPage":false,"activityType":"all","actor":null,"timePeriod":"all","sort":"DESC","perPage":30,"cursor":"djE6ks8AAAAEZJ2Z7wA","startCursor":null,"endCursor":null}},"title":"Activity ยท janvorli/runtime"}