Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Program won't crash when it should

Name: Anonymous 2012-01-16 3:24

(GCC C)
I ran a pointer over each member of an integer array, storing one character of input in each cell.

The program seems to consistently crash when I try to store X+3 or more characters, where X is the size of the array, but if I do not exceed X+2 it will not crash.

Why does it crashes exactly at the point it does, but not for X+1 or X+2?

Name: Anonymous 2012-01-16 21:31

>>117
Wow, we have a psychologist!

Name: Anonymous 2012-01-16 21:32

>>121
I'm not a psychologist I was just speaking from personal experience, for all I know you (I assume Kodak) might have a personality disorder which might make my reasoning around your incapability of admitting mistakes wrong.

Name: Anonymous 2012-01-16 21:40

WHY THE FUCK ARE YOU AFRAID OF ASSUMING YOUR ERRORS?
THIS IS A FUCKING ANONYMOUS BOARD!
NO ONE AT YOUR LAME COMPANY WILL JOKE IF YOU BEHAVE LIKE A KIND PERSON HERE BECAUSE THEY WON'T KNOW!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!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!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

Name: Anonymous 2012-01-16 21:41

Kodak has decent programming knowledge but lacks the intelligence to properly use it, as evident by the mathematics thread where he showed his incompetence when it came to mathematical clarity and thought. He made several poor attempts at defining some concepts mathematically and he even attempted to argue against a mathematically proven statement disregarding the simple proofs given in the thread itself presumably because he didn't understand them. If a person isn't intelligent enough to intuitively grasp what a subset is after reading the definition and seeing a couple of simple examples then he's most likely not very bright. He even started to mix the empty set into the definition as if it made any difference.

Name: Anonymous 2012-01-16 21:45

>>113

In a number of other threads in which I discussed with him, he behaved rather well. So I kept a good feeling towards raising some discussion with him.

>>119

No part of it. It is a definition of a text stream. However, it is not stated that writing a partial text stream yields undefined behavior. The program could, for example, simply exit prematurely without terminating a given line. If there is somewhere in the document stating that incomplete text streams are not allowed, please share it.

>>118

I'm sorry, but honestly it's been hard to tell the Kodaks from other responses.

Name: Anonymous 2012-01-16 21:46

>>124
BUT I CAN WRITE ENTERPRISE QUALITY CODE!!!

Name: Anonymous 2012-01-16 21:50

>>125
I found the following..

" Data read in from a text stream will necessarily compare equal to the data that were earlier written out to that stream only if: the  data consist only of printing characters and the control characters horizontal tab and new-line; no new-line character is immediately preceded by space characters; and the last character is a new-line character.
"

Name: Anonymous 2012-01-16 21:51

>>126
Most of the code he writes that's over 5 lines usually have some kind of unintentional mistake in them, in the thread where he posted Java code he posted some nonsensical loops that didn't do what he said they were doing and he used that to argue against unordered collections. When prompted about it he of course just called the person who asked a mental midget even though the code was completely wrong.

Name: Anonymous 2012-01-16 21:52

>>127
There is no data read in from a text stream in the example so that's irrelevant. What Kodak posted is also irrelevant as there is nothing in >>40 which violates that, for reasons previously stated in this thread.

Name: kodak_gallery_programmer !!kCq+A64Losi56ze 2012-01-16 21:55

Just like I was sure % in java wasn't modulo, I'm sure what I posted has undefined behavior.

Name: kodak_gallery_programmer !!kCq+A64Losi56ze 2012-01-16 21:56

>>128
And I clearly stated that I responded to the wrong person you idiot.

Name: Anonymous 2012-01-16 21:57

>>129
Fail

Name: Anonymous 2012-01-16 22:04

check 'em

Name: Anonymous 2012-01-16 22:07

>>127

I reread that here too.

From what I understood, this says that the data effectively written will not compare equal to the data which were supposedly written, when read back in. But it does not say that if the written data does not terminate in a newline, the program will exhibit undefined behavior.

Nonetheless, I believe that something in the lines of >>64 applies in this situation. There might have been an unintentional omission from the committee, either for deciding that partial text streams are invalid, or that they are valid. Regardless, wasting time in this kind of discussion is surely not something the standard was intended to do in the first place.

There are more interesting and significant examples of undefined behavior that affect day-to-day programming and, specially, security. Even Kodak himself, filtering through his gigantic morass of offenses and violence, provided a good one.

>>124
>>128

This is some sort of serious personality flaw. Fortunately it's fixable, but it takes time and effort. I rarely relate personally to online peers, though. I just consider myself having been trolled in this case.

Name: kodak_gallery_programmer !!kCq+A64Losi56ze 2012-01-16 22:16

>>134
I wouldn't say that is insigificant because both Vi and Emacs approach this problem differently. So in other words, the people behind both of these idiotic editors clearly thought something like what I just mentioned was an issue. Otherwise they wouldn't have gone to such great lengths to "fix it".

Name: Anonymous 2012-01-16 22:17

>>134

Why are you partaking in a discussion that you consider a waste of time?

Name: Anonymous 2012-01-16 22:21

>>136
Maybe he's hoping to increase his programming foo to the point that he can land a job at Google.

Name: Anonymous 2012-01-16 22:50

>>45

detecting any possibility of undefined behavior will reduce to the halting problem.

Name: Anonymous 2012-01-17 0:01

>>138
I didn't mean 'any undefined behavior', just 'some' undefined behavior.

Name: Anonymous 2012-01-17 2:04

this thread is now about the undecidability of kittens

Name: Anonymous 2012-01-17 6:37

>>140
plox don't troll decidability of kittens has been long decided
by the ISO standard no.NY4NN3K0

Name: Anonymous 2012-01-17 6:40

>> 140 that wen't (^^) well...

this thread is now about deciding which hex codes will be used to overflow with, and the code it corresponds to ;D

i hear Nop's are kind of good? (/maybe, i'm sooo not leet ^^ / they are pretty useless on their own(?))

Name: Anonymous 2012-01-17 9:06

OP here. This has been a very informative thread. Thank you!

Name: Anonymous 2012-01-17 9:22

>>143
Well, the beginning is, anyhow.

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List