Opened 14 years ago

Closed 13 years ago

#6704 closed bug (fixed)

SIGBUS and SIGSEGV must be different

Reported by: scottmc Owned by: bonefish
Priority: normal Milestone: R1
Component: System/POSIX Version: R1/Development
Keywords: Cc: andreasf
Blocked By: Blocking:
Platform: All

Description

Currently SIGSEGV and SIGBUS are set the same, as was done in BeOS.

Separate SIGBUS signal should be added eventually. Might require a bit of caution to do that in a binary compatible way.

Change History (8)

comment:1 by andreasf, 14 years ago

Cc: andreasf added

comment:2 by tonestone57, 14 years ago

SIGSEGV - Invalid memory reference
SIGBUS - Bus error

SIGBUS should be value 7 (or 10) depending on hardware platform.

http://www.koders.com/c/fidF560E3FC4BCD5200C7F55D4DFE77D0A3B6984BFD.aspx

comment:3 by phoudoin, 14 years ago

Can't we raise SIGBUS too when SIGSEGV signal is raised, making SIGBUS an alias of SIGSEGV but allowing two signal handlers as required by POSIX?

in reply to:  3 comment:4 by bonefish, 14 years ago

Replying to phoudoin:

Can't we raise SIGBUS too when SIGSEGV signal is raised, making SIGBUS an alias of SIGSEGV but allowing two signal handlers as required by POSIX?

The problem is that SIGSEGV == SIGBUS (i.e. the constants are equal). Redefining SIGBUS and actually raising the signal could be a binary compatibility issue, since old applications might expect that the signal is never thrown -- though I suspect there aren't that many programs that actually handle these signals anyway (at least all ported code could be updated accordingly). Redefining it and not raising it might work, but the signals do have a different meaning (cf. the specs), so it would make most sense to implement them correctly.

comment:5 by bonefish, 14 years ago

I forgot to add: Introducing a new signal means incrementing NSIG, which also is a binary compatibility issue that needs to be investigated.

comment:6 by scottmc, 13 years ago

Owner: changed from nobody to bonefish
Status: newassigned

comment:7 by bonefish, 13 years ago

Status: assignedin-progress

comment:8 by bonefish, 13 years ago

Resolution: fixed
Status: in-progressclosed

Fixed in hrev42116.

Note: See TracTickets for help on using tickets.