Assignment 3 main.s (Attempting to access uninitialized memory between the stack and heap.)

284 views
Skip to first unread message

David

unread,
Oct 26, 2020, 3:48:56 AM10/26/20
to cmpt-295-sfu
SFU ID:  david_d...@sfu.ca
Github username: Dulatech
Line and file: Unknown line, main.s
Expected behavior: main.s running successfully 
Observed behavior: Outputs: Attempting to access uninitialized memory between the stack and heap. Attempting to access '4' bytes at address '268470508'.
Question: My main.s is returning this error. I am not sure what I am doing wrong.

ali sedaghati

unread,
Oct 26, 2020, 1:29:02 PM10/26/20
to cmpt-295-sfu
Please leave some comments on your code and put a screenshot of the error and command here.

David

unread,
Oct 26, 2020, 1:52:46 PM10/26/20
to cmpt-295-sfu
I have added comments. The error seems to be occurring after my first matmul in main.s. 
Here is the screenshot of the command and console:

ali sedaghati

unread,
Oct 26, 2020, 3:01:21 PM10/26/20
to cmpt-295-sfu
There are some problems with your code:
1. In line 123 of main.s you're using a1. But in your matmul.s you didn't follow the calling convention and you have changed the a1 value. So if you print s2, after line 123, it shows a wrong value. 
2. After fixing the first problem, double-check that you're not reaching out-of-bound elements in your relu.s.

Basically, inserting some int_print in your code would be helpful for finding the bugs of the code. I have inserted one after calling "matmul" and one inside relu.s, and the first one helped me to find out that s2 has a wrong value.

David

unread,
Oct 26, 2020, 4:21:25 PM10/26/20
to cmpt-295-sfu
Thank you so much! I now see where I went wrong. I really appreciate the help, it solved the issue no problem. Have a good one!
Reply all
Reply to author
Forward
0 new messages