generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Stack Overflows

Previous Thread :: Next Thread 
Nikilis is not online. Nikilis
Joined: 25 Dec 2008
Total Posts: 949
30 Jul 2013 10:43 PM
What are the ways to cause them?
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
30 Jul 2013 10:46 PM
Part['Changed']:connect( function()
Part['Transparency'] = math['random']()
end)
Report Abuse
oxcool1 is not online. oxcool1
Joined: 05 Nov 2009
Total Posts: 15444
30 Jul 2013 10:54 PM
setfenv(1,getfenv(1))()
Report Abuse
Nikilis is not online. Nikilis
Joined: 25 Dec 2008
Total Posts: 949
30 Jul 2013 11:13 PM
Anything else? I know calling a function within it's own function.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
31 Jul 2013 01:17 AM
function Egg()
return Chicken()
end

function Chicken()
return Egg()
end

Which came first? QQ
Report Abuse
DrHaximus is not online. DrHaximus
Joined: 22 Nov 2011
Total Posts: 8410
31 Jul 2013 01:25 AM
@cnt

depends on which you call first.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
31 Jul 2013 01:28 AM
dey still will error either way c:
Report Abuse
woot3 is not online. woot3
Joined: 10 Nov 2008
Total Posts: 3599
31 Jul 2013 03:56 AM
The egg came first. Over millions of years of constant evolution eventually another species of similar aesthetic would lay an egg containing the very first Chicken.

#HowToConfusePeopleWhoAskThisQuestionWithLittleBrainPower
Report Abuse
awsumpwner27 is not online. awsumpwner27
Joined: 03 Sep 2011
Total Posts: 4389
31 Jul 2013 04:22 AM
The stack is a list of addresses pointing to variables. Every time a function is called, the program enters a new scope, information about the function call is added to the stack, and the local variables in the scope are added as well. Once the function returns, the memory it was using is freed. However, if you call a function with infinite recursion, none of the function calls will ever return because they're waiting for a function to return which is also waiting for its function to return. The stack is filled with function calls, and overflows.

Note that the inclusion of a wait() would not prevent stack overflow.

function a()
 wait()
 a()
end

a()

It would simply take longer.

Also note that calling the function twice would not decrease the time to stack overflow, because the function would never reach the second call.

function a()
 a()
 a()
 --The program will never reach the above call because the first call sends the program to a new scope repeatedly.
 print("Hello?")
end

a()

One thing you could do to cause stack overflow sooner is give a function with infinite recursion a large list of parameters and also a large number of local variables.

The Unwise Wizard of Scripters has spoken.
Report Abuse
Nikilis is not online. Nikilis
Joined: 25 Dec 2008
Total Posts: 949
31 Jul 2013 10:11 AM
I'm trying to stop stack overflows but thanks for the info x)
Report Abuse
DrVulcan is not online. DrVulcan
Joined: 15 Jul 2013
Total Posts: 320
31 Jul 2013 10:12 AM
function a(b) print(b) a(b) end
Report Abuse
Nikilis is not online. Nikilis
Joined: 25 Dec 2008
Total Posts: 949
31 Jul 2013 11:06 AM
I already said I knew about that one.
Report Abuse
TheColorMan is not online. TheColorMan
Joined: 30 Jan 2010
Total Posts: 11228
31 Jul 2013 12:10 PM
Unrelated comment: At first I thought the title meant users of the Stack Overflow coding help site.
Report Abuse
noliCAIKS is not online. noliCAIKS
Joined: 08 Mar 2010
Total Posts: 917
31 Jul 2013 02:43 PM
@Nikilis
I was talking about a different kind of stack overflow, which might not have been a stack overflow but some other kind of buffer overflow or memory error.
It would occur because events are not handled in Lua, but by the actual program. A stack overflow in Lua would only make the script error, not disconnect everyone.
Report Abuse
woot3 is not online. woot3
Joined: 10 Nov 2008
Total Posts: 3599
31 Jul 2013 02:53 PM
script.Changed:connect(function ()
script.Name = tostring(tonumber(script.Name)) == script.Name and script.Name+1 or 0
end)

I wonder if this would do the trick. (It's probably incorrect syntax but you get the idea)
Report Abuse
noliCAIKS is not online. noliCAIKS
Joined: 08 Mar 2010
Total Posts: 917
31 Jul 2013 03:04 PM
Radio got filtered :P
Report Abuse
Radioaktiivinen is not online. Radioaktiivinen
Joined: 25 Apr 2009
Total Posts: 18629
31 Jul 2013 03:24 PM
Censored version:

local stack = [maximum value of 32 bit signed integer number]
stack = stack + 1
Report Abuse
woot3 is not online. woot3
Joined: 10 Nov 2008
Total Posts: 3599
31 Jul 2013 04:09 PM
local stack = Two billion one hundred forty-seven million four hundred eighty-three thousand six hundred forty-seven
stack = stack+1

:D
Report Abuse
Nikilis is not online. Nikilis
Joined: 25 Dec 2008
Total Posts: 949
31 Jul 2013 04:53 PM
The problem was: Disabled a VehicleSeat when someone was already on it. Or at least it seems to be, for now.
Report Abuse
blocco is not online. blocco
Joined: 14 Aug 2008
Total Posts: 29474
31 Jul 2013 04:54 PM
I got filtered like 4 times for talking about a mature topic that the filter didn't like. It's freaking madness.
Report Abuse
stravant is not online. stravant
Forum Moderator
Joined: 22 Oct 2007
Total Posts: 2893
31 Jul 2013 05:04 PM
"Part['Changed']:connect( function()
Part['Transparency'] = math['random']()
end)"

Interestingly, this is the worst example here, because it may not actually stack overflow.
Report Abuse
MrNicNac is not online. MrNicNac
Joined: 29 Aug 2008
Total Posts: 26567
31 Jul 2013 09:04 PM
"Interestingly, this is the worst example here"

Thank you. I try.
Report Abuse
cntkillme is not online. cntkillme
Joined: 07 Apr 2008
Total Posts: 44956
31 Jul 2013 09:38 PM
^^
Report Abuse
brinker7 is online. brinker7
Joined: 22 Jun 2009
Total Posts: 129
01 Aug 2013 07:43 AM
Thing={}
setmetatable(Thing,{__newindex=(function()
Thing.Another=Thing
end)})
Thing.Stuff="Orly?"

Free overflows for everyone
Report Abuse
noliCAIKS is not online. noliCAIKS
Joined: 08 Mar 2010
Total Posts: 917
01 Aug 2013 11:11 AM
Special kind of stack overflow that crashes the game and disables the creation of a new server for about 5 minutes:

local function Overflow(object)
    object.DescendantAdded:connect(Overflow)
    Instance.new("IntValue", object)
end
Overflow(Game)
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image