-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Segment Fault format.c:1412 in set_font #76
Comments
Sorry for I have no such a crash in my system (ARM 32 bits). |
I remove some line in the poc , and I reproduce the crash in my system(x86 64bit). I also tried to run it in qemu-arm-static, as you said, I didn't get the crash either. May be it is relevant to the system bit. root@ubuntu:# uname -a |
There are still a lot of tunes, a lot of lines and a lot of notes. |
Oh, your're right......pocx produce another crash. And I tried my best to reduce the poc ,unfortunately, I can only reproduce with the full file. |
I found a X64 computer and I build abcm2ps, but then I had no crash with any of your files (including the one of the issue #73). |
I re-compile abcm2ps with 'clang' and dynamically linked with the glibc, I didn't get the crash either. But when I compile abcm2ps with 'gcc-5.4', the crash return again. I debug the code with GDB, and I found the glocal variable I spent a lot time on finding the bug code. I think I found which line modified the address of #0 0x000000000043242b in get_staves (s=0x7fffffffdd00) at parse.c:2528 at ../csu/libc-start.c:291 #9 0x0000000000403689 in _start () |
That was big bug, and well hidden! It should be fixed by the commit 74fc325. |
gdb-peda$ set args ./pocs/poc4
gdb-peda$ run
Starting program: /root/Intriguer/intriguer/opensoft/abc2music/origin/abcm2ps ./pocs/poc4
abcm2ps-8.14.9 (2020-06-21)
File ./pocs/poc4
./pocs/poc4:26:2: error: Cannot identify meter top
26 M:Cÿÿ/4
^
./pocs/poc4:30:4: error: Not a note
30 [KgC# alto]rigin
^
./pocs/poc4:30:5: error: Not a note
30 [KgC# alto]rigin
^
./pocs/poc4:30:10: error: Not a note
30 [KgC# alto]rigin
^
./pocs/poc4:30:16: error: Not a note
30 [KgC# alto]rigin
^
./pocs/poc4:30:1: error: Chord not closed
30 [KgC# alto]rigin
^
./pocs/poc4:30:0: error: Bad character 'n'
./pocs/poc4:30:0: error: Bad character 'i'
./pocs/poc4:30:0: error: Bad character 'i'
./pocs/poc4:30:0: error: Bad character 'r'
./pocs/poc4:30:0: error: Bad character 'o'
./pocs/poc4:30:0: error: Bad character 't'
./pocs/poc4:30:0: error: Bad character 'l'
./pocs/poc4:30:0: error: Bad character 'K'
./pocs/poc4:33:0: error: Voice '2' of %%staves has no symbol
./pocs/poc4:33:0: error: Misplaced ']' in %%staves
./pocs/poc4:33:0: error: Bad voice ID in %%staves
./pocs/poc4:33:0: error: Voice 'CEGc' of %%staves has no symbol
./pocs/poc4:67:23: error: Bad character
67 !fine!C!invertedfermataD !longphrase!E !mediumphrase!F !mf!G!open!A !p!B...
^
./pocs/poc4:65:31: error: Decoration !cresc(! not defined
./pocs/poc4:65:58: error: Too many words in lyric line
./pocs/poc4:67:11: error: Bad character 'n'
./pocs/poc4:67:11: error: Bad character 'i'
./pocs/poc4:67:14: error: Bad character 't'
./pocs/poc4:67:14: error: Bad character 'r'
./pocs/poc4:67:20: error: Bad character 'm'
./pocs/poc4:67:20: error: Bad character 'r'
./pocs/poc4:67:22: error: Bad character 't'
./pocs/poc4:67:24: warning: Not enough words for lyric line
Program received signal SIGSEGV, Segmentation fault.
, argc=0x2, argv=0x7fffffffe508, init=, fini=, rtld_fini=, stack_end=0x7fffffffe4f8)[----------------------------------registers-----------------------------------]
RAX: 0xa0000 ('')
RBX: 0xb ('\x0b')
RCX: 0x0
RDX: 0x1
RSI: 0x44c627 --> 0x20656c7469540020 (' ')
RDI: 0xb ('\x0b')
RBP: 0xa0000 ('')
RSP: 0x7fffffffdd20 --> 0xffffffffffffffff
RIP: 0x41f771 (<set_font+193>: mov rcx,QWORD PTR [rax8+0x668c60])
R8 : 0x0
R9 : 0x1
R10: 0xf
R11: 0x7ffff788bf60 --> 0xfff1ee20fff1ee10
R12: 0x1
R13: 0x1
R14: 0x0
R15: 0x0
EFLAGS: 0x10202 (carry parity adjust zero sign trap INTERRUPT direction overflow)
[-------------------------------------code-------------------------------------]
0x41f763 <set_font+179>: mov edx,DWORD PTR [rip+0x247277] # 0x6669e0 <file_initialized>
0x41f769 <set_font+185>: test edx,edx
0x41f76b <set_font+187>: jle 0x41f818 <set_font+360>
=> 0x41f771 <set_font+193>: mov rcx,QWORD PTR [rax8+0x668c60]
0x41f779 <set_font+201>: mov edx,0x449890
0x41f77e <set_font+206>: xor esi,esi
0x41f780 <set_font+208>: mov edi,0x1
0x41f785 <set_font+213>: xor eax,eax
[------------------------------------stack-------------------------------------]
0000| 0x7fffffffdd20 --> 0xffffffffffffffff
0008| 0x7fffffffdd28 --> 0x9 ('\t')
0016| 0x7fffffffdd30 --> 0x675640 ("Composer (Origin)")
0024| 0x7fffffffdd38 --> 0x4364ea (<str_ft_out1+58>: test BYTE PTR [rip+0x22cdd7],0x1 # 0x6632c8 )
0032| 0x7fffffffdd40 --> 0xffffffff
0040| 0x7fffffffdd48 --> 0x675649 ("(Origin)")
0048| 0x7fffffffdd50 --> 0x675640 ("Composer (Origin)")
0056| 0x7fffffffdd58 --> 0x4366fe (<str_ft_out+478>: jmp 0x4366b5 <str_ft_out+405>)
[------------------------------------------------------------------------------]
Legend: code, data, rodata, value
Stopped reason: SIGSEGV
set_font (ft=0xb) at format.c:1412
1412 error(1, NULL,
gdb-peda$ bt
#0 set_font (ft=0xb) at format.c:1412
#1 0x00000000004364ea in str_ft_out1 (p=p@entry=0x675640 <tex_buf> "Composer (Origin)", l=l@entry=0x9) at subs.c:822
#2 0x00000000004366fe in str_ft_out (p=0x675649 <tex_buf+9> "(Origin)", end=0x1) at subs.c:896
#3 0x00000000004371ec in str_out (p=, action=) at subs.c:942
#4 0x0000000000437214 in put_str (str=str@entry=0x7fffffffdda0 "Composer (Origin)", action=action@entry=0x2) at subs.c:980
#5 0x00000000004381f0 in put_inf2r (s1=, s1@entry=0x6e4960, s2=, s2@entry=0x6e4bc0, action=action@entry=0x2) at subs.c:1026
#6 0x000000000043928d in write_heading () at subs.c:1783
#7 0x0000000000433036 in get_info (s=s@entry=0x6e5530) at parse.c:2913
#8 0x0000000000435068 in do_tune () at parse.c:3501
#9 0x00000000004088e2 in abc_parse (p=0x694370 "", fname=fname@entry=0x692560 "./pocs/poc4", ln=ln@entry=0x54) at abcparse.c:179
#10 0x000000000041fa17 in txt_add_eos (fname=fname@entry=0x692560 "./pocs/poc4", linenum=linenum@entry=0x54) at front.c:379
#11 0x0000000000420478 in frontend (s=0x693f76 "\nX:8\nT:Decorations on two voices\nT:(also in 'd:' lines)\n%%infoline 1\nC:Composer\nO:Or@",
s@entry=0x6937a0 "% Sample file to test various features of abcm2ps\n%%footer abcm2ps - sample2\n\nU: N = !tenuto!\n\nX:1\nT:All clefs\nM:C\nL:1/4\nK:C bass\n"^bass"G,CEG|[K:bass3]"^bass3"G,CEG|[K:alto4]"^alto4"G,CEG|[K:alto]"^a"..., ftype=ftype@entry=0x0, fname=fname@entry=0x692560 "./pocs/poc4", linenum=, linenum@entry=0x0) at front.c:891
#12 0x0000000000403fdd in treat_file (fn=0x7fffffffe78c "./pocs/poc4", ext=) at abcm2ps.c:240
#13 0x0000000000403118 in main (argc=0x0, argc@entry=0x2, argv=, argv@entry=0x7fffffffe508) at abcm2ps.c:1041
#14 0x00007ffff7724840 in __libc_start_main (main=0x4029e0
at ../csu/libc-start.c:291
#15 0x0000000000403689 in _start ()
poc4.zip
The text was updated successfully, but these errors were encountered: