JMonkeyEngine 在 Intel 视频适配器上崩溃

发布于 2024-12-25 16:26:35 字数 1200 浏览 3 评论 0原文

我在我的应用程序中使用 JME,有时它会崩溃并显示以下消息:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x3d601ad7, pid=168, tid=4012
#
# JRE version: 6.0_29-b11
# Java VM: Java HotSpot(TM) Client VM (20.4-b02 mixed mode, sharing windows-x86)
# Problematic frame:
# C  [ig4dev32.dll+0x21ad7]
#
# An error report file with more information is saved as:
# C:\...\hs_err_pid168.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

可以通过此链接找到日志文件: http://sergpank.heliohost.org/log.html

最奇怪的是,在我的例子中,我只在构建代码时崩溃,但是当我从 Eclipse 启动它时,一切都在我的机器上正常工作。在配备 AMD 视频适配器的机器上不会发生任何崩溃。在其他配备英特尔显卡的机器上,有时会在调试阶段出现崩溃。

我开始假设发生这种情况是因为 ant 设置不正确(在startup.ini 中设置了以下路径:-Djava.library.path=lib/dlls,因此可以在项目中看到 dll)。但仍然不明白为什么它在 AMD 上几乎完美工作而在 Intel 上崩溃。

也许这与ant有关,我必须将dll添加到manfest中......查看文档,找不到如何完成它的方法。

解决方案:

在64位系统上需要使用相应的JVM(64位),然后就不会崩溃=))

I am using JME in my application and sometimes it crashes with the following message:

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x3d601ad7, pid=168, tid=4012
#
# JRE version: 6.0_29-b11
# Java VM: Java HotSpot(TM) Client VM (20.4-b02 mixed mode, sharing windows-x86)
# Problematic frame:
# C  [ig4dev32.dll+0x21ad7]
#
# An error report file with more information is saved as:
# C:\...\hs_err_pid168.log
#
# If you would like to submit a bug report, please visit:
#   http://java.sun.com/webapps/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

The log file can be found by this link: http://sergpank.heliohost.org/log.html

The strangest thing is that in my case I get crashes only ob builded code, but when I am launcing it from the Eclipse, everything works fine on my machine. On machines with AMD video adapters nothing crashes. On other machines with Intel videocard sometimes crashes appear and on the debug stage.

I am starting to suppose that this happens because of incorrect ant setup (in startup.ini the following path is set up: -Djava.library.path=lib/dlls so dlls is seen for the project). But still can't get why it works almost perfectly on AMD and crashes on Intel.

Maybe it is something related to the ant, and I have to add dlls to the manfest... looking through the documentation and can't find the way how it can be done.

Solution:

On 64 bit system is necessary to use the corresponding JVM(64-bit) and then nothing crashes =))

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

千仐 2025-01-01 16:26:35

崩溃的原因是在 64 位操作系统上使用了 32 位 JVM。在这种情况下,似乎加载了 32 位 dll,这就是发生崩溃的原因。

问题只能在英特尔显卡上重现,我认为它可以被视为一个严重的错误。如果英特尔想要修复它或提出可行的解决方案/解决方法,这可能很棒! =)

Crash happens because 32-bit JVM was used on 64-bit OS. It seems that in this case 32-bit dlls was loaded and that's why crash happened.

Issue is reproducible only on Intel video cards, I think it can be considered as a serious bug. If Intel would like to fix it or propose a working solution/workaround this could be great! =)

淑女气质 2025-01-01 16:26:35

避免在 Swing 事件调度线程中执行 OpenGL 的繁重工作(注意导致 JVM 崩溃的线程:=>0x3a88e000 JavaThread "AWT-EventQueue-0" [_thread_in_native, id=5228, stack(0x3b170000, 0x3b1c0000))。我相信 OpenGL 的东西应该在 JMonkeyEngine 提供的线程中使用它拥有的事件调度机制来完成。如果您使用其他人的 API 进行 Swing 渲染,您可能需要更改它或以不同的方式进行操作。

编辑:看起来 AWTGLCanvas 会执行此操作,将上下文更改为当前线程。如果正常的全屏 3D 功能正常工作,英特尔驱动程序可能会在上下文切换方面遇到问题。严格来说,GL 线程上下文内容不是必需的,因为您始终可以将要执行的工作分派给单个 OpenGL 线程,只要您只有一个 OpenGL 渲染视口,就应该没问题。 LWJGL Canvas 实现假设您需要多个视口,但实际情况并非如此。如果可以的话,您可以将其重新编码为仅支持一个视口,并且您不应该崩溃,因为代码更简单。

Avoid doing the heavy work of the OpenGL stuff in the Swing Event Dispatch Thread (note the thread which crashes the JVM: =>0x3a88e000 JavaThread "AWT-EventQueue-0" [_thread_in_native, id=5228, stack(0x3b170000,0x3b1c0000)). I believe OpenGL stuff should be done in the thread offered by JMonkeyEngine using the event dispatch mechanism it has. If you're using somebody else's API for Swing rendering, you might need to change it or do it a different way.

Edit: it looks like AWTGLCanvas does this, changing the context to the current thread. It looks like the Intel drivers may have trouble with context switches if normal fullscreen 3D stuff works. Strictly speaking, the GL thread context stuff shouldn't be necessary as you can always dispatch work to be executed to a singular OpenGL thread which should be fine as long as you only have a single OpenGL rendering viewport. The LWJGL Canvas implementation assumes you will want multiple viewports when this isn't necessarily the case. You can recode this to only support one viewport if that is fine, and you shouldn't get crashes as the code is simpler.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文