- Feature Articles
- CodeSOD
- Error'd
- Forums
-
Other Articles
- Random Article
- Other Series
- Alex's Soapbox
- Announcements
- Best of…
- Best of Email
- Best of the Sidebar
- Bring Your Own Code
- Coded Smorgasbord
- Mandatory Fun Day
- Off Topic
- Representative Line
- News Roundup
- Editor's Soapbox
- Software on the Rocks
- Souvenir Potpourri
- Sponsor Post
- Tales from the Interview
- The Daily WTF: Live
- Virtudyne
Admin
WRONG! Microsoft THEMSELVES says they have the SAME bug! It is NOT related to UNIX, it is POSIX!!!!
BTW At least it wasn't MILLISECONDS, or NANOseconds, as SOME claim to use.
Steve
Admin
HUH?
Man! Stop and think a little
(now - start) >= duration is equivalent to now >= duration + start
so you end up adding start time and duration.
Regards
Admin
Do you want to melt down the CPU?
Admin
The most stupid things I ever seen were done by very graduated idiots. Please dont attack self-taugh people, this has nothing to do with professional quality.
Admin
Admin
Note to self: Looking forward to more of sao's intelligent, unbiased, thoughtful, original, and insightful posts.
Admin
How about not assuming that everyone who reads this forum is male (and straight at that) to begin with? That would solve all of your crazy problems. ;)
Well...not all....
Admin
The original poster was right, the real WTF is that nobody figured out that the explanation was nonsense.
1. sleep 1000000000 does work. Thus "Time passed 2^31-10^9 that weekend" is irrelavent.
2. The code behind sleep can be downloaded from http://directory.fsf.org/GNU/coreutils.html and shows that sleep is just a wrapper to the nanosleep() system call.
3. However: the code which checks for overflow is so broken, that it is a WTF in itself. Check out xnanosleep.c yourself if you are somewhat capable.
4. Additionally the overflow catch functionality fails as
# define TIME_T_MAX TYPE_MAXIMUM (time_t)
always returns -1.
Now all you loosers too stupid to check 250 lines of C-code go back into your cubicles and go on producing more WTFs.
Admin
I guess you never worked with computers before, huh? You could have the most PERFECT program, and customers will STILL want things THEIR way, even if they are wierd and cumbersome. One friend once asked me how I could have a job programming "After all, all the software must have already been written after the past 60 years!"! Yeah, and one person supposedly said “We should close the Patent Office, because everything
that can be invented already has been".
Steve
Admin
Hey stupid, if you read my whole message you would see that was the solution I proposed, the WTF is you.
Admin
I actually have to reply again, I went back and read my message to make sure that was the solution I proposed in it. WTF, you didn't even read my whole message before you tell me to "think a little". WOW, pathetic you are.
Admin
I was just trying to make a little joke for when last friday, when I started my post off with "female coworker," people said that was sexist. I didn't think so because you would have been able to figure out the gender of the person who I was referring to in the next sentence when i said "she." Perhaps I am wrong, though.
Admin
sigh - never say never
captcha = captcha - very original ;)
Admin
Ah yes, I do remember reading that. The additional adjective of "female" seemed redundant given that you had covered that information with the pronoun of "she".
And my male coworker, he agrees with me. ;)
Admin
Actually
does work, butfails. The cool WTF is now that
works again! Seems another WTF is the implemantaion of sleep...
(oh, and the captcha asks for genius *smile*)
Admin
From the README of the source code:
Most of these programs have significant advantages over their Unix
counterparts, such as greater speed, additional options, and fewer
arbitrary limits.
LOL
Admin
What makes you think the WTF used the GNU version of sleep?
Admin
Who taught the first Teacher? Hmm maybe he was self taught.
Admin
But it does indeed deal with professional quality. There are some amazing self-taught programmers and there are some very stupid programmers who have a degree. As mentioned before, a self-taught programmer with 4 years of experience will be a better bet than a programmer straight out of school. But it's my opinion, feel free to tell me what you think, that after a few years of experience out of school the degreed programmer will in general quickly surpass the self-taught programmer.
Admin
Redundant, yes. Sexist...? I still don't think so. I did not make any sweeping generalizations about female programmers, I was sharing a story about one specific person, who happened to be female...and incompetent.
Admin
4) If you read the define correctly, it will cast -1 to time_t which is an unsigned integer type (size depends on platform used). Since unsigned integers are modulo integers, -1 will wrap around to the maximum unsigned integer size. There is nothing wrong with the TYPE_MAXIMUM define.
Admin
Loosers of what?
The hounds of war?
Pigeons?
Evidence of a need for kaopectate?
Folks whose vocabulary does not extend to spanner or wrench?
Inquiring minds want to know these things!
Admin
I don't think it will cause any problem to your C14 client !
First, 584,942,417,355 years is not the good number, because the 64bits are 2's complement signed, and negative numbers are millisecond before January the 1st, 1970, 00h00. So if ALL of negative number are assigned to the past (the worse case), 584,942,417,355 must be divided by 2 to split time before and after 01/01/1970 00:00:00.000
Then, we have about 292 billions of years before and after 01/01/1970. The universe is about 15 billions years old : we are in the range. Since the the Sun's remaining lifetime is about 5 billions years, we are in the range for the future. In the case we escape the Solar System to avoid being fused in Sun's death, we'll have about 287 billions years to increase the "time counter" size.
In conclusion : Carbon-14 will be happy to know it will be totaly desintegrated before the "e-end of time", and we are able to represent its birthdate.
Admin
Only because he wants to have sex with you...
Admin
Another approach:
start Oracle
touch run_oracle_forever.lock
run:
sleep 200
if exist run_oracle_forever goto run
stop Oracle
cat tadaaa.wav > /dev/audio
removing the file "run_oracle_forever.lock" will stop oracle nicelly :D
rm run_oracle_forever.lock
Admin
What about: loosers of substantial boundary checking.
Dare you to call me a loser! ;-) Thanks anyway.
Admin
Admin
If there were such a thing as "the code behind sleep()," then either the GNU people would be in serious violation of UNIX System V copyrights, or else the UNIX people would be in serious breach of the GNU license. I really don't think everyone might be using the same implementation of sleep().
Admin
Mathematically but not computationally.
Admin
No, what he should have done is written a proper /etc/init.d/oracle service start script, and symlinked it to /etc/rc5.d/S99oracle, so that when the server is rebooted the database starts up automatically.
(Using start-stop-daemon or equivalent, if he wanted a separate PID file so the monitoring software could find the database and monitor it.)
That way, any competent Unix admin will be able to correctly and cleanly start, stop or restart the database server.
Admin
...not really, since the current time doesn't overflow yet, and the sleep_end in that example can't be the source of the original crash (as it would have done so on bootup).
Admin
I didn't say it was sexist, only redundant. And an unfortunate redundancy at that, which was why a few people pounced on it.
Even if it had been, it was nowhere approaching some of the sexism I've seen posted here previously, so I don't know why you were pounced on and the others were not. Altogether, very strange.
Admin
What can I say, I'm a popular gal. ;)
Admin
Clearly, "girlfriend" and "boyfriend" are both sexist. We should now all refer to them as "personfriends". Actually, "friend" implies exclusivity, which is also verboten. The new term shall be "personacquaintance".
</OverflowingPCIsm>
Admin
Personacquaintance is doubleplusgood. You are a goodthinker.
Admin
Maybe they are male but whether they are straight cannot be determined until after the waveform collapses. Kinda like the Schroedinger's Cat situation. As for male/female, I'd wager that the Steve Rule applies to this forum.
Admin
I had answered (and quoted) to another post which read:
However nanosleep() is a POSIX system call and will be most likely be used/wrapped in any modern implementation of sleep. And just by chance the GNU version does show the erratic behaviour as described in the WTF.
Admin
Removing the if-statement around the overflow catch and thus simply setting ts_sleep.tv_sec = -1 results in an error which essentially means that on amd64 time_t is not unsigned int.
Admin
Thanks for the explanation. The WTF post wasn't clear to those of those that have never looked at the source for sleep. That's the real WTF.
And to everyone that gave me a mean reply, take a chill pill.
Admin
This reminds me of a report which i had to port from one of the biggest players to a view in my application, because the boss didn't like the "copyFromClipboard-insertInMDB-doStuff-copyToExcel-copyFromOtherExcelPageToMDB-generateReport"
procedere. I thought: Hey, no problem, just lets look what an Oracle-Statement-Sniffer shows in the application, and import the data directly (instead of using the clipboard variant).
My eyes where bleeding when i saw about 3000 single Selects that took about 20 Minutes to execute, from whichs data the application generated the report. It took me 3 days to replace this with some views (that worked similar, i didnt figure everything out), and let the hole thing run in 10 seconds.
We learn: If we use ORMs, please choose one which supports native SQL-Querys. (Or just stay away from Gupta).
Admin
No. The problem is that it was adding the seconds specified to the current time in order to get the stop time. That calculation was overflowing.
Admin
Perhaps you need to stop and think a lot.
Lets say now = 90
start = 85
duration = 20
We can only hold two digit numbers.
So now-start = 15, 15 is not >= 20.
duration + start = 05, 90 >= 5.
Therefor you statement is NOT correct. And hence a WTF is born.
Admin
People, you all are screwy. The statement that "none of us has a girlfriend here anyway" is not sexist non-discriminatory. It applies to all cases:
straight males: no problem
gay males: never have girlfriends, check
straight females: never have girlfriends, check
gay females: Gay females reading the forum are just as geeky and pathetic as the straight males. Other girls are not interested, check.
bi males: See straight males.
bi females: See gay females
Capice?
Admin
"For 100000000 it will next crash 11/18/2034 2:13pm.:"
Given that the application crashed because oracle exited, the application will crash 100000000/60/60/24 = 1157.4 days after it was started, so at least before the end of August 2009.
Admin
Wow, now that must be the most complicated way to not having to type something arcane as 'stop oracle' to stop oracle.
Admin
I think I can rationalize the sleep command.
Let's say you have the following script:
Now, if you start this script in a terminal, you will see "start". Then, if you hit Ctrl-C, the sleep command will receive the SIGINT and exit, but the shell script will trap it and continue to execute the "stop" command.
Admin
Admin
and not forgetting the zillion services that run around at app
stop Oracle
stop zillion services
Admin
I love these kind of WTF generating people. They believe that mathematic principles always work when doing calculations on a computer.
Lets take a little example... Mathematically speaking, the following expressions is always true:
x + 1 > x , where x is an integer
But guess what, this isn't always true in a computer program, if you don't believe me, run this Java code:
int x = 0;
while (x + 1 > x) { // should ***ALWAYS*** be true!
x = x + 1;
}
System.out.println("Oh noes! x+1 was not greather than x");
How many more assumptions like this create real world WTFs?
The idea behind testing "(now()-start)>duration" is that it never causes an overflow, unless of course, now() has overflowed, but then the sleep exiting prematurely is the least of your worries.
Anyway, I do not know the actual implementation of all the varieties of sleep out there, or the exact one in this WTF, I am just pointing out the computational assumption that is probably behind this WTF (in particular, the assumption that "now + duration > now", given duration is positive).
Man! Think!
Admin
"So clue us in, oh Oracle gurus. Does this come from ${ORACLE_ROOT}/bin/dbstart, or is it from elsewhere?"
Not sure about guru, but I've worked as an Oracle DBA for 10 years. I have never, ever needed nohups or &s to keep an instance running. To start an Oracle instance on unix, you run sqlplus, the command line interface, and, connected as the sys user type startup. Once you get a success message, you exut sqlplus and Oracle will run forever. To stop an Oracle instance, in sqlplus connected as sys type shutdown, and it will stop. Simple.
The real WTF here is that the vendor wants to arbitrarily stop my database at some point in the future.