[ee122] malloc segfaults? out of memory?

abhishekd at berkeley.edu abhishekd at berkeley.edu
Wed Sep 26 19:56:03 PDT 2007


On running my client on c199.eecs.berkeley.edu i am intermittently getting
segfaults after returning server information to the cliet and then having
the client malloc space to get input from stdin again. i am not having
this error on servers such as ilinux3.eecs (where i could valgrind and see
if there is a misplaced free causing intermittent segfaults on other
mallocs...) or even sphere.cs at this point. an example of what i am doing
is provided below.


Client:
> http://www.aol.com

**server returns stuff

>http://www.google.com

**server returns stuff

>http://www.yahoo.com

**server returns stuff
SEGFAULT!

a bt of the segfault shows the fault occuring on this line:
char* userInput = (char*) malloc(sizeof(char)*maxInputSize);


My question is could malloc be screwing up due to lots of people using
c199 and potentially not freeing their memory after use? If its something
with my code why do i not have this problem on ilinux3 or sphere.cs ...?



More information about the ee122 mailing list