Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

An ideal candidate would have been bitten by bugs where the segfualt never happens because the offending code got optimized away. Once you've been bitten by that once, it become hard to answer with just "segfault".


I'm not sure it even has to get optimized away. Stuff like,

  Foo *ptr = NULL;
  ptr->member...
isn't going to access address 0, even w/o optimizations, despite the only pointer here being null. (It depends on the offset of "member", and if that offset is large enough, it might not be in the first page anymore. What's mapped at 0x1000 and later?)


I am not suggesting someone should answer with "segfault" and in fact I think that might be a worse answer than just "UB".

A good answer would be something like "UB according to the standard, but often segfault in real-world code on x86"...




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: