Skip to content
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

Crash in abcm2ps at buffer.c #104

Closed
irfanariq opened this issue Aug 30, 2021 · 2 comments
Closed

Crash in abcm2ps at buffer.c #104

irfanariq opened this issue Aug 30, 2021 · 2 comments

Comments

@irfanariq
Copy link

Hello,

We are currently working on fuzz testing feature, and we found a crash on abcm2ps.

The stack traces are as follow:

warning: Possible buffer overflow
=================================================================
==616==ERROR: AddressSanitizer: memcpy-param-overlap: memory ranges [0x631000000800,0x6310000105e6) and [0x631000000823, 0x631000010609) overlap
    #0 0x7fa84d5c5425  (/usr/lib/x86_64-linux-gnu/libasan.so.4+0x79425)
    #1 0x55cb9853c8ac in write_buffer .../abcm2ps-git/buffer.c:894
    #2 0x55cb9853b46e in a2b .../abcm2ps-git/buffer.c:749
    #3 0x55cb9856085c in draw_note .../abcm2ps-git/draw.c:1843
    #4 0x55cb9857a1d1 in draw_symbols .../abcm2ps-git/draw.c:4744
    #5 0x55cb9857b211 in draw_all_symb .../abcm2ps-git/draw.c:4866
    #6 0x55cb985b98ae in output_music .../abcm2ps-git/music.c:5120
    #7 0x55cb985c089a in generate .../abcm2ps-git/parse.c:1042
    #8 0x55cb985c0c22 in gen_ly .../abcm2ps-git/parse.c:1063
    #9 0x55cb985ce717 in get_info .../abcm2ps-git/parse.c:3057
    #10 0x55cb985d2815 in do_tune .../abcm2ps-git/parse.c:3510
    #11 0x55cb98523d60 in abc_eof .../abcm2ps-git/abcparse.c:202
    #12 0x55cb9858c9f7 in frontend .../abcm2ps-git/front.c:906
    #13 0x55cb98520154 in treat_file .../abcm2ps-git/abcm2ps.c:240
    #14 0x55cb98520272 in treat_abc_file .../abcm2ps-git/abcm2ps.c:283
    #15 0x55cb98522d45 in main .../abcm2ps-git/abcm2ps.c:1041

Here is the full stack trace :
stacktrace_abcm2ps_3.zip

Step to reproduce

We configured abcm2ps using CFLAGS="-g -O0 -fsanitize=address" LDFLAGS="-g -O0 -fsanitize=address" ./configure --disable-shared and built in using make -j10; make install, and run it with:

./abcm2ps <attached file> -O /dev/null

Attachment:
input_abcm2ps_3.zip

Environment

  • OS: Ubuntu 18.04.5 LTS
  • GCC version: gcc 7.5.0
  • abcm2ps version: latest commit of master branch on git (link)

Thank you.

moinejf added a commit that referenced this issue Aug 31, 2021
@moinejf
Copy link
Collaborator

moinejf commented Sep 11, 2021

The problem should be fixed by the commit d880797.

@irfanariq
Copy link
Author

Yes, I have tried and the problem did not occur anymore. I will close the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants