Skip to content

stackoverflow can't be correctly caught inside of qemu user #2192

@Avimitin

Description

@Avimitin

What happened

test-c-stack.sh, test-sigsegv-catch-stackoverflow1 and test-sigsegv-catch-stackoverflow2, these gnulib tests in packages diffutils and m4 will fail because the unexpected behavior of signal handling in qemu user.

These three tests will try to capture signal SIGSEGV and find out if the signal is triggered by the stack overflow exception. However, because of some unknown reason, the tests fail to capture the segmentation fault and so all of the tests will fail.

How to reproduce:

Here is a small reproduce example: https://github.com/Avimitin/stackoverflow-recover.

git clone https://github.com/Avimitin/stackoverflow-recover.git
cd stackoverflow-recover
make run

Current behavior

  • On normal x86_64 machine (Work as expected)
starting recursion
Stack overflow caught.
All done
  • On SiFive Unmatched (Work as expected)
starting recursion
Stack overflow caught.
All done
  • On QEMU-User (Failed)
starting recursion
Segmentation fault (core dumped)

Conclusion

The reason why those tests fail is still unknown, but we can confirm that this unexpected behavior will occur in qemu-user only. In my opinion, we can just add those packages to the qemu user blacklist now as it is really hard to find out the reason.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions