tj / luna

luna programming language - a small, elegant VM implemented in C
2.46k stars 148 forks source link

Program received signal SIGSEGV, Segmentation fault #101

Open EnchantedJohn opened 6 years ago

EnchantedJohn commented 6 years ago

then luna is crashed by my crash file.I think it is also caused by High truncation.then I want to show my error information to help your guys.

gdb crash information:

(gdb) run /home/lx/DIVE/Trunk/bin/hfl/output/2014113C514B5678181A5B721E6B693F638486/hfl-crash-365-{rva_0x43C2}{code_0xB}{access_0x7fe56e4b8000}{luna}heapoverflow[returnaddr=luna.0x133B, addr=0x00007fe56e4bc000,0x10]
Starting program: /home/lx/5_30/luna/luna-master/luna /home/lx/DIVE/Trunk/bin/hfl/output/2014113C514B5678181A5B721E6B693F638486/hfl-crash-365-{rva_0x43C2}{code_0xB}{access_0x7fe56e4b8000}{luna}heapoverflow[returnaddr=luna.0x133B, addr=0x00007fe56e4bc000,0x10]

Program received signal SIGSEGV, Segmentation fault.
__GI_fseek (fp=0x0, offset=0, whence=2) at fseek.c:38
38  fseek.c: No such file or directory.
EnchantedJohn commented 6 years ago

bt information:

(gdb) bt
#0  __GI_fseek (fp=0x0, offset=0, whence=2) at fseek.c:38
#1  0x000000000040cc26 in file_size (stream=0x0) at src/utils.c:23
#2  0x000000000040cc7c in file_read (
    filename=0x7fffffffe519 "/home/lx/DIVE/Trunk/bin/hfl/output/2014113C514B5678181A5B721E6B693F638486/hfl-crash-365-{rva_0x43C2}{code_0xB}{access_0x7fe56e4b8000}{luna}heapoverflow[returnaddr=luna.0x133B,")
    at src/utils.c:36
#3  0x000000000040575a in main (argc=3, argv=0x7fffffffe278) at src/luna.c:199
(gdb) i r
rax            0x0  0
rbx            0x0  0
rcx            0x0  0
rdx            0x2  2
rsi            0x0  0
rdi            0x0  0
rbp            0x7fffffffdfe0   0x7fffffffdfe0
rsp            0x7fffffffdfa0   0x7fffffffdfa0
r8             0x7ffff7fc7740   140737353905984
r9             0x0  0
r10            0x0  0
r11            0x7ffff777c8d0   140737345210576
r12            0x401220 4198944
r13            0x7fffffffe270   140737488347760
r14            0x0  0
r15            0x0  0
rip            0x7ffff777c8dc   0x7ffff777c8dc <__GI_fseek+12>
eflags         0x10206  [ PF IF RF ]
cs             0x33 51
ss             0x2b 43
ds             0x0  0
es             0x0  0
fs             0x0  0
gs             0x0  0
EnchantedJohn commented 6 years ago

gdb information :

(gdb) x/10i $pc
=> 0x7ffff777c8dc <__GI_fseek+12>:  mov    (%rdi),%eax
   0x7ffff777c8de <__GI_fseek+14>:  and    $0x8000,%eax
   0x7ffff777c8e3 <__GI_fseek+19>:  jne    0x7ffff777c937 <__GI_fseek+103>
   0x7ffff777c8e5 <__GI_fseek+21>:  mov    0x88(%rdi),%r8
   0x7ffff777c8ec <__GI_fseek+28>:  mov    %fs:0x10,%rbp
   0x7ffff777c8f5 <__GI_fseek+37>:  cmp    0x8(%r8),%rbp
   0x7ffff777c8f9 <__GI_fseek+41>:  je     0x7ffff777c932 <__GI_fseek+98>
   0x7ffff777c8fb <__GI_fseek+43>:  mov    $0x1,%esi
   0x7ffff777c900 <__GI_fseek+48>:  cmpl   $0x0,0x35676d(%rip)        # 0x7ffff7ad3074 <__libc_multiple_threads>
   0x7ffff777c907 <__GI_fseek+55>:  je     0x7ffff777c916 <__GI_fseek+70>