Language:
switch to room list switch to menu My folders
Go to page: [1] 2 3 4 5 ... Last
↑↑↑ Old messages ↑↑↑            ↓↓↓ New messages ↓↓↓
[#] Mon Dec 01 2003 11:55:49 EST from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]


Then it isn't that.

[#] Mon Dec 01 2003 13:40:28 EST from Animal @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

That's how I was taught C and C++, using cout << and cin >>. We were still taught printf(); but cin and cout seem to be more natural.

[#] Mon Dec 01 2003 13:54:26 EST from Peter Pulse @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

cout/cin is C++, not C.

[#] Tue Dec 02 2003 12:51:48 EST from Hue Jr. @ Anansi-Del

[Reply] [ReplyQuoted] [Headers] [Print]


Testing's not complete, but no more mystery crashes. Something in libc.a is evil, apparently.

[#] Tue Dec 02 2003 15:20:22 EST from Tony Preston @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

I never like C++ i/o, I can format much easier with %0.8ld than I can with 4 or 5 function calls in C++

[#] Wed Dec 03 2003 06:28:04 EST from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]


Hrm.. perhaps a jaunt through their source code and a bug report is in order?

[#] Wed Dec 03 2003 12:52:09 EST from Hue Jr. @ Anansi-Del

[Reply] [ReplyQuoted] [Headers] [Print]


I'll take a pass on that, fleeb. I try to restrict my recreational programming.

[#] Wed Dec 03 2003 16:10:25 EST from fleeb @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]


*grin*

[#] Sat Dec 06 2003 18:51:14 EST from Ford II @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

char *x = malloc(8);
free(x);

Does is die in the malloc or free?
Make sure x is real. if it's dying in free then x isn't something you got from malloc or something (maybe your fprintf) is kaboshing your arena or freelist.
also can't hurt to use my favorite toy:

[#] Sat Dec 06 2003 18:51:27 EST from Ford II @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

char *getmem (long m)
{
/* must zero out data */
char *z;
char *zf;
z = new char [m+8]; /* make room for size and "STU." */
zf = z + m+6;
memleak++;
*(z+4) = '\0';
memcpy (z, &m, 4); /* copy the long in */
memcpy (z+m+4, "Stu.", 4); /* my over run check bytes */
return z + 4;
}

void freemem (char *m)
{
/* check to see if we overran */
long sz;
memcpy (&sz, m-4, 4); /* get long back */
delete [] (m - 4); // nobody tells me these things
memleak--;
}

you can get new and delete to malloc and free.

[#] Sat Dec 06 2003 18:52:24 EST from IO ERROR @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

#define free(x) if ((x) free((x))

[#] Sat Dec 06 2003 18:53:06 EST from IO ERROR @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

Let's try that again.

#define free(x) if ((x)) free((x))

[#] Sat Dec 06 2003 18:53:21 EST from Ford II @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

oh, guess I'm a bit late.

[#] Sat Dec 06 2003 22:11:27 EST from IGnatius T Foobar @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

Hey Ford, have you ever used Electric Fence? That bit with the "overrun check bytes" reminded me of it. You just link efence into your program, and every block of data you allocate with malloc() is wrapped inside protected areas.
If you go outside the valid bounds of your block, you hit the protected area and the program throws an exception right then and there, rather than waiting for a side effect to crash the program.

[#] Sun Dec 07 2003 14:39:05 EST from IO ERROR @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

ElectricFence is your god. You can debug a program in hours instead of weeks.

[#] Tue Dec 09 2003 14:03:43 EST from cough @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

I'm also rather fond of checkergcc. It detects overruns, memory leaks, and also tells you if you read memory that hasn't been written to yet (using uninitialized values). Good stuff.

[#] Wed Dec 10 2003 12:44:39 EST from Hue Jr. @ Anansi-Del

[Reply] [ReplyQuoted] [Headers] [Print]


I feel bound to point out that ElectricFence didn't help me at all.

[#] Wed Dec 10 2003 17:24:42 EST from Ford II @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

yeah, it won't catch everything, but it was just a thought.
I don't know when electric fence was introduced, but I was using these function years before I started using the internet to ever hear about it, so I just keep using it because it works.
It only checks on free, so it's cheap.

[#] Fri Jan 02 2004 14:55:46 EST from IGnatius T Foobar @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

It's been suggested that the "leaders" who disbanded were just a bunch of do-nothings who were just holding the project back.

Rather than "experiement with anarchy" they ought to just let Keith Packard and Jim Gettys run the show.

[#] Fri Jan 02 2004 17:43:49 EST from Ford II @ Uncensored

[Reply] [ReplyQuoted] [Headers] [Print]

is there any recent advancement in xf86? I noticed a while ago it went from 3 to 4.
is anybody still doing anything?

Go to page: [1] 2 3 4 5 ... Last