应用程序分段故障,仅当在Windows上使用MinGW进行编译时 [英] Application segmentation fault, only when compiling on Windows with MinGW

查看:1317
本文介绍了应用程序分段故障,仅当在Windows上使用MinGW进行编译时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图在Windows上编译我的一个游戏,但不幸的是,无论如何,

I'm trying to compile one of my games on Windows, but unfortunately, no matter what, I'm getting this segmentation fault every time I run the program.

编译成功,没有任何警告。

Compilation is successful, and without any warning.


程序接收信号SIGSEGV,分段错误。

Program received signal SIGSEGV, Segmentation fault.

__ chkstk_ms()at ../../../../。 ./src/gcc-4.8.1/libgcc/config/i386/cygwin.S:172

__chkstk_ms () at ../../../../../src/gcc-4.8.1/libgcc/config/i386/cygwin.S:172

172 ../../../../。 ./src/gcc-4.8.1/libgcc/config/i386/cygwin.S:没有此类文件或目录。

172 ../../../../../src/gcc-4.8.1/libgcc/config/i386/cygwin.S: No such file or directory.

我've tried:

I've tried:


  • 在Windows x86计算机上编译

  • 在Windows x64计算机上编译

  • nuwen.net的MinGW发行版

  • TDM MinGW 4.8.1 SJLJ

  • MinGW Builds x86 SJLJ

  • MinGW构建x64 SJLJ

  • MinGW构建x86 DW2

  • Compiling on a Windows x86 machine
  • Compiling on a Windows x64 machine
  • nuwen.net's MinGW distro
  • TDM MinGW 4.8.1 SJLJ
  • MinGW builds x86 SJLJ
  • MinGW builds x64 SJLJ
  • MinGW builds x86 DW2

我已经从源代码多次构建所有依赖关系,尝试链接静态和动态。

I've built all dependencies from source multiple times, tried linking both statically and dynamically.

调试不能帮助 - GDB在输入 main()时会给我错误消息。我已使用 -g3 -O0 标志。

Debugging doesn't help either - GDB gives me that error message just upon entering main(). I've used -g3 and -O0 flags.

如何知道发生了什么?

推荐答案

在Windows上,默认堆栈大小小于Linux。 __chkstk_ms似乎是一个函数,如果你溢出你的堆栈崩溃。

On Windows, the default stack size is smaller than Linux. __chkstk_ms appears to be a function that crashes if you overflow your stack.

您可以尝试找出您在代码中在哪里创建巨大的堆栈变量或做非常深的递归,并修复它。

You may try to figure out where in your code you are creating huge stack variables or doing very deep recursion, and fix that.

或者,您可以添加一个编译标志来增加堆栈大小。请参见 http://trac.sagemath.org/ticket/13960

Alternately, you may be able to add a compile flag to increase the stack size. See http://trac.sagemath.org/ticket/13960.

这篇关于应用程序分段故障,仅当在Windows上使用MinGW进行编译时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆