0
==============
Info Develope:
MacOS 10.6 SnowLeopard
iOS SDK 5.0
FreePascal 2.6.0 for MacOS X
FreePascal 2.6.0 for iOS
XCode 4.2
Device: iPad
Lua: Object library = liblua.a (ver 5.14) 
==============

Code:

A) lua_pushnumber(LuaInstance, 5);
B) lua_pushstring(LuaInstance, 'TEST');
C) lua_pushlstring(LuaInstance, 'TEST', 4);

Problem: When I use variant "B" and "C", and launch project on my iPad, the application blink on start and close with next error:

(iPad) Error in console log:

Exited with code: 217
<Warning> Application 'demo1' exited abnormally with exit status 217

For variant "A", everything alright and application launch normal.

Interesting, when I compile and lanch on simulator, all variants ("A", "B", "C") works, without crash.

Can anybody knows why, application crash on device for lua_pushstring?

May be someone dealt with this problem without freepascal, may be on c++. Help me, please.

Doug Currie
  • 40,708
  • 1
  • 95
  • 119
Niro555
  • 1
  • 1

1 Answers1

0

I noticed, when I add printf to func lua_pushlstring, problem fixed. Why?

LUA_API void lua_pushlstring (lua_State *L, const char *s, size_t len) {
  lua_lock(L);
  luaC_checkGC(L);
  printf ("Test= %s ", s);  
  setsvalue2s(L, L->top, luaS_newlstr(L, s, len));
  api_incr_top(L);
  lua_unlock(L);
}

Perhaps addressing violation occurs, when linking liblua.a?

Niro555
  • 1
  • 1