stress-ng opcode test question

Asked by dongfu

I use stress-ng to stress CPU(Xeon E3, CentOS7). During the test, I found that system clock has been modified to 1970 or 1969 strangely, but this modification has no effect to rtc. For a tough debug, found stress-opcode cause this modification, below is the code

((void (*)(void))(ops_begin + mwc8()))();

And I limit test to opcode only, like this :

./stress-ng --opcode 0 --timeout 3m --log-file log/opcode.log

The test also cause different results, like user logout, gibberish output and so on. Can anyone explain this test, I have read some short description about opcode in cpu.job, but still question how the test code work. For the system time is changed, but the test past, how can I how if the system work correctly or not?

Question information

English Edit question
Ubuntu stress-ng Edit question
No assignee Edit question
Solved by:
Last query:
Last reply:
Revision history for this message
Best actionparsnip (andrew-woodhead666) said :

This is Ubuntu support only. You are using CentOS so should post on the CentOS forum here:

There are distribution agnostic forums but this is not one of them.

Revision history for this message
Colin Ian King (colin-king) said :

The stress-ng opcode test generates 16 pages of random binary op-codes and then jumps into this at random points. The test just checks that random or unexpected opcodes won't cause unexpected behaviour (such as CPU lock ups or hangs). I guess I should probably add some BPF protection around the code so it can't call random system calls either.

Revision history for this message
Colin Ian King (colin-king) said :

From the manual:

       --opcode N
              start N workers that fork off children that execute randomly gen‐
              erated executable code. This will generate issues such as illegal
              instructions, bus errors, segmentation faults, traps, floating
              point errors that are handled gracefully by the stressor.

Since this generates "random" op-codes one may wonder if it is possible to make this test repeatable, one force stress-ng to never re-seed and just use the default hard-coded seed using the --no-rand-seed option.

Revision history for this message
actionparsnip (andrew-woodhead666) said :

Please move this to the CentOS forum as this is Ubuntu support only

Revision history for this message
dongfu (dongfu) said :

Thanks actionparsnip, that solved my question.

Revision history for this message
Colin Ian King (colin-king) said :

@activeparnsip, just because this has been reported by a CentOS user does not mean we should dismiss this question. In fact, I have now a fix for this issue:

See bug: #1714044

Thanks for asking the question, it helped me find and fix another bug.

Revision history for this message
Colin Ian King (colin-king) said :

This has now been fixed with stress-ng 0.08.13 in ubuntu artful.

Revision history for this message
dongfu (dongfu) said :

I have tested stress-ng 0.08.13, it still have problem. please check sys/capability.h, it should be linux/capability.h in ubuntu 16.04.

Revision history for this message
Dong Fu (jackietung) said :

These patches have ported to CentOS, and work well. Thanks Colin Ian King.