-
-
Notifications
You must be signed in to change notification settings - Fork 66
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
Memory crash since @tsd/typescript@5.2.2
#214
Comments
I can reproduce directly with |
This is interesting. When I run the above with Also, I am curious how the above TypeScript commit would have an impact on the above. It only adds type definitions for |
Could you point to concrete types which are causing the problem, please? I always struggle to understand abstract Do I get it right that your provided type |
I would like to provide with a more meaningful example. However, the original types are quite complex. I spent several hours reducing them to the minimal example above, but it started to get nonsensical at some point. That being said, while understanding the original intent would be helpful for a feature request, this is quite clearly a bug. Regardless of the original intent, the example above should not crash (even if the types do not make sense). Now, I have been doing some additional research, and it appears that the problem is actually not related to
Other times, it crashes with OOM. In my case, the reason it fails only when using I managed to reproduce the bug with only TypeScript, without Thanks for looking into this! 👍 |
The following crashes:
System: Ubuntu
23.10
, Node21.7.2
, latesttsd
(0.31.0
). I could also reproduce this bug on a GitHub action running on Windows, macOS and Linux. So this does not appear to be OS-related, nor machine-related. Node16.17.0
crashes too, so this does not appear to be Node version-related either.However, it does appear the above bug might be related to the
5.2.2
release of@tsd/typescript
, which was shipped withtsd@0.29.0
.At first, it might look this is not an issue with
tsd
but with TypeScript. However:tsc
on the above files does not crash. Only callingtsd
does.import 'tsd'
statement makes it not crash anymore. Even though nothing is imported/used fromtsd
.If the above types do not make much sense, that's because they are a reduction of the original types (which did make sense). Although not quite sensical, those types are quite simple and not circular, so they should not cause a memory crash. I could not reduce them any further.
This bug is currently preventing Execa from upgrading
tsd
. Namely, upgradingtsd
will make memory crash. The above is a reduction of that problem.This is a very strange bug because very minor changes fail to reproduce it. This includes:
B
instead ofA
, even thoughA
should be identical toB
, in principleextends 2
intoextends 1
, even though neither1
nor2
is used anywhere elseThe memory crash happens after
tsd
runs for 10+ seconds. That's quite slow for such small types, so it seems liketsd
is getting stuck in some loop until it crashes with OOM.The text was updated successfully, but these errors were encountered: