keplerproject / wsapi

WSAPI is an API that abstracts the web server from Lua web applications.
http://keplerproject.github.io/wsapi
74 stars 33 forks source link

Prevent segmentation fault on Android #40

Open develCuy opened 8 years ago

develCuy commented 8 years ago

somehow the method used produces a segfault, very obscure bug..., using rawset() as a workaround.

mpeterv commented 8 years ago

So is this a bug in rings? Maybe it can be fixed there?

develCuy commented 8 years ago

All I get is a segmentation fault, I don't know how to debug that.

ignacio commented 8 years ago

Can you post a stack trace or something? El jun 27, 2016 6:07 PM, "Fernando Paredes García" notifications@github.com escribió:

All I get is a segmentation fault, I don't know how to debug that.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/keplerproject/wsapi/pull/40#issuecomment-228792653, or mute the thread https://github.com/notifications/unsubscribe/AABZo4EXr7FGOviGO9HUJajwQkQ27pX9ks5qP_UqgaJpZM4I-fOk .

develCuy commented 8 years ago

Unfortunately no, because there is not other message than: "segmentation fault", it looks like a deep C bug, so any idea on how to generate an stack trace for this?

mpeterv commented 8 years ago

Another helpful thing would be providing a way to reproduce it, a minimal program that results in segfault. Even if it won't segfault under a system that's not Android, it could be helpful.

develCuy commented 8 years ago

I'm running a xavante server:

local hfile = require "xavante.filehandler"
local hcgi = require "xavante.cgiluahandler"
local hredir = require "xavante.redirecthandler"

local xavante = require "xavante"

-- Define here where Xavante HTTP documents scripts are located
local webDir = './docroot'
local simplerules = {

    { -- URI remapping example
      match = "^[^%./]*/$",
      with = hredir,
      params = {"index.lp"}
    }, 

    { -- cgiluahandler example
      match = {"%.lp$", "%.lp/.*$", "%.lua$", "%.lua/.*$" },
      with = hcgi.makeHandler (webDir)
    },

    { -- filehandler example
      match = ".",
      with = hfile,
      params = {baseDir = webDir}
    },
} 

xavante.HTTP{
    server = {host = "*", port = 80},

    defaultHost = {
        rules = {}
    },

    virtualhosts = {
        ["localhost"] = {
          rules = simplerules
        },
        ["fer-droid.cuy"] = {
          rules = simplerules
        },
    }
}

xavante.start()

And this is my index.lp:

<!doctype html>
<html class="no-js" xml:lang="es" lang="es" dir="ltr">
<body>Hello Kitty!</body>
</html>