Hi everyone,

With the latest patches for compiling using -std=c++0x and gcc 4.6, there are 
sporadic failures for some Ruby regressions, e.g. last night:


***** 
build/ALPHA_MOESI_hammer/tests/opt/quick/se/50.memtest/alpha/linux/memtest-ruby-MOESI_hammer
 FAILED!

***** 
build/ALPHA_MOESI_CMP_token/tests/opt/quick/se/60.rubytest/alpha/linux/rubytest-ruby-MOESI_CMP_token
 FAILED!

***** 
build/ALPHA_MOESI_CMP_token/tests/opt/quick/se/50.memtest/alpha/linux/memtest-ruby-MOESI_CMP_token
 FAILED!


I suspect that this is due to the different implementation of the hash map 
(used to be ext/hash_map, and is now unordered map) and the use of iterators to 
traverse this map in parts of Ruby. For example, in StateMachine.py:

        for (WaitingBufType::iterator buf_iter = m_waiting_buffers.begin();
             buf_iter != m_waiting_buffers.end();
             ++buf_iter) {
             for (MsgVecType::iterator vec_iter = buf_iter->second->begin();
                  vec_iter != buf_iter->second->end();
                  ++vec_iter) {
                  if (*vec_iter != NULL) {
                      (*vec_iter)->reanalyzeAllMessages();
                  }
             }
             wokeUpMsgVecs.push_back(buf_iter->second);
        }

I am not sure if this particular piece of code is the issue, but in general we 
have to ensure that any iteration over a hashtable does not have _any ordering 
dependency_ since nothing can be assumed about the order of the traversal. I 
can try and look through some of the files, but would greatly appreciate if 
someone more at home with Ruby could help and track down all the places where 
iteration takes place and confirm that the behaviour is deterministic 
independent of the order (or alternatively add an ordered container next to the 
hash table for keeping an ordered list/vector etc).

Thanks,

Andreas

-- IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.
_______________________________________________
gem5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to