Skip to main content
 首页 » 编程设计

ubuntu之Monogame Linux 在启动时崩溃

2025年05月04日30hnrainll

从 Linux(Ubuntu 12.04)启动单人游戏时,我在控制台中收到以下错误

Pastebin, formatting when pasted here wasn't worth fixing

当我延迟任何逻辑的发生直到一定数量的游戏时间过去时,这个错误不会发生,但是必要的游戏时间量不断变化并且太长了。有什么方法可以解决此错误消息吗?

代码:初始化

public class Husk : Game 
{ 
    public GraphicsDeviceManager graphics; 
    public SpriteBatch regBatch; 
    public World world; 
    public static Texture2D pixel; 
    string title; 
 
    public Husk(string Title = "") // :base() seems to make the required elapsed time lesser. 
    { 
        title = Title; 
        graphics = new GraphicsDeviceManager(this); 
        HuskLib.Content.content = this.Content; 
    } 
 
    protected override void Initialize () 
    { 
        regBatch = new SpriteBatch(graphics.GraphicsDevice); 
 
        Window.Title = title; 
 
        pixel = new Texture2D(graphics.GraphicsDevice, 1, 1); 
        pixel.SetData<Color>(new Color[1]{Color.White}); 
    } 
} 

我没有在我的游戏中使用任何线程,它可以通过 Monogame 在外部完成

请您参考如下方法:

您正在使用的库之一是引发段错误 (SIGSEGV)。

我还在堆栈跟踪中看到您似乎正在使用线程。

我最好的猜测(没有看到任何源代码)是多个线程处于竞争状态。有时它们中的一个会达到期望数据被初始化的程度,但该数据尚未初始化。

如果您粘贴相关的源代码,您可能会得到更详细的帮助。