what is cause for 'tcg fatal error'?

866 views
Skip to first unread message

selmixxx

unread,
Jun 10, 2010, 6:37:57 PM6/10/10
to android-ndk
i have working native code, when i test it in emulator it works (only
very slowly)

i do some little change (for example comment one line so some action
doesn't happen). when application gets to the point where native code
should be executed emulator immediately crashes with error:
external/qemu/tcg/tcg.c:1329: tcg fatal error

so i revert the change, but result is the same
external/qemu/tcg/tcg.c:1329: tcg fatal error

since then i can do whatever i want, no change. then next day i
relaunch application and suddenly it works. exactly same source code
which was crashing day before

just in case its important - i use ubuntu 10.04 64bit, computer has
3GB of memory and 2.1GHz dual core athlon processor. emulator is very
slow on this setup but until now i was able to use it to debug my
programs. i started to have problems only since i had to begin with
ndk.

what could be reason for this? what does this error message means? why
it happens only in native code? if it happens where should i search
for reason?

thanks in advance

David Turner

unread,
Jun 10, 2010, 9:41:11 PM6/10/10
to andro...@googlegroups.com
tcg is the code generator used by the emulator to translate ARM machine code into x86.
You seem to have catched an internal tcg error, this is weird. There is an ARM instruction sequence
in your machine code, which generates a series of micro-ops that TCG cannot handle properly.

this is very weird, and very rare. I would appreciate if you had some way to reproduce the problem
consistently.


--
You received this message because you are subscribed to the Google Groups "android-ndk" group.
To post to this group, send email to andro...@googlegroups.com.
To unsubscribe from this group, send email to android-ndk...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/android-ndk?hl=en.


Angus Lees

unread,
Jun 10, 2010, 10:02:29 PM6/10/10
to andro...@googlegroups.com
I can reproduce this error most of the time at a particular stage of
my (native) game. It will be extremely awkward to track down exactly
what assembly ops are involved from inside the emulator, since it
explodes immediately when you hit the problem - is there anything we
can learn from the outside of the emulator? (eg: extra debugging
dumps, gdb traces, etc)

Seemingly uninteresting changes in my code alters whether this happens
or not, so the debugging might become complicated :/

selmixxx: Does your code use GL by any chance? I never saw this
problem until I changed my code to use GL extensively.

 - Gus

selmixxx

unread,
Jun 11, 2010, 4:44:33 AM6/11/10
to android-ndk
Angus Lees wrote:
> selmixxx: Does your code use GL by any chance? I never saw this
> problem until I changed my code to use GL extensively.
>

no, i compiled some parts of ffmpeg (libavcodec, libavformat,
libavutil) and made few simple (for now) functions on top of them.
however because these ffmpeg libraries are part of code i doubt i will
be ever able to find what is causing tcg fatal error problem ...too
many possibilities (final library is ~700kB stripped)

Onur Cinar

unread,
Jun 11, 2010, 11:58:42 AM6/11/10
to android-ndk

Hi Selmixx,

Just for reference, which version of the SDK are you using?

I was looking into the qemu code, looks like it is happening in one of
the register related functions, but I couldn't find the exact place
yet.

Looks like some of ffmpeg ARM optimizations confused qemu.

Regards,

-onur



---
www.zdo.com

selmixxx

unread,
Jun 11, 2010, 6:20:14 PM6/11/10
to android-ndk

On Jun 11, 5:58 pm, Onur Cinar <onur.ci...@gmail.com> wrote:
> Hi Selmixx,
>
> Just for reference, which version of the SDK are you using?

i am using android sdk for android-2.2, android-ndk-r4 and i build
native code using provided gcc for arm-eabi-4.4.0

Reply all
Reply to author
Forward
0 new messages