Work at SourceForge, help us to make it a better place! We have an immediate need for a Support Technician in our San Francisco or Denver office.

Close

Velvet not working: Buffer overflow

felt-users
hsrai
2011-04-03
2013-04-17
  • hsrai
    hsrai
    2011-04-03

    I compiled Felt 3.07, on Ubuntu 10.10, it gave warnings during compilation, but felt worked in console mode. However velvet's execution aborted with buffer overflow detected (see below signature).

    What can be done?

    • H.S.Rai

    $ velvet
    *** buffer overflow detected ***: velvet terminated
    ======= Backtrace: =========
    /lib/libc.so.6(__fortify_fail+0x50)
    /lib/libc.so.6(+0xe486a)
    /lib/libc.so.6(+0xe3fa8)
    /lib/libc.so.6(_IO_default_xsputn+0x9e)
    /lib/libc.so.6(_IO_vfprintf+0xe34)
    /lib/libc.so.6(__vsprintf_chk+0xad)
    /lib/libc.so.6(__sprintf_chk+0x2d)
    velvet
    velvet
    /lib/libc.so.6(__libc_start_main+0xe7)
    velvet
    ======= Memory map: ========
    00110000-00125000 r-xp 00000000 08:07 272948     /lib/libpthread-2.12.1.so
    00125000-00126000 --p 00015000 08:07 272948     /lib/libpthread-2.12.1.so
    00126000-00127000 r-p 00015000 08:07 272948     /lib/libpthread-2.12.1.so
    00127000-00128000 rw-p 00016000 08:07 272948     /lib/libpthread-2.12.1.so
    00128000-0012a000 rw-p 00000000 00:00 0
    0012a000-00179000 r-xp 00000000 08:07 2100049    /usr/lib/libXt.so.6.0.0
    00179000-0017a000 r-p 0004e000 08:07 2100049    /usr/lib/libXt.so.6.0.0
    0017a000-0017d000 rw-p 0004f000 08:07 2100049    /usr/lib/libXt.so.6.0.0
    0017d000-0017f000 r-xp 00000000 08:07 2098095    /usr/lib/libXdamage.so.1.1.0
    0017f000-00180000 r-p 00001000 08:07 2098095    /usr/lib/libXdamage.so.1.1.0
    00180000-00181000 rw-p 00002000 08:07 2098095    /usr/lib/libXdamage.so.1.1.0
    00181000-00185000 r-xp 00000000 08:07 2100063    /usr/lib/libXxf86vm.so.1.0.0
    00185000-00186000 r-p 00003000 08:07 2100063    /usr/lib/libXxf86vm.so.1.0.0
    00186000-00187000 rw-p 00004000 08:07 2100063    /usr/lib/libXxf86vm.so.1.0.0
    00187000-0018f000 r-xp 00000000 08:07 265291     /lib/libdrm.so.2.4.0
    0018f000-00190000 r-p 00008000 08:07 265291     /lib/libdrm.so.2.4.0
    00190000-00191000 rw-p 00009000 08:07 265291     /lib/libdrm.so.2.4.0
    00191000-001a0000 r-xp 00000000 08:07 2100041    /usr/lib/libXpm.so.4.11.0
    001a0000-001a1000 r-p 0000e000 08:07 2100041    /usr/lib/libXpm.so.4.11.0
    001a1000-001a2000 rw-p 0000f000 08:07 2100041    /usr/lib/libXpm.so.4.11.0
    001a2000-001a9000 r-xp 00000000 08:07 272950     /lib/librt-2.12.1.so
    001a9000-001aa000 r-p 00006000 08:07 272950     /lib/librt-2.12.1.so
    001aa000-001ab000 rw-p 00007000 08:07 272950     /lib/librt-2.12.1.so
    001ab000-001af000 r-xp 00000000 08:07 2099047    /usr/lib/libXdmcp.so.6.0.0
    001af000-001b0000 r-p 00003000 08:07 2099047    /usr/lib/libXdmcp.so.6.0.0
    001b0000-001b1000 rw-p 00004000 08:07 2099047    /usr/lib/libXdmcp.so.6.0.0
    001b1000-001b9000 r-xp 00000000 08:07 2099079    /usr/lib/libXrender.so.1.3.0
    001b9000-001ba000 r-p 00007000 08:07 2099079    /usr/lib/libXrender.so.1.3.0
    001ba000-001bb000 rw-p 00008000 08:07 2099079    /usr/lib/libXrender.so.1.3.0
    001d1000-001d3000 r-xp 00000000 08:07 272937     /lib/libdl-2.12.1.so
    001d3000-001d4000 r-p 00001000 08:07 272937     /lib/libdl-2.12.1.so
    001d4000-001d5000 rw-p 00002000 08:07 272937     /lib/libdl-2.12.1.so
    0021c000-00240000 r-xp 00000000 08:07 272938     /lib/libm-2.12.1.so
    00240000-00241000 r-p 00023000 08:07 272938     /lib/libm-2.12.1.so
    00241000-00242000 rw-p 00024000 08:07 272938     /lib/libm-2.12.1.so
    00242000-00399000 r-xp 00000000 08:07 272934     /lib/libc-2.12.1.so
    00399000-0039b000 r-p 00157000 08:07 272934     /lib/libc-2.12.1.so
    0039b000-0039c000 rw-p 00159000 08:07 272934     /lib/libc-2.12.1.so
    0039c000-0039f000 rw-p 00000000 00:00 0
    0040a000-0041f000 r-xp 00000000 08:07 2100035    /usr/lib/libXmu.so.6.2.0
    0041f000-00420000 r-p 00014000 08:07 2100035    /usr/lib/libXmu.so.6.2.0
    00420000-00421000 rw-p 00015000 08:07 2100035    /usr/lib/libXmu.so.6.2.0
    00421000-00500000 r-xp 00000000 08:07 2098823    /usr/lib/libstdc++.so.6.0.14
    00500000-00504000 r-p 000de000 08:07 2098823    /usr/lib/libstdc++.so.6.0.14
    00504000-00505000 rw-p 000e2000 08:07 2098823    /usr/lib/libstdc++.so.6.0.14
    00505000-0050c000 rw-p 00000000 00:00 0
    0055c000-00576000 r-xp 00000000 08:07 264588     /lib/libgcc_s.so.1
    00576000-00577000 r-p 00019000 08:07 264588     /lib/libgcc_s.so.1
    00577000-00578000 rw-p 0001a000 08:07 264588     /lib/libgcc_s.so.1
    00654000-00670000 r-xp 00000000 08:07 272931     /lib/ld-2.12.1.so
    00670000-00671000 r-p 0001b000 08:07 272931     /lib/ld-2.12.1.so
    00671000-00672000 rw-p 0001c000 08:07 272931     /lib/ld-2.12.1.so
    00819000-00932000 r-xp 00000000 08:07 2099073    /usr/lib/libX11.so.6.3.0
    00932000-00933000 r-p 00118000 08:07 2099073    /usr/lib/libX11.so.6.3.0
    00933000-00935000 rw-p 00119000 08:07 2099073    /usr/lib/libX11.so.6.3.0
    00935000-00936000 rw-p 00000000 00:00 0
    00952000-00998000 r-xp 00000000 08:07 2105499    /usr/lib/mesa/libGL.so.1.2
    00998000-00999000 --p 00046000 08:07 2105499    /usr/lib/mesa/libGL.so.1.2
    00999000-0099e000 r-p 00046000 08:07 2105499    /usr/lib/mesa/libGL.so.1.2
    0099e000-009a3000 rwxp 0004b000 08:07 2105499    /usr/lib/mesa/libGL.so.1.2
    009a3000-009a5000 rwxp 00000000 00:00 0
    009b5000-00a0b000 r-xp 00000000 08:07 2100013    /usr/lib/libXaw7.so.7.0.0
    00a0b000-00a0c000 r-p 00055000 08:07 2100013    /usr/lib/libXaw7.so.7.0.0
    00a0c000-00a12000 rw-p 00056000 08:07 2100013    /usr/lib/libXaw7.so.7.0.0
    00a12000-00a13000 rw-p 00000000 00:00 0
    00a2f000-00a32000 r-xp 00000000 08:07 263233     /lib/libuuid.so.1.3.0
    00a32000-00a33000 r-p 00002000 08:07 263233     /lib/libuuid.so.1.3.0
    00a33000-00a34000 rw-p 00003000 08:07 263233     /lib/libuuid.so.1.3.0
    00a93000-00a97000 r-xp 00000000 08:07 2098062    /usr/lib/libXfixes.so.3.1.0
    00a97000-00a98000 r-p 00003000 08:07 2098062    /usr/lib/libXfixes.so.3.1.0
    00a98000-00a99000 rw-p 00004000 08:07 2098062    /usr/lib/libXfixes.so.3.1.0
    00b51000-00b59000 r-xp 00000000 08:07 2098093    /usr/lib/libXcursor.so.1.0.2
    00b59000-00b5a000 r-p 00007000 08:07 2098093    /usr/lib/libXcursor.so.1.0.2
    00b5a000-00b5b000 rw-p 00008000 08:07 2098093    /usr/lib/libXcursor.so.1.0.2
    00bcc000-00bcd000 r-xp 00000000 00:00 0         
    00c0c000-00c24000 r-xp 00000000 08:07 2099057    /usr/lib/libxcb.so.1.1.0
    00c24000-00c25000 r-p 00017000 08:07 2099057    /usr/lib/libxcb.so.1.1.0
    00c25000-00c26000 rw-p 00018000 08:07 2099057    /usr/lib/libxcb.so.1.1.0
    00c41000-00c43000 r-xp 00000000 08:07 2107552    /usr/lib/libGLw.so.1.0.0
    00c43000-00c44000 r-p 00001000 08:07 2107552    /usr/lib/libGLw.so.1.0.0
    00c44000-00c45000 rw-p 00002000 08:07 2107552    /usr/lib/libGLw.so.1.0.0
    00dd6000-00de4000 r-xp 00000000 08:07 2098058    /usr/lib/libXext.so.6.4.0
    00de4000-00de5000 r-p 0000d000 08:07 2098058    /usr/lib/libXext.so.6.4.0
    00de5000-00de6000 rw-p 0000e000 08:07 2098058    /usr/lib/libXext.so.6.4.0
    00e1c000-00e89000 r-xp 00000000 08:07 2111816    /usr/lib/libGLU.so.1.3.070900
    00e89000-00e8a000 --p 0006d000 08:07 2111816    /usr/lib/libGLU.so.1.3.070900
    00e8a000-00e8b000 r-p 0006d000 08:07 2111816    /usr/lib/libGLU.so.1.3.070900
    00e8b000-00e8c000 rw-p 0006e000 08:07 2111816    /usr/lib/libGLU.so.1.3.070900
    00ebe000-00ec5000 r-xp 00000000 08:07 2100004    /usr/lib/libSM.so.6.0.1
    00ec5000-00ec6000 r-p 00006000 08:07 2100004    /usr/lib/libSM.so.6.0.1Aborted

     
  • For some reason, if velvet is compiled with optimization, it segfaults at start-up. A quick way to make it work, is to build velvet without optimization: Go to src/Velvet/Makefile, and add at the end of the line that begins with CFLAGS the argument "-O0", which disables optimizations. See the following patch for details:

    http://github.com/pavossos/felt/commit/93c5f2cd347d80ff2528f3010f065a4b21d6d308

    Please tell me if it works for you.