关键词不能为空

当前您在: 主页 > 英语 >

运行时错误:Stack Overflow的解决办法

作者:高考题库网
来源:https://www.bjmy2z.cn/gaokao
2021-02-08 13:34
tags:

-

2021年2月8日发(作者:peephole)


运行时错误:


Stack


Overflow< /p>


的解决办法


.txt


这世界上除了我谁都 没资格陪在你身边。




< p>
着,


我允许你喜欢我。


除了白头偕老,

< p>
我们没别的路可选了什么时候想嫁人了就告诉我


,


我娶


你。




现象:



编译正常通过,但运行时出现——




forrtl: severe (170): Program Exception - stack overflow


Image PC Routine Line Source


00401A73 Unknown Unknown Unknown


004029B9 Unknown Unknown Unknown


00449929 Unknown Unknown Unknown


0042EDB9 Unknown Unknown Unknown


77E7CA90 Unknown Unknown Unknown


Incrementally linked image--PC correlation disabled.


Press any key to continue



解决方法:




project->settings->link->Ca tegory=output->stack allocations


设一个足够大的值就行








参考:



/fortran/visual/vfn10/#Doctor



Issue


2001



/fortran


Doctor Fortran - Don't Blow Your Stack!


Steve Lionel


Visual Fortran Engineering



Doctor frequently sees questions like these, and he realizes it's time for a


general article on the subject of stack allocation, as well as the other


memory allocation types, static and dynamic.



Static allocation



program's data - it has to live somewhere in memory while it is being


referenced (registers are a special kind of memory we won't get into here.)


The compiler, linker and operating system work together to determine exactly


where in memory a piece of data is to reside. The simplest method of


assigning locations is


fixed (static) address by the compiler and linker in the executable image


(EXE). For example, if variable X is statically allocated at address 4000,


it is always at address 4000 when that EXE is run, no matter what else is


going on in the system. (DLLs can also have static data - it is allocated at


a fixed offset from the base address where the DLL gets loaded.)



Static allocation is simple from the compiler's perspective because all that


is needed is to create a list of variables that need allocation, and lay


them down in memory one after the other. A run-time advantage of static


allocation is that it is usually easy and fast to access a fixed address and


statically allocated data can be used from anywhere in the program. But


static allocation has disadvantages too. First, if you have any reentrant or


parallel code, the multiple codestreams are both trying to use the same


data, which may not be wanted. Second, if you have many routines which need


a lot of memory just while they're executing, the available address space


can fill up quickly (for example, ten routines each of which declares a


1000x1000 REAL(8) array need a total of 80,000,000 bytes just for those


arrays.) And perhaps most important, with static allocation you must know at


compile-time how much memory you will want.



Up through Fortran 77, the Fortran standard was carefully written in a way


so that static allocation was the only method needed. Even today, static


allocation is the most widely used method - in Visual Fortran, COMMON blocks


and most variables with the SAVE attribute are allocated statically. (Note


that Visual Fortran, by default, implies SAVE for local routine variables


unless it can see that the variable is always written before it is read.)



Dynamic allocation


Dynamic allocation is the complete opposite of static allocation. With


dynamic allocation, the running application must call a system routine to


request a particular amount of memory (for example, 1000 bytes). The system


routine looks to see if that request size is available in the collection


(


satisfied, a range of memory addresses is marked as used and the starting


address is returned to the program. If the heap is empty, the operating


system expands the virtual address space of the process to replenish the


heap, stopping only if there is no more virtual memory available. The


program stores the base address in a pointer variable and then can access


the memory. When the program no longer needs the memory, another system


routine is called to


used again by a future allocate call. You can think of this as similar to


borrowing money from a bank, and then later paying it back (except that


there's no interest!)

-


-


-


-


-


-


-


-



本文更新与2021-02-08 13:34,由作者提供,不代表本网站立场,转载请注明出处:https://www.bjmy2z.cn/gaokao/614847.html

运行时错误:Stack Overflow的解决办法的相关文章

  • 余华爱情经典语录,余华爱情句子

    余华的经典语录——余华《第七天》40、我不怕死,一点都不怕,只怕再也不能看见你——余华《第七天》4可是我再也没遇到一个像福贵这样令我难忘的人了,对自己的经历如此清楚,

    语文
  • 心情低落的图片压抑,心情低落的图片发朋友圈

    心情压抑的图片(心太累没人理解的说说带图片)1、有时候很想找个人倾诉一下,却又不知从何说起,最终是什么也不说,只想快点睡过去,告诉自己,明天就好了。有时候,突然会觉得

    语文
  • 经典古训100句图片大全,古训名言警句

    古代经典励志名言100句译:好的药物味苦但对治病有利;忠言劝诫的话听起来不顺耳却对人的行为有利。3良言一句三冬暖,恶语伤人六月寒。喷泉的高度不会超过它的源头;一个人的事

    语文
  • 关于青春奋斗的名人名言鲁迅,关于青年奋斗的名言鲁迅

    鲁迅名言名句大全励志1、世上本没有路,走的人多了自然便成了路。下面是我整理的鲁迅先生的名言名句大全,希望对你有所帮助!当生存时,还是将遭践踏,将遭删刈,直至于死亡而

    语文
  • 三国群英单机版手游礼包码,三国群英手机单机版攻略

    三国群英传7五神兽洞有什么用那是多一个武将技能。青龙飞升召唤出东方的守护兽,神兽之一的青龙。玄武怒流召唤出北方的守护兽,神兽之一的玄武。白虎傲啸召唤出西方的守护兽,

    语文
  • 不收费的情感挽回专家电话,情感挽回免费咨询

    免费的情感挽回机构(揭秘情感挽回机构骗局)1、牛牛(化名)向上海市公安局金山分局报案,称自己为了挽回与女友的感情,被一家名为“实花教育咨询”的情感咨询机构诈骗4万余元。

    语文