3 ms·
I think we’re operating on different definitions of “memory unsafe”. Memory unsafe means accessing uninitialised memory, freed memory, other objects’ memory and
by chrismorgan 9y ago
I think we’re operating on different definitions of “memory unsafe”. Memory unsafe means accessing uninitialised memory, freed memory, other objects’ memory and so forth.
This article seems to simply be describing memory inefficiency in promises, that in certain situations it can leak like a sieve.
If Promise in any particular environment was not memory-safe, that would probably be a high or critical security vulnerability. Mere memory leaks are not a security issue.
(I’m operating on the reasonable assumption that the JavaScript engine is simply going OOM and crashing for that reason instead of something more sinister.)
- bad_user 9y agoI agree, but I did not know that I can't use "memory unsafe" to describe plain old memory leaks. Indeed, it's not a security issue.
- chrismorgan 9y agoI’m biased by being heavily steeped in Rust, but I believe this is the accepted definition of “memory unsafe”. OOM crashes don’t really get the chance to be memory unsafe—the process is killed, so all its memory vanishes like the dew in the morn, only several orders of magnitude faster.
- deleted 9y ago[deleted]
- skate22 9y agoIs it bad that i read 'OOM' as out of mana?
- vbezhenar 9y agoAs I understood, problem is that stack overflow happens in native code, which causes access violation error and virtual machine is killed. "Proper" stack overflow should result with JavaScript exception and virtual machine should remain in working state, the same is about memory leak.
- chrismorgan 9y agoYeah, that seems a reasonable clarification to put on it: this is more severe than a mere memory leak, because it can be mildly weaponised to a DoS attack. But I expect it’s still only in “bug that would be nice fixed” category rather than “security issue that needs to be fixed”. (Addition: hang on, is this crashing OOM or crashing stack overflow? I’m guessing it’s OOM, in which case it would not be a bug at all.)
- narag 9y ago...which causes access violation error and virtual machine is killed When you write "virtual machine" do you mean the local JavaScript engine? For most people that would be just a little annoyance, the usual browser crash. I actually prefer crash to freeze.
- vbezhenar 9y ago> When you write "virtual machine" do you mean the local JavaScript engine? Yes, of course, JavaScript VM inside a browser process or one of them. > For most people that would be just a little annoyance, the usual browser crash. I actually prefer crash to freeze. Any browser crash is a bug and should never happen for any input. If browser is smart enough to run separate process for different pages, this is little annoyance indeed. I remember when crashed page caused entire browser to crash and often lose open tabs. That wasn't little annoyance. Also some clever guy might figure out how to exploit this crash, I'm not sure if it's possible, but I'm not the clever one :)