Viewing Issue Simple Details Jump to Notes ] Wiki ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0008641 [DCSS] Bug Report minor always 2014-06-04 05:18 2014-06-04 20:39
Reporter thom View Status public  
Assigned To neil
Priority normal Resolution done  
Status resolved   Product Branch 0.14 ancient branch
Summary 0008641: crawl dies with "Unable to create Lua state"
Description Compiled with TILES=y USE_LUAJIT=Y

Running on 64-bit linux results in:
'Must use luaL_newstate() for 64 bit target
Unable to create Lua state'

From reading http://luajit.org/install.html: [^] "Make sure you use luaL_newstate. Avoid using lua_newstate, since this uses the (slower) default memory allocator from your system (no support for this on x64)."

I made a quick patch to clua.cc to resolve this issue (attached below)
Additional Information
Tags No tags attached.
Attached Files ? file icon clua.cc [^] (29,245 bytes) 2014-06-04 05:18

- Relationships

-  Notes
(0026380)
neil (administrator)
2014-06-04 05:36
edited on: 2014-06-04 06:14

The problem is that we need the custom allocator for server clua to prevent buggy or malicious user scripts from using all available memory. And luaL_newstate doesn't allow a custom allocator.

I would support disabling the custom allocator, with a build-time warning, when compiling with luajit on a 64-bit platform. None of the servers, where this is most important, use luajit anyway. However, it shouldn't just be ripped out, because the servers need it.

(0026384)
neil (administrator)
2014-06-04 20:39

Fixed in trunk (0.15-a0-1268-g97cf85e) and stable (0.14.1-19-g9964f44), thanks! Now we disable the custom allocator when building with Luajit on x86_64 (the only 64-bit target Luajit supports). We also give a warning if this happens on a webtiles or dgamelaunch build.

- Issue History
Date Modified Username Field Change
2014-06-04 05:18 thom New Issue
2014-06-04 05:18 thom File Added: clua.cc
2014-06-04 05:36 neil Note Added: 0026380
2014-06-04 05:37 neil Severity crash => minor
2014-06-04 06:14 neil Note Edited: 0026380
2014-06-04 20:39 neil Note Added: 0026384
2014-06-04 20:39 neil Status new => resolved
2014-06-04 20:39 neil Fixed in Branch => 0.14 stable branch
2014-06-04 20:39 neil Resolution open => done
2014-06-04 20:39 neil Assigned To => neil


Mantis 1.1.8[^]
Copyright © 2000 - 2009 Mantis Group
Powered by Mantis Bugtracker