Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

run test.lua 产生Bus error: 10错误 #61

Closed
hliangwei opened this issue Jul 9, 2015 · 2 comments
Closed

run test.lua 产生Bus error: 10错误 #61

hliangwei opened this issue Jul 9, 2015 · 2 comments

Comments

@hliangwei
Copy link

运行几个lua测试文件(test.lua、test2.lua、textparser.lua),结果都是Bus error: 10错误。

通过打日志发现,是protobuf.encode或者protobuf.decode触发的,

再往里跟发现是pbc-lua.c文件里的
static void
new_array(lua_State *L, int id, const char *key)函数
里面的lua_setfield(L, -6 , key);这一行触发的,
水平比较差,没有思路,求大神指点。
-------------------环境
系统:mac osx 10.10
lua版本:5.1 5.14 5.3都试过
protobuff版本: 3.0.0-alpha-3

@cloudwu
Copy link
Owner

cloudwu commented Jul 9, 2015

无法重现, 我也没有思路。

@hliangwei
Copy link
Author

经过云风提示,问题解决,修改makeFile文件内容如下,即可正常:
CC = gcc
CFLAGS = -O2 -Wall -bundle -undefined dynamic_lookup
TARGET = protobuf.so

.PHONY : all clean

all : $(TARGET)

$(TARGET) : pbc-lua.c
$(CC) $(CFLAGS) -o $@ -I../.. -I/usr/local/include -L../../build $^ -lpbc

clean :
rm -f $(TARGET)

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants