Re: Xilinx's microblaze hangs when a timer interrupt occurs after a "rand()" instruction.



Hi,

We think we have found the problem.
Newlib(libc) functions which is reentrant uses the heap.
Your design didn't have any heap allocated at all so when these function
calls malloc it will grab memory which holds the interrupt vector.
These addresses will be overwritten and the program gets corrupted.

A very small heap size will fix the issue.

Göran

"Göran Bilski" <goran.bilski@xxxxxxxxxx> wrote in message
news:fqivp6$d371@xxxxxxxxxxxxxxxxxxxxx
Hi Rémy,

Can you provide me with the MicroBlaze configuration settings (or the
whole .mhs file)?
It looks like you get a hardware exception but you don't have a exception
handler.
What hardware exceptions have you enabled on MicroBlaze?

Göran

"Rémy" <thomasrt2008@xxxxxxxxx> wrote in message
news:f6cbd175-5bc5-4a9a-9b64-5e8a1b386299@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Hi,

I just try the patch http://www.xilinx.com/support/answers/30051.htm
and the bug steal occurs if I have a "rand" or "srand" function in my
code.
When i stop the CPU under XMD it returns me the same adress:
0x820036a4

if i do "mb-objdump -x -D -S -t executable.elf > dump.out" to output a
dump file of my *.elf to see what there is at this address:

.section .text
.align 2
.ent _hw_exception_handler
_hw_exception_handler:
bri 0;
820036a4: b8000000 bri 0 // 820036a4

so apparently the code is crashed because of an exeption like the
problem in "Answer Record #29784 (http://www.xilinx.com/support/
answers/
29784.htm". Although i work on the last version of tools with the SP2
and the last patch....

I have tried my code on a PowerPC architecture with the same IP on the
same Hardware and I don't have the bug.

Rémy



.



Relevant Pages

  • Re: Heap dump file size vs heap size
    ... Do you know how heap dump file size is related to heap size itself? ... I've multiple heap dumps created using jmap on Solaris using Sun JVM ... NOT be related to heap dump file size (and do not forget that there is ...
    (comp.lang.java.programmer)
  • Re: java heap dump file gets too big
    ... Yea i thought the heap dump size would be related to the heap itself ... Is there a way to limit the size of the dump file? ...
    (comp.lang.java.programmer)