On most architectures I've used, the distinction is that:
- a SEGV is caused when you access memory you're not meant to (e.g., outside of your address space).
- a SIGBUS is caused due to alignment issues with the CPU (e.g., trying to read a long from an address which isn't a multiple of 4).
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…