weixin_39650784
weixin_39650784
2020-12-30 11:40

100% usage, freeze, when rotating preview toward horizon

Linux theman 4.0.4-2-ARCH #1 SMP PREEMPT Fri May 22 03:05:23 UTC 2015 x86_64 GNU/Linux

java version "1.8.0_45" Java(TM) SE Runtime Environment (build 1.8.0_45-b14) Java HotSpot(TM) 64-Bit Server VM (build 25.45-b02, mixed

java -jar chunky.jar

I give it 2048M of ram, need to know anything else?

该提问来源于开源项目:chunky-dev/chunky

  • 点赞
  • 写回答
  • 关注问题
  • 收藏
  • 复制链接分享
  • 邀请回答

12条回答

  • weixin_39654465 weixin_39654465 4月前

    I've seen the same issue, I used a profiler to check where the cpu was spending its time and found that the code was stuck in awt doing drawLine or some such thing, I plan to investigate further, I haven't encountered this on windows, may be a subtle bug in chunky's behavior under linux.

    点赞 评论 复制链接分享
  • weixin_39715652 weixin_39715652 4月前

    I've experienced this as well under Linux; I haven't been able to do any new renders lately as a result. I don't think it has been resolved.

    点赞 评论 复制链接分享
  • weixin_39654465 weixin_39654465 4月前

    Found the problem, it's an issue with the code that finds the intersection of the camera boundaries with the chunks. This is used to power the overview map's yellow indicator of camera viewport. Sometimes, due to very close to parallel, but not quite, rays, the distance found can be thousands and thousands of pixels. When the code goes to draw the line, it calls into the Java awt code to draw a line, however due to a bug in the Java implementation of graphics, possibly related to linux, this call just goes forever, doing who knows what.

    I fixed this for myself by checking if the y direction of the cast ray was within .0001 of zero, then set the component to zero (yielding a null boundary), not sure why this doesn't cause odd behavior, but I'll work on a proper patch and contribute it later.

    点赞 评论 复制链接分享
  • weixin_39654465 weixin_39654465 4月前

    After more investigation into this problem, I've found that while the JVM implementation on Linux is the cause of the 100% usage crash (and should be reported to Oracle), the issue with the wildly out of bounds coordinates is likely a glitch in the math used by Chunky to render the view cone of the camera. Patching the drawLine calls to cap at the boundaries fixes the issue but properly reviews the oddly angled lines.

    I'll PR the fix in to hotfix this issue and work towards a proper solution.

    点赞 评论 复制链接分享
  • weixin_39829307 weixin_39829307 4月前

    Can still confirm this issue. Sorry to bump, but this should be fixed soon. I haven't made any renders for a while because of this.

    点赞 评论 复制链接分享
  • weixin_39790510 weixin_39790510 4月前

    I have not really been following this issue but it looks like this should be high priority to fix.

    Thanks for the info MoeHouse. Not sure why that would cause a hang on Linux, but I'll do some testing and see if I can reproduce it.

    点赞 评论 复制链接分享
  • weixin_39790510 weixin_39790510 4月前

    I spent some time trying to reproduce the issue in an Ubuntu VM, but couldn't get it to lock up. Are you able to reproduce the issue with a completely empty scene, or does it only happen if you have loaded any chunks?

    Is it possible to extract the camera position and orientation information (Camera tab) to reproduce the issue?

    点赞 评论 复制链接分享
  • weixin_39829307 weixin_39829307 4月前

    I can send you the setup I've been using, but it locks up after a seemingly random amount of time, and (at least for me) only while the render is running. Same methods being returned by VisualVM though.

    点赞 评论 复制链接分享
  • weixin_39790510 weixin_39790510 4月前

    Yes, please send me anything to help reproduce the issue. Can you tell me the exact steps I should take to reproduce it?

    点赞 评论 复制链接分享
  • weixin_39790510 weixin_39790510 4月前

    I tried to reproduce it some more, while rendering a scene. I was still not able to get it to hang.

    I have been testing with Chunky 1.4.4 and Java 1.8.0_151. I think I'll try more with the Java version that Jason had problems with.

    Anyone else who had this issue, please post what Chunky version you used and your Java version ("java -version" output).

    点赞 评论 复制链接分享
  • weixin_39790510 weixin_39790510 4月前

    I was not able to reproduce this issue even though I tried with Java 1.8.0_45 which Jason reported having issues with. However, I rewrote the code for the camera field of view indicator to clip the drawn lines to the visible part of the 2D map. This should prevent an inefficient drawLine implementation in Java from crashing Chunky. If that was the cause of the issue, then it should be fixed now.

    Since I can't reproduce the bug myself I will wait and see if the issue remains after releasing the fix.

    点赞 评论 复制链接分享
  • weixin_39790510 weixin_39790510 4月前

    Closing this now because I think it is fixed. If anyone has the same problem again in Chunky version 1.4.5 or later please comment/reopen this issue or make a new one and link to this discussion. Thanks.

    点赞 评论 复制链接分享