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

Autotrace -centerline option gives segmentation fault #8

Closed
ThSGM opened this issue Aug 27, 2018 · 5 comments
Closed

Autotrace -centerline option gives segmentation fault #8

ThSGM opened this issue Aug 27, 2018 · 5 comments
Labels

Comments

@ThSGM
Copy link

ThSGM commented Aug 27, 2018

With the help of @jnweiger and his autotrace fork I have been able to build autotrace for OSX 10.11 and 10.13.

It works with the following command:

autotrace -output-file test.svg -output-format svg -report-progress test_image.bmp

However, if I use the `-centerline' option:

autotrace -centerline -output-file test.svg -output-format svg -report-progress test_image.bmp

It gives me the following errors:

test_image.bmp|Magick: abort due to signal 11 (SIGSEGV) "Segmentation Fault"...
[1]    11733 abort      autotrace -centerline -output-file test.svg -output-format svg
@lemenkov
Copy link
Member

Could you please attach test_image.bmp?

@ThSGM
Copy link
Author

ThSGM commented Aug 28, 2018

@lemenkov

Thanks. It does seem to be image dependent. I've tested it on the two images below in the zip file. One is half the size of the other. It works on the smaller of the two. So

autotrace -centerline -output-file test.svg -output-format svg -report-progress trace02.bmp

works but trace01.bmp does not.

Archive.zip

@jnweiger
Copy link
Member

jnweiger commented Aug 29, 2018

I can reproduce the crash on Ubuntu18.04

Core was generated by `autotrace -centerline -output-file test.svg -output-format svg trace01.bmp'.
Program terminated with signal SIGSEGV, Segmentation fault.
0x00007ffff7bbd39a in at_bitmap_get_color (bitmap=0x555555787de0, row=285, col=4294967295, color=0x7fffffffda65) at src/autotrace.c:210
210	    at_color_set(color, p[0], p[1], p[2]);
(gdb) where
#0  0x00007ffff7bbd39a in at_bitmap_get_color (bitmap=0x555555787de0, row=285, col=4294967295, color=0x7fffffffda65)
    at src/autotrace.c:210
#1  0x00007ffff7bbf38e in is_valid_dir (row=284, col=0, dir=SOUTHWEST, bitmap=0x555555787de0, marked=0x555555787d40)
    at src/pxl-outline.c:208
#2  0x00007ffff7bc017e in find_centerline_pixels (bitmap=0x555555787de0, bg_color=..., notify_progress=0x0, progress_data=0x7fffffffdcdc, test_cancel=0x0, testcancel_data=0x0, exp=0x7fffffffdc50) at src/pxl-outline.c:256
#3  0x00007ffff7bbd7f4 in at_splines_new_full (bitmap=0x555555787de0, opts=0x555555787ce0, msg_func=0x555555557b28 <exception_handler>, msg_data=0x0, notify_progress=0x0, progress_data=0x7fffffffdcdc, test_cancel=0x0, testcancel_data=0x0) at src/autotrace.c:289
#4  0x0000555555556564 in main (argc=7, argv=0x7fffffffde38) at src/main.c:147
(gdb) 

@jnweiger
Copy link
Member

Manually using imagemagick convert trace01.bmp trace01.pbm produces a pbm image that works fine. Converting to png does not work for me, it prints a chunk error like
y[B8][AD][D9]: invalid chunk type -- but that is probably a different issue.

@martweb1
Copy link

Should now work fine with the patches provided here:
#15

@lemenkov lemenkov reopened this Apr 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants