Giter Site home page Giter Site logo

运行闪退 about ejoy2d HOT 6 CLOSED

ejoy avatar ejoy commented on June 12, 2024
运行闪退

from ejoy2d.

Comments (6)

cloudwu avatar cloudwu commented on June 12, 2024

请帮助排查原因, 你这个信息不足.
这个错误通常是因为 C 层有空指针访问.
将 lib/ejoy2dgame.c 138 行的 lua_pcall 改成 lua_call 调用, 可以用 gdb 取到 C 调用栈.

from ejoy2d.

marsing avatar marsing commented on June 12, 2024

我改成了
//int err = lua_pcall(L, n, r, TRACEBACK_FUNCTION);
int err = LUA_OK;
lua_call(L, n, r);

gdb bt:

Program received signal SIGSEGV, Segmentation fault.
0x1015965d in ?? () from C:\Windows\SysWOW64\ig4icd32.dll
(gdb) c
Continuing.

Breakpoint 3, call (L=0x502fe8, n=0, r=0) at lib/ejoy2dgame.c:140
140 lua_call(L, n, r);
(gdb) bt
#0 call (L=0x502fe8, n=0, r=0) at lib/ejoy2dgame.c:140
#1 0x00402cb3 in ejoy2d_game_drawframe (G=0x5017f0) at lib/ejoy2dgame.c:187
#2 0x0040cfdf in ejoy2d_win_frame () at mingw/winfw.c:90
#3 0x0040c8e4 in update_frame (hDC=0xc6012da9) at mingw/window.c:61
#4 0x0040c9df in WndProc@16 (hWnd=0x6a0896, message=15, wParam=0, lParam=0)
at mingw/window.c:83
#5 0x767962fa in USER32!OffsetRect () from C:\Windows\syswow64\user32.dll
#6 0x006a0896 in ?? ()
#7 0x0000000f in ?? ()
#8 0x00000000 in ?? ()
(gdb) c
Continuing.

Program received signal SIGSEGV, Segmentation fault.
0x1015965d in ?? () from C:\Windows\SysWOW64\ig4icd32.dll
(gdb) c
Continuing.

Breakpoint 3, call (L=0x502fe8, n=0, r=0) at lib/ejoy2dgame.c:140
140 lua_call(L, n, r);
(gdb) bt
#0 call (L=0x502fe8, n=0, r=0) at lib/ejoy2dgame.c:140
#1 0x00402cb3 in ejoy2d_game_drawframe (G=0x5017f0) at lib/ejoy2dgame.c:187
#2 0x0040cfdf in ejoy2d_win_frame () at mingw/winfw.c:90
#3 0x0040c8e4 in update_frame (hDC=0x2c012104) at mingw/window.c:61
#4 0x0040c9df in WndProc@16 (hWnd=0x6a0896, message=15, wParam=0, lParam=0)
at mingw/window.c:83
#5 0x767962fa in USER32!OffsetRect () from C:\Windows\syswow64\user32.dll
#6 0x006a0896 in ?? ()
#7 0x0000000f in ?? ()
#8 0x00000000 in ?? ()
(gdb) c
Continuing.
attempt to call a nil valueInferior 1 (process 7128) exited with code 01

from ejoy2d.

cloudwu avatar cloudwu commented on June 12, 2024

改成 lua_call 就是为了看 call 的函数在 c 里哪里出错。不是为了看哪里调用到那里的。

发自我的 iPhone

在 2013年12月29日,下午4:52,marsing [email protected] 写道:

我改成了
//int err = lua_pcall(L, n, r, TRACEBACK_FUNCTION);
int err = LUA_OK;
lua_call(L, n, r);

gdb bt:

(gdb) b 140
Breakpoint 2 at 0x402aa7: file lib/ejoy2dgame.c, line 140.
(gdb) c
Continuing.

Breakpoint 2, call (L=0x692fe8, n=0, r=0) at lib/ejoy2dgame.c:140
140 lua_call(L, n, r);
(gdb) bt
#0 call (L=0x692fe8, n=0, r=0) at lib/ejoy2dgame.c:140
#1 0x00402cb3 in ejoy2d_game_drawframe (G=0x6917f0) at lib/ejoy2dgame.c:187
#2 0x0040cfdf in ejoy2d_win_frame () at mingw/winfw.c:90
#3 0x0040c8e4 in update_frame (hDC=0xd8012d7c) at mingw/window.c:61
#4 0x0040c9df in WndProc@16 (hWnd=0x1030792, message=15, wParam=0, lParam=0)
at mingw/window.c:83
#5 0x767962fa in USER32!OffsetRect () from C:\Windows\syswow64\user32.dll
#6 0x01030792 in ?? ()
#7 0x0000000f in ?? ()
#8 0x00000000 in ?? ()
(gdb)


Reply to this email directly or view it on GitHub.

from ejoy2d.

marsing avatar marsing commented on June 12, 2024

in ejoy2d_game_drawframe (G=0x5017f0) at lib/ejoy2dgame.c 这个不是么?

from ejoy2d.

cloudwu avatar cloudwu commented on June 12, 2024

:( 出错的是 lua_call 的函数中做的事情, 你后面提供的栈信息是没有意义的.

lua_pcall 在 windows 上会将 SEH 捕获, 所以会误输出 error in error handling , 改成 lua_call 后, 应该能看到具体 C 调用出错的位置.

从前一条看,

0x1015965d in ?? () from C:\Windows\SysWOW64\ig4icd32.dll

这个是 Intel 的显卡驱动.

请确认你的驱动支持 OpenGL ES 2.0 以上.

并检查一下是哪条 opengl 调用出错.

from ejoy2d.

marsing avatar marsing commented on June 12, 2024

出问题的电脑是笔记本 显卡是nVIDIA GeForce GT 540M ,更新到最新驱动,测试还是不行。
今天用公司的电脑台式,显卡GT 610,就OK了。

可能是我笔记本的故障,但还没查到问题在哪里。

云风老大 费心了,谢谢, 这个可以关了。

from ejoy2d.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.