Eventual SEGFAULT, EXC_BAD_ACCESS

21 views
Skip to first unread message

Sean

unread,
Oct 17, 2013, 10:45:28 AM10/17/13
to asmji...@googlegroups.com
First, I absolutely love this framework.  I have a situation where I need to constantly build and compile new sequences.  It works fine for a bit, but eventually it seems to bug out.  I've written tests for all my assembly generating code, and it all works on a single iteration just fine, but eventually, this error seems to occur.

Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x000000000000000d
0x0000000104b395d9 in AsmJit::ECall::translate (this=0x7f8f63864d68, cc=@0x7fff5b57fe38) at /Users/sean/libs/asmjit/AsmJit/CompilerX86X64.cpp:3604
3604            if (rdst->inDone >= rdst->inCount && (rdst->flags & VarCallRecord::FLAG_CALL_OPERAND_REG) == 0) 

Backtrace:
 
#0  0x0000000104b395d9 in AsmJit::ECall::translate (this=0x7f8f63864d68, cc=@0x7fff5b57fe38) at /Users/sean/libs/asmjit/AsmJit/CompilerX86X64.cpp:3604
#1  0x0000000104b43c15 in AsmJit::CompilerCore::serialize (this=0x7fff5b580238, a=@0x7fff5b5800d0) at /Users/sean/libs/asmjit/AsmJit/CompilerX86X64.cpp:7729
#2  0x0000000104b43826 in AsmJit::CompilerCore::make (this=0x7fff5b580238) at /Users/sean/libs/asmjit/AsmJit/CompilerX86X64.cpp:7615

Any guidance would be appreciated.  It seems that this is occurring when the assembly reaches a certain level of complexity and depth, and my guess is the _zone is running out of free space to allocate?

Thanks,
Sean

Petr Kobalíček

unread,
Oct 17, 2013, 11:08:15 AM10/17/13
to asmjit-dev
Hi Sean,

the issue you are facing is actually an assertion failure. If you put a breakpoint into the assert.cpp file you should be able to catch it.

I know the issue and it's been already reported as #86:


You can't use immediates when calling a function at the moment, it will be fixed soon.

Thanks for using AsmJit!

Best,
Petr


--
 
---
You received this message because you are subscribed to the Google Groups "asmjit-dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email to asmjit-dev+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Sean

unread,
Oct 18, 2013, 7:28:16 AM10/18/13
to asmji...@googlegroups.com
Thanks Petr, that did fix the problem.  It turned out that calls to functions ceil, floor, and abs, which were using XMMVar for args and return were failing.  Hope that information helps.  Given a complex enough or long enough chain of calls, eventually these values were somehow "infected" and caused the crash.  But under most circumstances, they seemed to run fine.  I replaced the calls with straight assembly implementations and the problem went away.

Thanks,
Sean
Reply all
Reply to author
Forward
0 new messages