Skip to content

boards: qemu: leon3: fault unique to this platform #98258

@cfriedt

Description

@cfriedt

Describe the bug

I've encountered an unusual fault running the tests/posix/barriers testsuite under qemu_leon3 with the minimal C library.

For all other platforms, using the pthread_barrierattr_t attr stack variable as a stack varialbe is perfectly fine and business as usual. However, I've needed to make this variable static just on this platform to workaround the issue.

  • What target platform are you using? qemu_leon3

  • What have you tried to diagnose or workaround this issue?

    • I've tried all other platforms and none have this problem
    • tried stepping with CONFIG_NO_OPTIMIZATIONS=y and CONFIG_DEBUG_OPTIMIZATIONS=y
      • problem cannot be reproduced
    • tried stepping with optimizations and I've had qemu crash
    • tried increasing stack sizes, with no success
    • Workaround was to make it static just for qemu_leon3

Regression

  • This is a regression.

Steps to reproduce

Check out the code in #97855 and remove the STATIC modifier of the pthread_barrierattr_t attr stack variable.

To get the fault in the log section below

twister -c -p qemu_leon3 -T tests/posix/barriers/

Relevant log output

*** Booting Zephyr OS build v4.2.0-7232-gcc8fa8e6b81d ***
Running TESTSUITE posix_barriers
===================================================================
START - test_barrier
E: 
E: tt = 0x07, mem_address_not_aligned
E: 
E:       INS        LOCALS     OUTS       GLOBALS
E:   0:  4000b4d3   40008308   00000000   00000000
E:   1:  00000000   40009d64   4000a978   40001450
E:   2:  00000001   00000000   4000a000   00000002
E:   3:  00000001   00000000   400082ec   00000007
E:   4:  4000a7f8   4000a800   00000000   00000001
E:   5:  400082ec   00000000   40008308   00001010
E:   6:  4000b470   40000060   4000b410   00000000
E:   7:  40001454   00000000   40003f60   00000000
E: 
E: psr: f30000c2   wim: 00000001   tbr: 40000070   y: 00000000
E:  pc: 40003634   npc: 40003664
E: 
E:       pc         sp
E:  #0   40003634   4000b410
E:  #1   40001454   4000b470
E:  #2   400038cc   4000b4d8
E:  #3   40001b94   4000b538
E:  #4   40002f50   4000b598
E: 
E: >>> ZEPHYR FATAL ERROR 0: CPU exception on CPU 0
E: Current thread: 0x4000a3f0 (test_barrier)
E: Halting system

Impact

Annoyance – Minor irritation; no significant impact on usability or functionality.

Environment

Additional Context

Discovered while working on #97855

Metadata

Metadata

Assignees

Labels

area: POSIXPOSIX API Libraryarea: QEMUQEMU EmulationbugThe issue is a bug, or the PR is fixing a bugpriority: lowLow impact/importance bug

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions