
25 Aug
2004
25 Aug
'04
10:04 a.m.
The regex library contains an alignment bug that leads to bus errors on 64
bit platforms (in particular, Sun and HP). To reproduce, compile regular expression '(?>a+b|a+)bc+' with flags regex_constants::normal. This should raise SIGBUS in perl_matcher<>::push_alt(). That's a known issue, and was fixed in cvs a while ago, with almost the same fix that you used: struct saved_state { union{ unsigned int id; // these ensure that this struct gets the same alignment as derived structs: void* padding1; std::size_t padding2; std::ptrdiff_t padding3; }; saved_state(unsigned i) : id(i) {} }; John.