Hi Zehan,

The only two things that come to mind are: 1) valgrind, 2) full-system. At 
least with (2) you know that the results you get are actually reflecting the 
behaviour of a real OS.

Andreas

From: Zehan Cui via gem5-users <[email protected]<mailto:[email protected]>>
Reply-To: Zehan Cui <[email protected]<mailto:[email protected]>>, gem5 
users mailing list <[email protected]<mailto:[email protected]>>
Date: Tuesday, 23 December 2014 07:22
To: "[email protected]<mailto:[email protected]>" 
<[email protected]<mailto:[email protected]>>
Subject: [gem5-users] variables modified inexplicably when using m5threads

Hello,

I'm trying to use m5threads to compiler my program, but encounter several 
errors.

In brief, I found that some variables in the program are modified inexplicably.

Here are two symptoms when using m5threads to run on the host machine directly 
(not in gem5):

First, I ran 2 threads and the code had some printf(). Using gdb, I found that 
the last several elements of one array are modified by the printf() call. After 
realizing this, I allocate additional space for the array, e.g., twice the 
original array size, to set a safe margin for the array. It actually works.

Then, I ran 4 threads and found that one important thread-local variable, myid, 
was modifed. Gdb didn't help this time, and I didn't find who modify it.

I have been stuck by such problems for a week. Does anyone have similar 
experience or know possible reasons?

I'm using m5threads-dcec9ee72f99. The test program works fine. The program that 
I'm using is the graph500 reference code (breath-first search). The original 
code is written in openmp. I tried to directly compile the openmp code using 
m5threads, but didn't work. Then I change it into pthreads and encounter the 
problems mentioned before. (btw, using standard pthreads library works fine.)


Best regards,
Zehan

-- IMPORTANT NOTICE: The contents of this email and any attachments are 
confidential and may also be privileged. If you are not the intended recipient, 
please notify the sender immediately and do not disclose the contents to any 
other person, use it for any purpose, or store or copy the information in any 
medium. Thank you.

ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered 
in England & Wales, Company No: 2557590
ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, 
Registered in England & Wales, Company No: 2548782
_______________________________________________
gem5-users mailing list
[email protected]
http://m5sim.org/cgi-bin/mailman/listinfo/gem5-users

Reply via email to