Berkeley CSUA MOTD:Entry 16139
Berkeley CSUA MOTD
 
WIKI | FAQ | Tech FAQ
http://csua.com/feed/
2025/05/25 [General] UID:1000 Activity:popular
5/25    

1999/7/15-16 [Computer/SW/Languages/C_Cplusplus, Computer/SW/OS/Solaris] UID:16139 Activity:high 52%like:16095
7/15    Does anyone know of some good freely available tools
        for finding memory leaks and memory errors in c/c++?
        I have "Electric Fence" but it leaves a lot to be desired.
        \_ purity (freeP)
        \_ purify (not free, but excellent)
           \_ Unfortunately, purify is worthless for interactive
              applications (e.g. games), and nearly useless for
              apps that already take a lot of CPU time before you
              instrument them.  The old sparc purify wasn't too slow
              but it just got worse and worse as time wore on.  -blojo
        \_ there are a bunch of different tools for this.  do a web search.
           i've used some malloc replacement libraries such as dmalloc.
           also, depending which compiler/OS you're using you may get some
           analysis tools already.  Solaris dbx and AIX heapview exist,
           i dunno about other platforms --oj
                \_ See also "watchmalloc" on Solaris.
        \_ Good coding practice.
        \_ boehm gc
           \_ i just wrote a freebsd port for this. i'll be submitting it
              but contact me if you want it. --aaron
2025/05/25 [General] UID:1000 Activity:popular
5/25    

You may also be interested in these entries...
2014/1/14-2/5 [Computer/SW/Languages/C_Cplusplus] UID:54763 Activity:nil
1/14    Why is NULL defined to be "0" in C++ instead of "((void *) 0)" like in
        C?  I have some overloaded functtions where one takes an integer
        parameter and the other a pointer parameter.  When I call it with
        "NULL", the compiler matches it with the integer version instead of
        the pointer version which is a problem.  Other funny effect is that
        sizeof(NULL) is different from sizeof(myPtr).  Thanks.
	...
2011/3/7-4/20 [Computer/SW/Languages/C_Cplusplus] UID:54056 Activity:nil
3/7     I have a C question.  I have the following source code in two identical
        files t.c and t.cpp:
                #include <stdlib.h>
                int main(int argc, char *argv[]) {
                  const char * const * p1;
                  const char * * p2;
	...
2009/7/21-24 [Computer/SW/Languages/Java] UID:53168 Activity:moderate
7/20    For those who care btw, it looks like eclipse is now A Standard Tool
        at UCB ugrad cs, probably replaced emacs.  Furthermore, people get
        angry at seeing Makefiles, (since eclispe takes care of that).  I
        guess it's just a sign of the times.
        \_ The more people at my work use eclipse the less the code is
           managable in emacs.  I'm not sure which application's fault
	...
2007/3/9-11 [Computer/SW/Languages/C_Cplusplus] UID:45917 Activity:nil 54%like:45865
3/9     When I start trn in a shell, I always get this:
        "*** glibc detected *** malloc(): memory corruption: 0x08091600 ***
        Abort"
        But when I run trn inside the shell buffer in emacs, the problem
        doesn't happen.  Any idea?  Thanks.
	...
2007/3/4-6 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Mail, Computer/HW/Memory] UID:45865 Activity:nil 54%like:45917
3/4     trn crashes on me upon startup:
        "*** glibc detected *** malloc(): memory corruption: 0x08091618 ***
        Abort"
        Any idea?  Thanks.
	...
2006/1/25-27 [Computer/HW/Memory] UID:41522 Activity:nil
1/25    I'm working on a program in windows which is having memory problems.
        When I allocate memory with new or malloc, it seems to reserve more
        memory than I request (using VM Valiator to monitor this).  Even if I
        delete the memory there is still a "reserved" chunk that doesn't seem
        to ever get used by other code.  I'm using VC++ 6 btw.  Anyone have an
        idea of what might be going on?
	...
2005/9/9-13 [Computer/SW/OS/OsX] UID:39595 Activity:low
9/9     Does OSX gcc still not support weak symbol definitions?  ie, I
        can't redefine malloc or new? (In this case actually I'm defining
        something as weak, either with #pragma weak or
        __attribute__((weak)) but OSX doesn't seem to support either!)
        -jrleek
        \- hello, have you tried __attribute__((weak_import)). what gcc
	...
2005/6/24-27 [Computer/SW/SpamAssassin] UID:38285 Activity:nil
6/24    In my procmail log file, it says:
                csh in malloc(): warning: recursive call
                Out of memory.
        What is the meaning of this?
        \_ helps if you show us your .procmailrc
          \_ It's hundreds of lines long.  I was thinking it was
	...
2005/6/23-25 [Computer/SW/Languages/C_Cplusplus] UID:38255 Activity:low
6/22    Technical question:  My friend is trying to program a
        single-threaded signal based server.  He's using the icc compiler
        on 64-bit linux.  However, the following problem comes up.  The
        server is working and calls malloc.  Malloc grabs the allocation
        mutex (thread-safe!), then a signal comes in.  The signal
        interrupts malloc and calls the handler function.  The handler
	...
2005/2/15-16 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Compilers] UID:36174 Activity:moderate
2/15    Technical question:  we have a memory leak in our C code, we think,
        but it's not the sort of memory leak where the memory's unreferenced.
        What we'd like to do is sort of a poor-man's profile, we want
        to know who calls our memory allocator "New"...  Sorta like a stack
        trace.  Using an actual profiler is sort of difficult 'cause it's
        a parallel application.  Thanks,  --peterm
	...
2005/1/24-26 [Computer/SW/Unix] UID:35874 Activity:low
1/24    How do I find out the maximum allowable process size on lesbians?
        \_ malloc
           \_ uh, how about finding out without getting squished?
        \_ Run "limit".
[ deleting bitch ]
           \_ limit is a csh thing.
	...
2004/12/8-9 [Computer/SW/Languages/C_Cplusplus, Computer/SW/Languages] UID:35217 Activity:kinda low
12/8    When people say null string or empty string in C, does it mean a char
        pointer that's NULL, or a char array whose first char is '\0'?  Thanks.
        \_ Both, because it's essentially the same. However, I think they
           probably mean the latter. I assume you mean a pointer pointing
           to NULL, and not a pointer which is NULL, which makes no real
           sense.
	...
2010/2/8-18 [Computer/SW/Apps/Media, Computer/SW/Apps] UID:53695 Activity:kinda low
2/5     I like Adobe Flash. When written correctly, it scales along
        with your browser size. It looks consistent on every single
        browser. It is predictable. On the other hand, I'm not a big
        fan of CSS/HTML, which for the most part, look wildly different
        between browsers, and don't even work consistently or
        correctly at times. So why do so many people (like Steve Jobs)
	...
2009/10/27-11/3 [Computer/SW/Unix] UID:53475 Activity:nil
10/27   http://www.maxgames.com/play/flash-mind-reader.html
        how does this work?
        \_ sh -c 'for ((i=0;i<10;i++)); do for ((j=0;j<10;j++)); do echo "$i$j-(\
$i+$j)" | bc; done ; done' | uniq
        \_ bash -c 'for ((i=0;i<10;i++)); do for ((j=0;j<10;j++)); do echo "$i$j\
-($i+$j)" | bc; done ; done' | uniq
	...
2009/4/20-23 [Computer/SW/Database] UID:52876 Activity:nil
4/19    ORCL u SUNW = ORCL.
        What is Larry Ellison thinking? What is he going to do with a bunch of
        legacy Sun hardware that no one uses anymore, its fading workstation
        customer base, and open source Sun MySQL that doesn't even generate
        revenue? I really don't get all this acquisition business.
        \_ A lot of big companies still use big, fat Sun hardware. Or use
	...
2009/1/15-23 [Computer/SW/OS/OsX] UID:52398 Activity:nil
1/15    can any serious development be done on OSX that is not *for OSX*.
        i'll grant that ruby on rails has excellent tutorials for the mac.
        discuss:
        \_ What kind of serious development?  If you want to use the standard
           OSX ui then your ui code will be pretty much useless elsewhere,
           but that's why concepts like MVC are so important.  Otherwise
	...
2008/11/29-12/6 [Computer/SW/OS/FreeBSD, Computer/SW/OS/VM] UID:52129 Activity:moderate
11/29   I'm experimenting with virtualization, and as a poor college student
        I'm wondering what the best alternatives for virtualization are, and
        how best to cut my teeth on messing with non-linux platforms (or I
        guess interesting stuff on Linux would work too). Right now I've got
        FreeBSD7 running on KVM on my home computer (on a Core 2 Quad), and am
        somewhat at a loss as to how to use it. (More details: bridged
	...
2008/11/14-26 [Computer/SW/Languages/Java, Computer/SW/OS/Solaris] UID:51970 Activity:moderate
11/13   http://sfgate.com/cgi-bin/article.cgi?f=/n/a/2008/11/14/financial/f051352S72.DTL
        http://preview.tinyurl.com/6nngpm
        Sun Microsystems Inc. plans to cut up to 6,000 jobs, or 18 percent of
        its global work force, as sales of its high-end computer servers have
        collapsed.  The drastic move announced Friday highlights Sun's
        desperation to cut costs and survive as an independent company. Sun's
	...
2008/11/14-26 [Computer/SW/OS/Linux, Computer/SW/OS/Solaris] UID:51989 Activity:moderate
11/14   lulz why doesn't GOOG buy JAVA i mean SUN i mean whatever the hell they
        are these days.
        \_ Even GOOG isn't THAT stupid
           \_ Sorry, but WHY would Google do something like that? They
              run 99.2% Linux servers on the backend. They don't use
              Solaris for development. I mean, what does Sun have to
	...
2008/9/24-29 [Computer/SW/OS/Windows, Computer/SW/OS/Solaris] UID:51283 Activity:nil
9/24    Why is nscd going crazy?  DoS?
        \- back in the solaris say 2.5-2.6 era, it had both some bugs
           (some malformed nis maps made it go crazy) and architectural
           flaws in the IPC/door+threading mechanism. if you are running
           OS-recent, dunno, but you can trace it.
           \_ Yeah, I think it's just buggy.  I've restarted it, and it seems
	...
2008/4/3-9 [Computer/SW/Languages/Misc, Computer/SW/OS/Solaris] UID:49658 Activity:nil
4/3     Solaris experts: I've never played with ZFS. Does it have a native
        dump command a la ufsdump?
        \_ This might be what you are looking for:
           http://preview.tinyurl.com/2xqkda [sun - bigadmin]
	...
2008/3/30-4/6 [Computer/SW/OS/Solaris] UID:49614 Activity:nil
3/30    Question: I just deleted 60 GB of files from an 80 GB disk. The
        disk activity lights were blinking like crazy and I could hear the
        drive crunch while the data was deleted. This is under Solaris.
        Anyway, I think UNIX uses unlink() when files are deleted. Shouldn't
        it just update the free list on the superblock and call it a day?
        What is all the crunching about?
	...
2007/11/27-30 [Computer/SW/Languages/C_Cplusplus, Computer/SW/OS/Solaris] UID:48701 Activity:high
11/27   I'm using select to do a nonblocking check to see if a single socket
        has anything to read off it.  Problem is, I can have up to 12228
        file descriptors, and Linux fd_set only supports up to 4096.  Any idea
        what I can do about this?  (Or a better solution?) -jrleek
        \- 1. who are you
           2. i am busy this week and you didnt mention language
	...