mofarrell / p2pvc

A point to point color terminal video chat.
MIT License
2.89k stars 212 forks source link

segfault when defining width of more than 99 #25

Closed jose1711 closed 9 years ago

jose1711 commented 9 years ago

as soon as i define video width of more than 99 chars, p2pvc segfaults

emgram769 commented 9 years ago

Whoops didn't mean to close that. This is surprising because the default width is 100. I've been testing -d 170x50 pretty rigorously, perhaps you could give that a go?

jose1711 commented 9 years ago

170x50 segfaults as well. should i recompile with debug symbols?

emgram769 commented 9 years ago

yea that'd be useful. I can't seem to replicate the error. what OS/version of open cv are you using?

jirutka commented 9 years ago

Height more than 99 chars works well for me, even 1000 works, but height more than 433 segfaults. OS X 10.9.5, opencv 2.4.10.1

UPDATE: It doesn’t depend on exact value of height, or width, but both of them. I’m on the meeting, so I can’t provide more detail now.

jose1711 commented 9 years ago

arch linux (current), opencv 2.4.10-2

[Thread 0xaa84fb40 (LWP 22597) exited] [New Thread 0xaa84fb40 (LWP 22598)] [New Thread 0xa5efeb40 (LWP 22599)] [New Thread 0xa54ffb40 (LWP 22600)] [New Thread 0xa4cfeb40 (LWP 22601)] [New Thread 0xa04fcb40 (LWP 22602)]  Program received signal SIGABRT, Aborted. 0xb7fdcbcc in __kernel_vsyscall () (gdb) bt full

0 0xb7fdcbcc in __kernel_vsyscall ()

No symbol table info available.

1 0xb77f7ca7 in raise () from /usr/lib/libc.so.6

No symbol table info available.

2 0xb77f92e9 in abort () from /usr/lib/libc.so.6

No symbol table info available.

3 0xb7485de5 in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/libstdc++.so.6

No symbol table info available.

4 0xb74838e3 in cxxabiv1::terminate(void (*)()) () from /usr/lib/libstdc++.so.6

No symbol table info available.

5 0xb748395d in std::terminate() () from /usr/lib/libstdc++.so.6

No symbol table info available.

6 0xb7483c21 in __cxa_throw () from /usr/lib/libstdc++.so.6

No symbol table info available.

7 0xb7e28e8c in cv::error(cv::Exception const&) () from /usr/lib/libopencv_core.so.2.4

No symbol table info available.

8 0xb7ab3345 in cv::resize(cv::_InputArray const&, cv::OutputArray const&, cv::Size, double, double, int) () from /usr/lib/libopencv_imgproc.so.2.4

No symbol table info available.

9 0xb7abf1ba in cvResize () from /usr/lib/libopencv_imgproc.so.2.4

No symbol table info available.

10 0x0804eed2 in start_video ()

No symbol table info available.

11 0x08049e11 in main ()

No symbol table info available.

jose1711 commented 9 years ago

possibly better backtrace:

Starting program: /usr/bin/p2pvc 127.0.0.1 -v -b -d 120x130 warning: Could not load shared library symbols for linux-gate.so.1. Do you need "set solib-search-path" or "set sysroot"? [Thread debugging using libthread_db enabled] Using host libthread_db library "/usr/lib/libthread_db.so.1". [New Thread 0xb0d99b40 (LWP 2690)] [New Thread 0xb0398b40 (LWP 2691)] [?7h[?25l[?1c[New Thread 0xaf9ffb40 (LWP 2692)] [New Thread 0xaa871b40 (LWP 2693)] [Thread 0xaa871b40 (LWP 2693) exited] [New Thread 0xaa871b40 (LWP 2694)] [Thread 0xaa871b40 (LWP 2694) exited] [New Thread 0xaa871b40 (LWP 2695)] [Thread 0xaa871b40 (LWP 2695) exited] [New Thread 0xaa871b40 (LWP 2696)] [Thread 0xaa871b40 (LWP 2696) exited] [New Thread 0xaa871b40 (LWP 2697)] [New Thread 0xa5efeb40 (LWP 2698)] [New Thread 0xa54ffb40 (LWP 2699)] [New Thread 0xa4cfeb40 (LWP 2700)] [New Thread 0xa44fdb40 (LWP 2701)]  Program received signal SIGABRT, Aborted. 0xb7fdcbcc in __kernel_vsyscall () (gdb) bt

0 0xb7fdcbcc in __kernel_vsyscall ()

1 0xb77f7ca7 in raise () from /usr/lib/libc.so.6

2 0xb77f92e9 in abort () from /usr/lib/libc.so.6

3 0xb7485de5 in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/libstdc++.so.6

4 0xb74838e3 in cxxabiv1::terminate(void (_)()) () from /usr/lib/libstdc++.so.6

5 0xb748395d in std::terminate() () from /usr/lib/libstdc++.so.6

6 0xb7483c21 in __cxa_throw () from /usr/lib/libstdc++.so.6

7 0xb7e28e8c in cv::error(cv::Exception const&) () from /usr/lib/libopencv_core.so.2.4

8 0xb7ab3345 in cv::resize(cv::_InputArray const&, cv::OutputArray const&, cv::Size, double, double, int) () from /usr/lib/libopencv_imgproc.so.2.4

9 0xb7abf1ba in cvResize () from /usr/lib/libopencv_imgproc.so.2.4

10 0x0804f208 in start_video (peer=0xbffffbb9 "127.0.0.1", port=0x805275b "55556", vopt=0xbffff934) at src/video.c:109

11 0x08049f16 in main (argc=6, argv=0xbffffa34) at src/p2pvc.c:168

(gdb) bt full

0 0xb7fdcbcc in __kernel_vsyscall ()

No symbol table info available.

1 0xb77f7ca7 in raise () from /usr/lib/libc.so.6

No symbol table info available.

2 0xb77f92e9 in abort () from /usr/lib/libc.so.6

No symbol table info available.

3 0xb7485de5 in __gnu_cxx::__verbose_terminate_handler() () from /usr/lib/libstdc++.so.6

No symbol table info available.

4 0xb74838e3 in cxxabiv1::terminate(void (_)()) () from /usr/lib/libstdc++.so.6

No symbol table info available.

5 0xb748395d in std::terminate() () from /usr/lib/libstdc++.so.6

No symbol table info available.

6 0xb7483c21 in __cxa_throw () from /usr/lib/libstdc++.so.6

No symbol table info available.

7 0xb7e28e8c in cv::error(cv::Exception const&) () from /usr/lib/libopencv_core.so.2.4

No symbol table info available.

8 0xb7ab3345 in cv::resize(cv::_InputArray const&, cv::OutputArray const&, cv::Size, double, double, int) () from /usr/lib/libopencv_imgproc.so.2.4

No symbol table info available.

9 0xb7abf1ba in cvResize () from /usr/lib/libopencv_imgproc.so.2.4

No symbol table info available.

10 0x0804f208 in start_video (peer=0xbffffbb9 "127.0.0.1", port=0x805275b "55556", vopt=0xbffff934) at src/video.c:109

    line_index = <optimized out>
    dopt = {intensity_threshold = 0, saturation = -1, ascii_values = 0x0, monochrome = 0, r = 0 '\000', g = 0 '\000', b = 0 '\000'}
    thr = 2946497344
    color_img = <optimized out>
    resize_img = 0x808db70
    edge = 0x808dc10
    line_buffer = 0xbffff710 ""
    tim = {tv_sec = 0, tv_nsec = 49999999}
    actual_tim = {tv_sec = 0, tv_nsec = 8388608}
    kernel = 7

11 0x08049f16 in main (argc=6, argv=0xbffffa34) at src/p2pvc.c:168

    thr = 2956561216
    netopts = {ipaddr = 0xbffffbb9 "127.0.0.1", port = 0x8052761 "55555"}
    peer = <optimized out>
    audio_port = <optimized out>
    video_port = <optimized out>
    vopt = {width = 120, height = 0, depth = 0, disp_bandwidth = 1, render_type = 0, refresh_rate = 20, intensity_threshold = 0, saturation = -1, monochrome = 0, r = 0 '\000', g = 0 '\000', 
      b = 0 '\000', ascii_values = 0x0, edge_filter = 0, edge_lower = 0, edge_upper = 0}
    spawn_video = <optimized out>
    print_error = <optimized out>
    c = <optimized out>
    width = 120
    height = 0

(gdb) quit A debugging session is active.

Inferior 1 [process 2686] will be killed.
emgram769 commented 9 years ago

what was your command line input? -d 120x0 ?

jose1711 commented 9 years ago

127.0.0.1 -v -b -d 120x130

jose1711 commented 9 years ago

same with colon as a delimiter. i can see height = 0 in backtrace

emgram769 commented 9 years ago

yup, that code actually broke on some versions of gcc. swapped it out with better code. pull the latest it should be fixed. removed the : option for simplicity

jose1711 commented 9 years ago

thank you, that did it. i can now safely go with 205x82