<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sun, Mar 22, 2020, 8:43 AM Gedare Bloom <<a href="mailto:gedare@rtems.org">gedare@rtems.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Sun, Mar 22, 2020 at 1:40 AM Niteesh G. S. <<a href="mailto:niteesh.gs@gmail.com" target="_blank" rel="noreferrer">niteesh.gs@gmail.com</a>> wrote:<br>
><br>
> I built mips jmr3904. I was able to run rtems-run and rtems-test on it.<br>
> But cdtest.exe fails.<br>
> *** TESTING C++ EXCEPTIONS ***<br>
> mips-core: 1 byte read to unmapped address 0x2ed31 at 0x880290a4<br>
> Program received signal SIGBUS, Bus error.<br>
> 0x88028fe4 in strlen ()<br>
> What is causing this error?<br>
This shows that the strlen function is accessing a bad address<br>
(0x2ed31). In fact, this is part of the value of the jmr3904 simulator<br>
and why we want to get it working for routine testing, because it can<br>
catch bad memory errors.<br>
<br>
> I tried running this manually on GDB. On forcefully continuing.<br>
The next step is not to forcefully continue, but to work backwards<br>
from the failure in GDB. print a stack backtrace ('bt' command) to see<br>
how it got to strlen. Look at the values of the registers you can<br>
observe. Compare with the code in the example and trace the example<br>
code forward along the path shown by the backtrace. Use GDB to<br>
investigate the stack frames ('up' and 'down' commands).<br>
<br>
> Warning, resuming with mismatched exception signal (7 vs 10)<br>
After an unmapped address access, nothing else that executes is going<br>
to be valid.<br>
<br>
> Unhandled exception 7<br>
> sr: 0x536936196 cause: 0x00029724 --> Data Bus Error<br>
><br>
> *** FATAL ***<br>
> fatal source: 1 (INTERNAL_ERROR_RTEMS_API)<br>
> fatal code: 9800724312699699200 (0x100000000)<br>
> RTEMS version: 5.0.0.37e7cc5f4ce7ed46b5ea2de56d9066d121d851cb-modified<br>
> RTEMS tools: 7.5.0 20191114 (RTEMS 5, RSB 5 (0b7e87143b76), Newlib fbaa096)<br>
> executing thread ID: 0x08a010001<br>
> executing thread name: CTOR<br>
><br>
> Is this problem with the BSP or simulator? And how can I fix this?<br>
<br>
Most likely it is a problem with newlib.<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">Random guess. A section, stack, or malloced memory is not properly aligned.</div><div dir="auto"><br></div><div dir="auto">--joel</div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
><br>
> On Sat, Mar 21, 2020 at 11:33 PM Joel Sherrill <<a href="mailto:joel@rtems.org" target="_blank" rel="noreferrer">joel@rtems.org</a>> wrote:<br>
>><br>
>><br>
>><br>
>> On Sat, Mar 21, 2020 at 10:38 AM Niteesh G. S. <<a href="mailto:niteesh.gs@gmail.com" target="_blank" rel="noreferrer">niteesh.gs@gmail.com</a>> wrote:<br>
>>><br>
>>> Which architecture should I try then? Maybe powerpc or mips? If you have any<br>
>>> of them already built can you please try them out? Building everything from<br>
>>> source takes a lot of time in my dev machine.<br>
>>><br>
>>> On Sat, Mar 21, 2020 at 6:41 PM Gedare Bloom <<a href="mailto:gedare@rtems.org" target="_blank" rel="noreferrer">gedare@rtems.org</a>> wrote:<br>
>>>><br>
>>>> On Sat, Mar 21, 2020 at 12:54 AM Niteesh G. S. <<a href="mailto:niteesh.gs@gmail.com" target="_blank" rel="noreferrer">niteesh.gs@gmail.com</a>> wrote:<br>
>>>> ><br>
>>>> > On Thu, Mar 19, 2020 at 11:43 PM Gedare Bloom <<a href="mailto:gedare@rtems.org" target="_blank" rel="noreferrer">gedare@rtems.org</a>> wrote:<br>
>>>> >><br>
>>>> >> On Thu, Mar 19, 2020 at 11:56 AM Niteesh G. S. <<a href="mailto:niteesh.gs@gmail.com" target="_blank" rel="noreferrer">niteesh.gs@gmail.com</a>> wrote:<br>
>>>> >> ><br>
>>>> >> > Hello,<br>
>>>> >> ><br>
>>>> >> > While looking for small tasks to take up, Gedare mentioned about adding GDB BSPs<br>
>>>> >> > to rtems-tester. Can some please explain a bit more of what has to be done? I guess<br>
>>>> >> > we have to write configuration files for BSPs that support simulation in GDB. If so, how<br>
>>>> >> > could I find those BSPs, do I have to individually look at all the BSPs?<br>
>>>> >> ><br>
>>>> >> As I said off-list, I don't know if there's a list of GDB BSPs, but I<br>
>>>> >> know of at least:<br>
>>>> >> powerpc/psim<br>
>>>> >> mips/jmr3904<br>
>>>> >> moxie/moxiesim<br>
>>>> >> arm/gdbarmsim<br>
>>>> >> sh/shsim<br>
>>>> >><br>
>>>> >> I have no idea what any of their statuses are or if they are expected<br>
>>>> >> to work. The first step would be building them and see if they run<br>
>>>> >> anything. After that, you should look at the existing tester scripts for<br>
>>>> >> some targets:<br>
>>>> >> rtems-tools.git/tester/rtems/testing/bsps<br>
>>>> >> I see scripts for most of what I listed above, so the next step would<br>
>>>> >> be trying to run them via tester and see if it works.<br>
>>>> ><br>
>>>> ><br>
>>>> > I built the simsh1 BSP but couldn't get it running. Before trying it with rtems-run<br>
>>>> > and rtems-test I tried manually loading it in the simulator. But gdb doesn't respond<br>
>>>> > as soon as I execute the run command. The only way to exit it was using ctrl-c and GDB<br>
>>>> > responds with<br>
>>>> > sim_events_schedule_after_signal - buffer overflow<br>
>>>> > Quit<br>
>>>> > Aborted (core dumped)<br>
>>>> > I tried setting breakpoints within GDB but it never seems to hit them. I tried running the<br>
>>>> > examples through rtems-test results in ta imeout.<br>
>>>> ><br>
>>>> > Due to the slow internet connection and slow development machine, I could only build<br>
>>>> > and test a few BSPs. In case if anyone has an already built tool suite and BSP for the<br>
>>>> > mentioned arch please try them out.<br>
>>>> ><br>
>>>> I don't know that anyone uses this architecture. Don't spend too much<br>
>>>> effort trying to debug the simulator :)<br>
>><br>
>><br>
>> mips jmr3904 and powerpc psim should work well.<br>
>><br>
>> I agree with Gedare, spending a lot of time on the SH isn't high payoff.<br>
>> I'm glad for the report but there could be bitrot in the simulator or BSP.<br>
>><br>
>>>><br>
>>>><br>
>>>> >> BTW: Did I mention adding these to tester, or did I mention creating<br>
>>>> >> build sets for them? Anyway, I think the GDB simulator builds by<br>
>>>> >> default with the toolchain, so there is no difference between a BSP<br>
>>>> >> buildset (such as for jmr3904) and one that supports running on GDB.<br>
>>>> >> At least, I think so. It is worth verifying.<br>
>>>> >><br>
>>>> >> Gedare<br>
>>>> >><br>
>>>> >> > Thank you,<br>
>>>> >> > Niteesh.<br>
>>>> >> > _______________________________________________<br>
>>>> >> > devel mailing list<br>
>>>> >> > <a href="mailto:devel@rtems.org" target="_blank" rel="noreferrer">devel@rtems.org</a><br>
>>>> >> > <a href="http://lists.rtems.org/mailman/listinfo/devel" rel="noreferrer noreferrer" target="_blank">http://lists.rtems.org/mailman/listinfo/devel</a><br>
</blockquote></div></div></div>