Boost logo

Boost :

From: Benzinger, Ralph (ralph.benzinger_at_[hidden])
Date: 2004-08-24 11:50:41


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().

As a fix, I suggest forcing alignment of structure saved_state in perl_matcher_common.cpp:

   struct saved_state
< unsigned int id;
< saved_state(unsigned i) : id(i) {}
-> union align
-> {
-> unsigned int id;
-> void* dummy;
-> align(unsigned i) : id(i) {}
-> } id_aligned;
-> saved_state(unsigned i) : id_aligned(i) {}

and further down below:

< unwinder = s_unwind_table[m_backup_state->id];
-> unwinder = s_unwind_table[m_backup_state->];

The other saved_* structures that get pushed onto the stack seem fine for now.


Boost list run by bdawes at, gregod at, cpdaniel at, john at