Return-Path: william@bourbon.usc.edu
Delivery-Date: Sun Apr 22 19:52:17 2007
X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on merlot.usc.edu
X-Spam-Level: 
X-Spam-Status: No, score=-3.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,
	NO_REAL_NAME autolearn=ham version=3.1.3
Received: from bourbon.usc.edu (bourbon.usc.edu [128.125.9.75])
	by merlot.usc.edu (8.13.5/8.13.5) with ESMTP id l3N2qHrS022329
	for <cs551@merlot.usc.edu>; Sun, 22 Apr 2007 19:52:17 -0700
Received: from bourbon.usc.edu (localhost.localdomain [127.0.0.1])
	by bourbon.usc.edu (8.13.5/8.13.5) with ESMTP id l3N2q1Wo008992
	for <cs551@merlot>; Sun, 22 Apr 2007 19:52:01 -0700
Message-Id: <200704230252.l3N2q1Wo008992@bourbon.usc.edu>
To: cs551@merlot.usc.edu
Subject: Re: Really Weird Behavior 
Date: Sun, 22 Apr 2007 19:52:01 -0700
From: william@bourbon.usc.edu

Someone wrote:

  >   For the last 2-3 hours I was trying to fix a very weird bug where the
  > metafiles and datafiles that I transfer to other nodes would be sometimes
  > totally corrupted (with truly weird outputs such as other people's names**
  > and the word "borbon" in it) -OR- only having some difference in the last
  > line...
  > 
  >   And finally, I changed how I allocate my buffer that holds the metafile
  > and datafile from 1. to 2. like this:
  > 
  >     1. char* msg_buf = (char*)malloc(msg_buf_sz);
  >     2. char msg_buf[msg_buf_sz];
  > 
  >   and then, automagically everything started working flawlessly. What gives?
  > 
  >   So now my question is, what is the difference between those 2 lines and
  > what exactly happened when I was using line 1?
  > 
  > ** - so then of course I check who's on nunki with "top" but the person's
  > name didn't match anyone online... :|

Hmm...  I didn't even know that (2) above is allowed!

Sounded to me like you have an uninitialized memory bug and
you are picking up random data on the stack.  Another
possibility is that it's a memory corruption bug and you are
picking up data from somewhere else.

It should have nothing to do with other people on the system
since your virtual memory space is separate from others'
(unless you are using shsared memory, which I assume you are
not).
--
Bill Cheng // bill.cheng@usc.edu <URL:http://merlot.usc.edu/william/usc/>
