bluescreen

Programming, for all ages and all languages.
Mikemk
Member
Member
Posts: 409
Joined: Sat Oct 22, 2011 12:27 pm

bluescreen

Post by Mikemk »

Type 2^34359738368 into a calculator on a 32-bit computer.
Last edited by Mikemk on Fri May 03, 2013 7:17 am, edited 1 time in total.
Programming is 80% Math, 20% Grammar, and 10% Creativity <--- Do not make fun of my joke!
If you're new, check this out.
User avatar
ASMMan
Posts: 14
Joined: Fri Jan 18, 2013 10:35 pm

Re: instant bluescreen

Post by ASMMan »

Are you talking about Microsoft Windows's calc? I'm not on MS Windows currently; in my current system it just given an error message.
User avatar
AJ
Member
Member
Posts: 2646
Joined: Sun Oct 22, 2006 7:01 am
Location: Devon, UK
Contact:

Re: instant bluescreen

Post by AJ »

On a fully patched Windows XP box:
Windows XP Calculator with Result of 2^34359738368
Windows XP Calculator with Result of 2^34359738368
Cheers,
Adam
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: instant bluescreen

Post by Brendan »

Hi,
m12 wrote:Type 2^34359738368 into a calculator on a 32-bit computer.
I tried it on Kcalc (running on 64-bit Gentoo); and it caused the calculator to crash (segmentation fault in "__gmpn_copyi()"). :)

I suspect an out of memory problem - e.g. someone forgetting to test if "malloc()" returned NULL (or possibly someone using C++, where "new" exists to ensure software crashes unexpectedly).


Cheers,

Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Mikemk
Member
Member
Posts: 409
Joined: Sat Oct 22, 2011 12:27 pm

Re: instant bluescreen

Post by Mikemk »

Ubuntu 12.04. Not sure the name of the program I used
Programming is 80% Math, 20% Grammar, and 10% Creativity <--- Do not make fun of my joke!
If you're new, check this out.
User avatar
Love4Boobies
Member
Member
Posts: 2111
Joined: Fri Mar 07, 2008 5:36 pm
Location: Bucharest, Romania

Re: instant bluescreen

Post by Love4Boobies »

So you started the thread by explaining how to make the OS crash without mentioning the OS or the program that did it...
"Computers in the future may weigh no more than 1.5 tons.", Popular Mechanics (1949)
[ Project UDI ]
Mikemk
Member
Member
Posts: 409
Joined: Sat Oct 22, 2011 12:27 pm

Re: instant bluescreen

Post by Mikemk »

Love4Boobies wrote:So you started the thread by explaining how to make the OS crash without mentioning the OS or the program that did it...
Good point. I was wondering what the number would be if my entire ram was filled with 0xff. I didn't realize that it would take my entire ram to calculate it.
Programming is 80% Math, 20% Grammar, and 10% Creativity <--- Do not make fun of my joke!
If you're new, check this out.
User avatar
xenos
Member
Member
Posts: 1121
Joined: Thu Aug 11, 2005 11:00 pm
Libera.chat IRC: xenos1984
Location: Tartu, Estonia
Contact:

Re: instant bluescreen

Post by xenos »

It's 2^(RAM bits) - 1 ;)
Programmers' Hardware Database // GitHub user: xenos1984; OS project: NOS
User avatar
darkinsanity
Member
Member
Posts: 45
Joined: Wed Sep 17, 2008 3:59 am
Location: Germany

Re: instant bluescreen

Post by darkinsanity »

Brendan wrote:I tried it on Kcalc (running on 64-bit Gentoo); and it caused the calculator to crash (segmentation fault in "__gmpn_copyi()"). :)
I used Kcalc on netrunner 12.12, it hung for a couple of seconds, took 1.680680 gigabytes of RAM and then said "6.48067178374e+2082970051".
User avatar
xenos
Member
Member
Posts: 1121
Joined: Thu Aug 11, 2005 11:00 pm
Libera.chat IRC: xenos1984
Location: Tartu, Estonia
Contact:

Re: instant bluescreen

Post by xenos »

darkinsanity wrote:6.48067178374e+2082970051
Doesn't look right. 34359738368 ln 2 / ln 10 is a bit less than 10343311892, so one should expect something between 1e+10343311891 and 1e+10343311892. To be more precise:

2^34359738368 = 10^(34359738368 Log[2]/Log[10] - 10343311891) * 1e+10343311891,

which is approximately 8.6013834471e+10343311891. Indeed, Mathematica agrees:

Code: Select all

In[1]:= Timing[2.0^34359738368.0]
Out[1]= {0., 8.6014*10^10343311891}
...and calculates this even too fast to measure the time it takes.
Programmers' Hardware Database // GitHub user: xenos1984; OS project: NOS
User avatar
darkinsanity
Member
Member
Posts: 45
Joined: Wed Sep 17, 2008 3:59 am
Location: Germany

Re: instant bluescreen

Post by darkinsanity »

XenOS wrote:Doesn't look right.
Then Kcalc either wanted to troll me, or I mistyped something.
CWood
Member
Member
Posts: 127
Joined: Sun Jun 20, 2010 1:21 pm

Re: instant bluescreen

Post by CWood »

Tried it in KCalc just now, got 1. What?
Mikemk
Member
Member
Posts: 409
Joined: Sat Oct 22, 2011 12:27 pm

Re: instant bluescreen

Post by Mikemk »

I used gcalctool.
Programming is 80% Math, 20% Grammar, and 10% Creativity <--- Do not make fun of my joke!
If you're new, check this out.
User avatar
dozniak
Member
Member
Posts: 723
Joined: Thu Jul 12, 2012 7:29 am
Location: Tallinn, Estonia

Re: instant bluescreen

Post by dozniak »

m12 wrote:I used gcalctool.
Based on you description (should take all the RAM), the bluescreen cannot possibly be instant because it takes some time to fill all the ram, and then a system would probbaly swap for a while.

And then the calculator process will be terminated by oom killer; still no bsod.
Learn to read.
Mikemk
Member
Member
Posts: 409
Joined: Sat Oct 22, 2011 12:27 pm

Re: bluescreen

Post by Mikemk »

dozniak wrote:
m12 wrote:I used gcalctool.
Based on you description (should take all the RAM), the bluescreen cannot possibly be instant because it takes some time to fill all the ram, and then a system would probbaly swap for a while..
OK, fine. I'll take the word instant out.
Programming is 80% Math, 20% Grammar, and 10% Creativity <--- Do not make fun of my joke!
If you're new, check this out.
Post Reply