In latest node v4.x and below, when an array with an accessor that throws is passed into process.hrtime(), it will produce a segmentation fault.
Example
const badArray = []
Object.defineProperty(badArray, 0, {
get: () => {
throw Error('I am a bad accessor')
}
})
process.hrtime(badArray)
On node v5.x and v6.x this will just throw, which is expected. On node v4.x and below, this produces a segmentation fault.
I think this was fixed on v5.x+ by this commit fc143da.
Though this particular case is really edgy, it's my understanding that node APIs probably shouldn't segfault ever.
/cc @mlfbrown @deian who found this.
In latest node v4.x and below, when an array with an accessor that throws is passed into
process.hrtime(), it will produce a segmentation fault.Example
On node v5.x and v6.x this will just throw, which is expected. On node v4.x and below, this produces a segmentation fault.
I think this was fixed on v5.x+ by this commit fc143da.
Though this particular case is really edgy, it's my understanding that node APIs probably shouldn't segfault ever.
/cc @mlfbrown @deian who found this.