[gem5-users] Re: Custom SimObject Causes Host Machine to Freeze

2021-07-07 Thread Gabriel Busnot via gem5-users
Hi Thomas,

In addition to Jason's advises, I would like to add that if a simulation 
crashes your whole system, it is likely that you are running out of physical 
memory. Unless you are using unstable drivers on your host, which I believe you 
don't, the easiest way to unintentionally crash a system probably is to put a 
memory allocation in a hot loop and forget to free the memory.

You can also consider setting up a VM with a limited amount of memory and no 
swap to sandbox your simulation. You can snapshot that VM right before running 
your debug run to faster recover from crashes.

best,
Gabriel
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s


[gem5-users] Re: Custom SimObject Causes Host Machine to Freeze

2021-07-06 Thread Jason Lowe-Power via gem5-users
Hi Sam,

My suggestion would be to use gdb. You can run gem5 in gdb and then use
ctrl-c to stop the execution and see where the program is getting stuck.
Also, enabling debug flags (or just good ole printf debugging) can also be
useful in these cases.

Another option with gdb would be to put breakpoints on each of the
functions in your object (e.g., the constructor) and then step through to
see what's happening.

A final thought... does your object enqueue any events? If so, are the
enqueued *in the future*? If you enqueue an event at the current tick
(curTick()) and then that event enqueues an event at the current tick you
can get stuck in an infinite loop. (The Event debug flag could be useful
here, too.)

Cheers,
Jason

On Tue, Jul 6, 2021 at 8:56 AM Thomas, Samuel via gem5-users <
gem5-users@gem5.org> wrote:

> Hi all,
>
> I'm writing because I'm working with a custom SimObject that I wrote that
> seems to crash my host machine. I know it's this particular SimObject
> because the script works as expected when run without the object, but it
> makes debugging an excruciatingly difficult process.
>
> Is this an issue that anyone has seen before? And if so, does anyone have
> any hints as to what might be causing the host to crash?
>
> Thank you for your help!
>
> Best,
> Sam
> ___
> gem5-users mailing list -- gem5-users@gem5.org
> To unsubscribe send an email to gem5-users-le...@gem5.org
> %(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s
___
gem5-users mailing list -- gem5-users@gem5.org
To unsubscribe send an email to gem5-users-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s