Register - Login
Views: 99823075
Main - Memberlist - Active users - Calendar - Wiki - IRC Chat - Online users
Ranks - Rules/FAQ - Stats - Latest Posts - Color Chart - Smilies
05-03-22 07:27:08 PM
Jul - NO! GO TO STAR! - How to code in C++ New poll - New thread - Thread closed
Next newer thread | Next older thread
Rena
I had one (1) message in Discord deleted and proceeded to make a huge, huge mess about how it was a violation of free speech and how moderators are supposed to be spam janitors and nobody should have the right to tell me not to talk about school shootings
Level: 135


Posts: 639/5390
EXP: 29076945
For next: 258060

Since: 07-22-07

Pronouns: he/him/whatever
From: RSP Segment 6

Since last post: 342 days
Last activity: 342 days

Posted on 08-13-07 07:14:52 PM Link
JL2 - Post #639 - 08-13-07 02:14:52 PM
Day 22, rank 7; Level 24 (80.8%)
8409/10402 (76132/78125)
GPP: 178; GT: 50.421
1) Write some code.
2) Find a bug.
3) Add debug output to track down the bug.
4) Discover that adding output makes the problem not occur.
5) Remove the output code you added.
6) Discover that for some nonsensical reason, the problem still no longer occurs after restoring the code to the way it was before you added the output. The bug is still there, but no longer appears.
7) Smash head on keyboard.
8) Repeat a while later.



____________________
Raspberry
Thank you for my time here. I won't ever forget..
Level: 85


Posts: 92/1823
EXP: 5727166
For next: 171374

Since: 07-07-07

Pronouns: she/her

Since last post: 1.0 years
Last activity: 77 days

Posted on 08-20-07 08:37:12 PM Link
Heisenbugs ftl.
Rena
I had one (1) message in Discord deleted and proceeded to make a huge, huge mess about how it was a violation of free speech and how moderators are supposed to be spam janitors and nobody should have the right to tell me not to talk about school shootings
Level: 135


Posts: 724/5390
EXP: 29076945
For next: 258060

Since: 07-22-07

Pronouns: he/him/whatever
From: RSP Segment 6

Since last post: 342 days
Last activity: 342 days

Posted on 08-22-07 06:10:38 AM; last edit by HyperHacker on 08-22-07 07:22 AM Link
JL2 - Post #724 - 08-22-07 01:10:38 AM
Day 30, rank 7; Level 27 (40.4%)
5610/13884 (107885/116159)
GPP: 223; GT: 49.124
Know what else is fun? When a Windows API call fails but doesn't set the last error code so you might know why.

Also, interesting variation on the Heisenbug: You change something, but it doesn't appear to have any effect. However, once you make a second change and compile again, the first change starts taking effect too. It's as if you changed something, forgot to save, compiled, changed something else, saved, and compiled again, except I'm sure I saved both times, and the second change was in a different file anyway. And of course, the effect remains after undoing the second change.

My makefile probably needs tweaking. Those things are a PITA, and I don't mean Mexican food.

____________________
BlackNemesis13
1150
I am ***** but it's hard to pronounce, so you can call me Geno after the doll.
Level: 70


Posts: 9/1155
EXP: 2883957
For next: 131854

Since: 07-23-07

From: Columbus, Ohio

Since last post: 10.6 years
Last activity: 10.6 years

Posted on 08-24-07 09:11:10 PM Link
Wouldn't a pita be more like greek food?
Joe
Common spammer
🍬
Level: 111


Posts: 52/3392
EXP: 14501855
For next: 366505

Since: 08-02-07

From: Pororoca

Since last post: 12 days
Last activity: 14 min.

Posted on 08-25-07 06:31:06 PM Link
Actually, my dad buys it sometimes from the "Arabic store" so it would be Arabic food, not Greek.

____________________
Ninji

Birdo
Why did my user title say I'm a toaster anyway
Level: 88


Posts: 69/2014
EXP: 6638892
For next: 11772

Since: 07-26-07

Pronouns: he/him or they/them
From: Glasgow, Scotland

Since last post: 114 days
Last activity: 6 days

Posted on 08-26-07 11:29:07 AM Link
At the time of writing this post, I had..
Posts: 69 ~ Level: 10 ~ Exp: 3187

Originally posted by HyperHacker
1) Write some code.
2) Find a bug.
3) Add debug output to track down the bug.
4) Discover that adding output makes the problem not occur.
5) Remove the output code you added.
6) Discover that for some nonsensical reason, the problem still no longer occurs after restoring the code to the way it was before you added the output. The bug is still there, but no longer appears.
7) Smash head on keyboard.
8) Repeat a while later.



Hey, that's the exact way to code in VB, too! At least for me.

____________________


NSMB Editor 2.1
making awesome SMB remakes since 16/7/07
what? you want a new version already? are you joking?



Rena
I had one (1) message in Discord deleted and proceeded to make a huge, huge mess about how it was a violation of free speech and how moderators are supposed to be spam janitors and nobody should have the right to tell me not to talk about school shootings
Level: 135


Posts: 813/5390
EXP: 29076945
For next: 258060

Since: 07-22-07

Pronouns: he/him/whatever
From: RSP Segment 6

Since last post: 342 days
Last activity: 342 days

Posted on 08-28-07 06:26:50 AM; last edit by HyperHacker on 08-28-07 06:26 AM Link
JL2 - Post #813 - 08-28-07 01:26:50 AM
Day 36, rank 7; Level 29 (54.7%)
9058/16547 (140396/147885)

GPP: 259; GT: 45.147
I'm starting to wonder which part of my computer is defective. I mean, when I have to make clean, compile, make clean, and compile again to have my changes take effect... that doesn't make any sense.

____________________
roxahris
600
was seriously wounded, but the soul still burns.
Level: 52


Posts: 165/600
EXP: 1081347
For next: 2493

Since: 07-08-07

From: Somewhere.

Since last post: 9.4 years
Last activity: 8.6 years

Posted on 09-01-07 11:09:49 AM Link
Originally posted by Joe
Actually, my dad buys it sometimes from the "Arabic store" so it would be Arabic food, not Greek.

stfu


____________________
Layout removed; Color overload of red and green makes eyes hurt bad
Rena
I had one (1) message in Discord deleted and proceeded to make a huge, huge mess about how it was a violation of free speech and how moderators are supposed to be spam janitors and nobody should have the right to tell me not to talk about school shootings
Level: 135


Posts: 875/5390
EXP: 29076945
For next: 258060

Since: 07-22-07

Pronouns: he/him/whatever
From: RSP Segment 6

Since last post: 342 days
Last activity: 342 days

Posted on 09-04-07 07:39:43 AM; last edit by HyperHacker on 09-05-07 06:18 AM Link
JL2 - Post #875 - 09-04-07 02:39:43 AM
Day 43, rank 8; Level 31 (27.2%)
5294/19494 (171163/185363)
GPP: 293; GT: 44.150
New ones:
  • API call fails, but doesn't SetLastError(), or sometimes even returns success, so you have no way to tell what went wrong. Or it returns failure when it actually succeeded, because the return value that indicates failure is a valid return value on success as well.
  • "Invalid conversion from char* to unsigned char*" when passing to a function that doesn't do anything in which it would matter anyway.
  • For some reason, one of the more common side effects of memory corruption seems to be that malloc() will return pointers to blocks of already-allocated memory. You get two buffers that are at the same location and spend hours trying to figure out why one changes when you change the other. Or, your program will just close with no error message or anything. Stack overflow does this too. Just why did they decide the default exception handler should work this way?


More to come as I remember/find them.

Somewhat related, ever try installing Visual Studio 6, and when it asks if you want to reboot, select no? Here's the message you get when you do so:


Still better than IE6 "lol let's just reboot without any warning" though.

[edit] Weird one:
if(this->Text) free(this->Text);
this->Text = malloc(1);
causes memory corruption, but seemingly equivalent code:
char* NewStr;
NewStr = realloc(this->Text, 1);
if(!NewStr) return false;
this->Text = NewStr;
doesn't appear to. I suspect it's still there, somewhere, and this may not even have been the cause, but it's not breaking anymore. (Really, I'm more curious as to why I used the first method to begin with...)

[edit 2] Nah, should have known that was too easy. Also, new one: you run the program several times in a row, doing the exact same thing every time. The procedure involves no timers, random numbers, etc, so the results should be the same every time. In one instance, it does something different.

[hey more editing]
I've found what I suspect is the problem, and it's a fucking sneaky bastard. Basically, a class contains a pointer to some memory that's malloc()'d in the constructor and free()'d in the destructor. There's a function which returns one of these classes. By the looks of it, the compiler puts a copy of the class to be returned on the stack as the return value. In this case, however, I was discarding the return value, so the copy is immediately destroyed. When the copy gets destroyed, the destructor is called... see the problem? Since it's a copy it frees the buffer that the original is still using. That's my current theory, anyway...

____________________
Next newer thread | Next older thread
Jul - NO! GO TO STAR! - How to code in C++ New poll - New thread - Thread closed


Rusted Logic

Acmlmboard - commit 47be4dc [2021-08-23]
©2000-2022 Acmlm, Xkeeper, Kaito Sinclaire, et al.

29 database queries.
Query execution time: 0.078272 seconds
Script execution time: 0.026367 seconds
Total render time: 0.104639 seconds