Discussion:
Sort Problem
(too old to reply)
Evgeny
2011-07-22 03:48:08 UTC
Permalink
Hi,

We are having issues with sort test. When run, it simply outputs
"Operation Took xxx seconds", we're sure it doesn't do any sorting.
After some investigation into sort user-level code, we found out that by
removing the srandom() and random() functions cause the sort program to
quit. After we commented out those lines and replaced them with
non-random values (i.e. setting each array index to i), the application
works correctly.

Could you please let me know what might cause this? Does srandom() or
random() use some special features? Could you recommend a strategy to
resolve this?

Thank you.
cs350
2011-07-22 06:51:09 UTC
Permalink
random comes from stdlib, so it might be in a different page of the code
segment.

-Alex
Hi,
We are having issues with sort test. When run, it simply outputs "Operation
Took xxx seconds", we're sure it doesn't do any sorting. After some
investigation into sort user-level code, we found out that by removing the
srandom() and random() functions cause the sort program to quit. After we
commented out those lines and replaced them with non-random values (i.e.
setting each array index to i), the application works correctly.
Could you please let me know what might cause this? Does srandom() or
random() use some special features? Could you recommend a strategy to resolve
this?
Thank you.
Ben Langmuir
2011-07-22 13:32:11 UTC
Permalink
I had the same problem, and in my case I was loading pages incorrectly
if the ELF-segment wasn't page-aligned.

Ben
Post by cs350
random comes from stdlib, so it might be in a different page of the code
segment.
-Alex
Post by Evgeny
Hi,
We are having issues with sort test. When run, it simply outputs
"Operation Took xxx seconds", we're sure it doesn't do any sorting.
After some investigation into sort user-level code, we found out that
by removing the srandom() and random() functions cause the sort
program to quit. After we commented out those lines and replaced them
with non-random values (i.e. setting each array index to i), the
application works correctly.
Could you please let me know what might cause this? Does srandom() or
random() use some special features? Could you recommend a strategy to
resolve this?
Thank you.
Paolo P
2011-07-23 21:44:42 UTC
Permalink
In our case srandom() and random() causes a 0x0 faultaddress in the
vm_fault and we dont know how to resolve it other than replacing it with
something. We already did some alignment with the actual segments but
still got this result

Loading...