qemu-riscv.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alexander Pinheiro Paschoaletto via <qemu-riscv@nongnu.org>
To: "qemu-riscv@nongnu.org" <qemu-riscv@nongnu.org>
Subject: Weird behavior on RISC-V code running on QEMU
Date: Tue, 12 Mar 2024 22:06:08 +0000	[thread overview]
Message-ID: <VI1PR0402MB3613CDF1B2054516974813D6F82B2@VI1PR0402MB3613.eurprd04.prod.outlook.com> (raw)


[-- Attachment #1.1: Type: text/plain, Size: 2095 bytes --]

Hello everyone, hope you are all doing great!

This is my first email within this group and frankly I'm not sure if it's the right place to ask for help or report a bug, so please feel free to warn me in case I should post this elsewhere. I am currently facing some weird problems on a RISC-V project meant to run on the QEMU environment and thought that maybe someone here could give me a light on the subject.

I am trying to run a project built on top of one of FreeRTOS' official demo ports that target the 'virt' QEMU board. I ran across a few weird behaviors where code execution would just hang at some point (QEMU would keep execution but the expected terminal output would never come up). I don't have sufficient knowledge to tell whether the issue is with the FreeRTOS port, the RISC-V gnu toolchain or QEMU itself, hence why I am raising my hand for help on all related channels.

This repository<https://bitbucket.org/softcps-investigacao-risc-v/freertos-riscv-bugs/src/master/> contains more details and a sample project that illustrates well one of the problems I've been getting lately (I also give more context about it here<https://github.com/riscv-collab/riscv-gnu-toolchain/issues/1434>). It basically goes like this: the program executes fine when a certain code snippet is encapsulated within a function, but "crashes" (i.e. hangs) when the same snippet is placed directly in the main code:

[cid:920e1007-d3ca-41b9-bda9-bf6242805c01]

The scope shouldn't matter at all here, since there is no local variable being used or anything like that. I have tested things like removing compiling optimization (i.e. changing -Os for -O0) and using regular malloc() instead of FreeRTOS' dynamic allocation API, but all without success.  Note that even though the project is build on top of the FreeRTOS demo port, no RTOS functionality is used within this code to make it as simple as it gets.

And that's basically it. If any of you have a wild guess on the likely cause or something, please let me know.
Thanks in advance.

Best regards,
Alexander Paschoaletto



[-- Attachment #1.2: Type: text/html, Size: 3943 bytes --]

[-- Attachment #2: image.png --]
[-- Type: image/png, Size: 69942 bytes --]

             reply	other threads:[~2024-03-12 22:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-12 22:06 Alexander Pinheiro Paschoaletto via [this message]
2024-03-13  9:24 ` Weird behavior on RISC-V code running on QEMU Daniel Henrique Barboza

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=VI1PR0402MB3613CDF1B2054516974813D6F82B2@VI1PR0402MB3613.eurprd04.prod.outlook.com \
    --to=qemu-riscv@nongnu.org \
    --cc=alexp@isep.ipp.pt \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).