问题标签 [stack-overflow]
For questions regarding programming in ECMAScript (JavaScript/JS) and its various dialects/implementations (excluding ActionScript). Note JavaScript is NOT the same as Java! Please include all relevant tags on your question; e.g., [node.js], [jquery], [json], [reactjs], [angular], [ember.js], [vue.js], [typescript], [svelte], etc.
c - 线程堆栈溢出
在像 vxworks 这样的 RTO 中,每当我们创建任务时,都会指定堆栈大小。我们可以在 C 中编写一个例程来检查堆栈是否溢出来执行任务吗?
ruby-on-rails - after_initialize 导致堆栈溢出
尝试干燥,我试图在对象初始化后分配给模型的实例变量。
但是,方法调用after_initialize
会导致SystemStackError
:
如果我注释掉after_initialize
,该last_clockout
方法没有问题。当我使用回调before_save
而不是after_initialize
. 为什么会after_initialize
造成这种情况?
谢谢!
java - 编译克隆方法时出现 Java StackOverflowError
有类:
现在添加这一行:
到 Timeline 类中的 clone() 方法,我得到:
但是,当我评论那一行时:
和:
然后再次取消注释该行:
和:
所以它在没有什么帮助的情况下工作正常;)。在 Eclipse 上它也可以工作:/。我应该怎么办?它是java编译器错误还是什么?
oracle - 在独立应用程序中使用 Direct Connect 访问 ArcGIS 数据库
我在一家企业工作,在 ESRI ArcGIS 的基础上设计、创建和维护自定义应用程序。一些客户使用 Direct Connect 连接到存储在 Oracle 或 MS SQLServer 上的数据库。几个月来我一直在使用独立应用程序。
我有一个应用程序,用 Delphi 编写。当然,我做的第一件事就是打开工作区。
这适用于所有“正常”连接,在某些直接连接的情况下也可以正常工作。但是在调用 OpenFromFile 时,我可能会在不同的数据库上获取 stackoverflow。在 delphi 项目的项目选项中提高 MaxStackSize 使其适用于某些 Direct Connect 数据库。但这并不适用于所有人。
有人知道在没有 ArcMap 的情况下在独立应用程序中处理 Direct Connect 的正确方法吗?在 ArcMap 中访问数据库从来都不是问题,我认为 ArcMap 对 Direct Connect 有特殊处理。
感谢所有的想法和回复。愿答案与你同在;-)
问候
战心
c# - 列出 Find() StackOverflow 错误
我在此代码中收到 StackOverflow 错误:
编辑
编辑2
各位大侠能指教一下吗?
我可能只需要使用一个简单的手动循环。
谢谢-奥利弗
arrays - 当我将 INTEGER 数组的大小指定为 200,000,000 时,为什么会出现 StackOverflowException?
200,000,000 远小于 32 位 INTEGER 的最大值 2,147,483,647。
.net - 堆栈溢出异常
StackOverflowException 是硬编码抛出的条件还是依赖于代码运行的机器?
我几乎可以肯定后者,但我的搜索失败了,并且在这里没有问足够多的问题。
c++ - 由于堆分配/释放导致的堆栈溢出
编辑:为了清楚起见,这个问题是由我的代码中的拼写错误引起的,在
本来应该
一切都很好!
结尾
你好!
我在 C++ 项目中的 Visual Studio 2005 中遇到了一个奇怪的堆栈溢出问题。
在我的代码中,我有一个
该指针设置为NULL,然后分配一些内存,然后清除为0x00。像这样:
现在,我已经运行了几次,得到了两个不同的结果。有时(在程序的后面部分,当我用 delete[] 删除指针时)它说堆已损坏,然后检查调用堆栈似乎 _CrtIsValidHeapPointer 断言它不是一个有效的指针。但是我检查了这个指针,它对我来说似乎是有效的(它有一个内存地址)。我错过了什么吗?
在另一种情况下,应用程序冻结了很短的时间,并且我收到了堆栈溢出消息。当我检查调用堆栈时,它看起来像这样
有很多这样的调用,我很确定这会导致堆栈溢出。知道这个问题可能是什么吗?我试图查看我是否分配/释放错误,但我没有写入除 memset 之外分配的内存块。
我分配/释放内存的方式有问题吗?
我正在使用此代码解除分配:
这应该确保我没有释放已经释放的内存,对吗?
谢谢..
编辑:在输出窗口中,我也得到了这些:
iphone - “Normal” UIButton causing obj_stack_overflow or EXC_BAD_ACCESS exception
It sure looks innocuous enough. In my App Delegate, I check NSUserDefaults for a flag to show tips at startup. If it’s set then, at the end of applicationDidFinishLaunching:
, I do this:
The idea is to show this view temporarily. (Note that it’s not a modal VC. No Navigation Controller at this point, plus there’s no navigation bar in this view anyway.)
Once this view is dismissed, we’ll add our pre-empted UITabBarController’s view to the window and transition over to it, then remove the tip view from the main window. I haven’t made it to the view dismissal point yet because, well, keep reading.
My TipsView’s VC is wired up more or less like so:
The source contains declarations and definitions for all three IBAction calls. Right now two of them do nothing. The third one changes the tip text
, resizes it to fit, and adjusts the scroll view’s contentSize
to match.
When I run the app, the TipsViewController view shows up just fine. I can even scroll through the tip text. However, when I trigger a touch-up-inside on any UIButton, Xcode starts to plant me in the source (where I’ve placed a breakpoint at each IBAction) … and then bails out with either a EXC_BAD_ACCESS
or obj_stack_overflow
.
I have compared this with other parts of the app where I have a VC, a view, and buttons. It is identical in every way except that, in this case, I’ve added a VC’s view as a subview of the app’s window instead of pushing the VC onto a navigation controller. Moreover, the View Controller Programming Guide for iPhone OS docs say this is fair game:
If you use a single view controller in your application, you add its view to a window instead of adding the view controller to a tab bar or navigation controller.
True, I do have a UITabBarController waiting in the wings, and it has tabs with UINavigationControllers (and other VCs) in it. However, if the tip view is being shown, the tab bar controller’s view has not yet been added to the window. The intent is to swap it in after we’re done showing tips. In other words, for all intents and purposes, we’re temporarily acting like we have a single VC in play. Afterward, we switch to the tab bar and tear down the tip VC.
Perhaps I’m doing something subtly wrong? Is there a better way? (“There’s got to be a better way!”)
Sample stack trace:
As you can see from the trace, we end up at doesNotRecognizeSelector:
… except I can clearly see the methods in my tip VC source. Plus, they’re all wired up. (No multiple wirings or anything like that in IB. Everything looks good there, down to the File’s Owner relationships.)
Clues welcome/appreciated!