O
O
Oleg Ilyushin2014-03-05 12:43:58
assembler
Oleg Ilyushin, 2014-03-05 12:43:58

How to fix SIGSEGV when calling MOVDQA?

Google says this is most likely a stack alignment error as SSE instructions require alignment up to 16 bytes. If so, where else do I need to call alignment? After all, the previous MOVDQA instructions are executed without errors.
Code snippet that causes a segmentation fault.

.p2align 6
        movdqa	64(%rsp), %xmm0
        movdqa	80(%rsp), %xmm1
        movdqa	96(%rsp), %xmm2
        movdqa	112(%rsp), %xmm3
        movdqa	128+64(%rsp), %xmm8
        movdqa	128+80(%rsp), %xmm9
        movdqa	128+96(%rsp), %xmm10
        movdqa	128+112(%rsp), %xmm11
        movdqa	256+64(%rsp), %xmm12
        movdqa	256+80(%rsp), %xmm13
        movdqa	256+96(%rsp), %xmm14
        movdqa	256+112(%rsp), %xmm15

        movq	%rsi, %rbx
        leaq	3*131072(%rsi), %rax

        movdqa	%xmm0, 64(%rbx)  #sigsegv received
        movdqa	%xmm1, 80(%rbx)

Answer the question

In order to leave comments, you need to log in

4 answer(s)
J
jcmvbkbc, 2014-03-05
@zmeykas

most likely stack alignment error

movdqa argument alignment error, not necessarily the stack.
@zmeykas and in which one did you already call it? The stack should be aligned, not the code.
You can form a 16-byte-aligned stack frame, for example, like this:
my_asm_function:
        pushq   %rbp
        movq    %rsp, %rbp
        subq    $512, %rsp    # минимальный размер кадра -- 512 байт
        andq    $-16, %rsp    # выравнивание по 16 байт
...
        popq   %rbp
        ret

But your rbx is not aligned, and it is taken from the second argument of the function. Equal it. Well, or don't use movdqa, but use movdqu

A
Alexey Ukolov, 2015-06-07
@clickshop

https://css-tricks.com/navigation-in-lists-to-be-o...

D
Danil Namaste, 2015-06-07
@htmlcssverstka

The only difference will be in the css code. The classic style is to do the menu through the list.

O
Oleg Nogin, 2015-06-07
@noname1488

Bootstrap is the easiest. There are examples there.
getbootstrap.com/components.nav-tabs.nav
_

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question