__汇编函数(gdb)中的__kernel_vsyscall

问题描述 投票:0回答:1

我在提供正确输出的函数中有一个__kernel_vsyscall错误,但是程序永远不会越过它并给出__kernel_vsyscall错误。C函数:

void f1(int* input, int* output, int nbElements);

汇编器功能(GAS)。我无法发布全部内容,因为它是一项作业,并且我不希望有人复制它。

f1:
    push %ebp
    mov %esp, %ebp

    movl $0, %ecx
    movl $0, %ebx

    jmp for_loop1

for_loop1:

    cmpl %ecx, 16(%ebp)
    jb end
    movl $0, %ebx
    jmp for_loop2

for_loop2:
    /*move input elements to output elements*/
    cmpl %ecx, %ebx
    jmp incr_2

incr_2:

    addl $1, %ebx
    cmpl %ebx, 16(%ebp)
    jb incr_1
    jmp for_loop2

incr_1:
    addl $1, %ecx
    jmp for_loop1

end:        
    addl $8, %esp               
    leave
    ret

程序终止时出错:

malloc(): invalid size (unsorted)
Aborted (core dumped)

使用带有coredump文件的gdb调试时出错:

For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from ./program_name...
[New LWP 2634]

warning: Loadable section ".note.gnu.property" outside of ELF segments
Core was generated by `./program_name'.
Program terminated with signal SIGABRT, Aborted.
#0  0xf7f35ac9 in __kernel_vsyscall ()

我尝试查看地址0xf7f35ac9是什么,它返回-402652697或另一个随机值。

[局部变量在0xff83b1fc附近,在指针中存储的值在0x80cab30附近,以前声明的函数在0x8049fc4附近,并且堆栈的值在0xff49c附近,所以我不知道它在哪里。] >

谢谢

我在提供正确输出的函数中有一个__kernel_vsyscall错误,但是程序永远不会越过它并给出__kernel_vsyscall错误。 C函数:void f1(int *输入,int *输出,...

c malloc sigabrt gas att
1个回答
0
投票

我可以通过更改来解决问题

© www.soinside.com 2019 - 2024. All rights reserved.