* buffer overflow detected *: motion terminated when using %f macro
Question
if you use the %f macro (which expands to the filename of the image / video) then as soon as that event occurs motion exits with the attached error. This is on Fedora Core 5 using an based build of today (01/09/2006) snapshot of the code. I think that this could be related to some of the fixes from for the ffmpeg saving files to .avi and .mpg. Also I think it might well be relivent that this is running on an opteron in x86_64 mode.
[root@dhcp-3-200 motion]# motion -n -d 10
[0] Processing thread 0 - config file motion.conf
[0] Processing config file /etc/motion/F17.conf
[0] Thread 1 is from /etc/motion/F17.conf
[1] Thread started
[1] entered netcam_start()
[1] Camera thread starting...
[0] motion-httpd/3.2.7 running, accepting connections
[0] motion-httpd: waiting for data on port TCP 8080
[1] Received first header
[1] Non-streaming camera
[1] expanding buffer from 0 to 4096 bytes
[1] expanding buffer from 4096 to 8192 bytes
[1] expanding buffer from 8192 to 12288 bytes
[1] expanding buffer from 12288 to 16384 bytes
[1] expanding buffer from 16384 to 20480 bytes
[1] expanding buffer from 20480 to 24576 bytes
[1] expanding buffer from 24576 to 28672 bytes
[1] expanding buffer from 28672 to 32768 bytes
[1] expanding buffer from 32768 to 36864 bytes
[1] expanding buffer from 36864 to 40960 bytes
[1] expanding buffer from 40960 to 45056 bytes
[1] expanding buffer from 45056 to 49152 bytes
[1] Camera handler thread [2] started
[1] netcam_next called with no data in buffer
[1] vid_return_code 6
*** buffer overflow detected ***: motion terminated
======= Backtrace: =========
/lib64/libc.so.6(__chk_fail+0x2f)[0x31625dfaef]
/lib64/libc.so.6[0x31625df34b]
/lib64/libc.so.6(__snprintf_chk+0x7b)[0x31625df21b]
motion[0x4046c1]
motion[0x4118f1]
motion[0x411a79]
motion[0x411844]
motion[0x4126fa]
motion[0x411844]
motion[0x406a3b]
/lib64/libpthread.so.0[0x3163806337]
/lib64/libc.so.6(__clone+0x6d)[0x31625cc38d]
======= Memory map: ========
00400000-00427000 r-xp 00000000 fd:01 656302 /usr/bin/motion
00527000-0052a000 rw-p 00027000 fd:01 656302 /usr/bin/motion
0052a000-0056f000 rw-p 0052a000 00:00 0 [heap]
40000000-40001000 ---p 40000000 00:00 0
40001000-40a01000 rw-p 40001000 00:00 0
40a01000-40a02000 ---p 40a01000 00:00 0
40a02000-41402000 rw-p 40a02000 00:00 0
41402000-41403000 ---p 41402000 00:00 0
41403000-41e03000 rw-p 41403000 00:00 0
3162300000-316231a000 r-xp 00000000 fd:00 196611 /lib64/ld-2.4.so
3162419000-316241a000 r--p 00019000 fd:00 196611 /lib64/ld-2.4.so
316241a000-316241b000 rw-p 0001a000 fd:00 196611 /lib64/ld-2.4.so
3162500000-316263f000 r-xp 00000000 fd:00 196615 /lib64/libc-2.4.so
316263f000-316273f000 ---p 0013f000 fd:00 196615 /lib64/libc-2.4.so
316273f000-3162743000 r--p 0013f000 fd:00 196615 /lib64/libc-2.4.so
3162743000-3162744000 rw-p 00143000 fd:00 196615 /lib64/libc-2.4.so
3162744000-3162749000 rw-p 3162744000 00:00 0
3162800000-3162821000 r-xp 00000000 fd:01 689237 /usr/lib64/libjpeg.so.62.0.0
3162821000-3162921000 ---p 00021000 fd:01 689237 /usr/lib64/libjpeg.so.62.0.0
3162921000-3162922000 rw-p 00021000 fd:01 689237 /usr/lib64/libjpeg.so.62.0.0
3162a00000-3162a80000 r-xp 00000000 fd:00 196654 /lib64/libm-2.4.so
3162a80000-3162b80000 ---p 00080000 fd:00 196654 /lib64/libm-2.4.so
3162b80000-3162b81000 r--p 00080000 fd:00 196654 /lib64/libm-2.4.so
3162b81000-3162b82000 rw-p 00081000 fd:00 196654 /lib64/libm-2.4.so
3163000000-3163014000 r-xp 00000000 fd:01 688393 /usr/lib64/libz.so.1.2.3
3163014000-3163113000 ---p 00014000 fd:01 688393 /usr/lib64/libz.so.1.2.3
3163113000-3163114000 rw-p 00013000 fd:01 688393 /usr/lib64/libz.so.1.2.3
3163200000-3163214000 r-xp 00000000 fd:00 196753 /lib64/libnsl-2.4.so
3163214000-3163313000 ---p 00014000 fd:00 196753 /lib64/libnsl-2.4.so
3163313000-3163314000 r--p 00013000 fd:00 196753 /lib64/libnsl-2.4.so
3163314000-3163315000 rw-p 00014000 fd:00 196753 /lib64/libnsl-2.4.so
3163315000-3163317000 rw-p 3163315000 00:00 0
3163400000-3163405000 r-xp 00000000 fd:00 196760 /lib64/libcrypt-2.4.so
3163405000-3163504000 ---p 00005000 fd:00 196760 /lib64/libcrypt-2.4.so
3163504000-3163505000 r--p 00004000 fd:00 196760 /lib64/libcrypt-2.4.so
3163505000-3163506000 rw-p 00005000 fd:00 196760 /lib64/libcrypt-2.4.so
3163506000-3163534000 rw-p 3163506000 00:00 0
3163800000-3163812000 r-xp 00000000 fd:00 196628 /lib64/libpthread-2.4.so
3163812000-3163912000 ---p 00012000 fd:00 196628 /lib64/libpthread-2.4.so
3163912000-3163913000 r--p 00012000 fd:00 196628 /lib64/libpthread-2.4.so
3163913000-3163914000 rw-p 00013000 fd:00 196628 /lib64/libpthread-2.4.so
3163914000-3163918000 rw-p 3163914000 00:00 0
3163a00000-3163a11000 r-xp 00000000 fd:00 196636 /lib64/libresolv-2.4.so
3163a11000-3163b11000 ---p 00011000 fd:00 196636 /lib64/libresolv-2.4.so
3163b11000-3163b12000 r--p 00011000 fd:00 196636 /lib64/libresolv-2.4.so
3163b12000-3163b13000 rw-p 00012000 fd:00 196636 /lib64/libresolv-2.4.so
3163b13000-3163b15000 rw-p 3163b13000 00:00 0
3163c00000-3163c0d000 r-xp 00000000 fd:00 196660 /lib64/libgcc_s-4.1.1-20060525.so.1
3163c0d000-3163d0d000 ---p 0000d000 fd:00 196660 /lib64/libgcc_s-4.1.1-20060525.so.1
3163d0d000-3163d0e000 rw-p 0000d000 fd:00 196660 /lib64/libgcc_s-4.1.1-20060525.so.1
3163e00000-3163e02000 r-xp 00000000 fd:00 196638 /lib64/libcom_err.so.2.1
3163e02000-3163f01000 ---p 00002000 fd:00 196638 /lib64/libcom_err.so.2.1
3163f01000-3163f02000 rw-p 00001000 fd:00 196638 /lib64/libcom_err.so.2.1
3164600000-3164617000 r-xp 00000000 fd:01 688385 /usr/lib64/libgssapi_krb5.so.2.2
3164617000-3164717000 ---p 00017000 fd:01 688385 /usr/lib64/libgssapi_krb5.so.2.2
3164717000-3164718000 rw-p 00017000 fd:01 688385 /usr/lib64/libgssapi_krb5.so.2.2
3164800000-3164874000 r-xp 00000000 fd:01 688383 /usr/lib64/libkrb5.so.3.2
3164874000-3164974000 ---p 00074000 fd:01 688383 /usr/lib64/libkrb5.so.3.2
3164974000-3164978000 rw-p 00074000 fd:01 688383 /usr/lib64/libkrb5.so.3.2
3164a00000-3164a03000 r-xp 00000000 fd:01 688378 /usr/lib64/libkrb5support.so.0.0
3164a03000-3164b02000 ---p 00003000 fd:01 688378 /usr/lib64/libkrb5support.so.0.0
3164b02000-3164b03000 rw-p 00002000 fd:01 688378 /usr/lib64/libkrb5support.so.0.0
3164c00000-3164c22000 r-xp 00000000 fd:01 688381 /usr/lib64/libk5crypto.so.3.0
3164c22000-3164d21000 ---p 00022000 fd:01 688381 /usr/lib64/libk5crypto.so.3.0
3164d21000-3164d23000 rw-p 00021000 fd:01 688381 /usr/lib64/libk5crypto.so.3.0
3164e00000-3164f27000 r-xp 00000000 fd:00 196646 /lib64/libcrypto.so.0.9.8a
3164f27000-3165027000 ---p 00127000 fd:00 196646 /lib64/libcrypto.so.0.9.8a
3165027000-3165047000 rw-p 00127000 fd:00 196646 /lib64/libcrypto.so.0.9.8a
3165047000-316504a000 rw-p 3165047000 00:00 0
3165100000-3165143000 r-xp 00000000 fd:00 196648 /lib64/libssl.so.0.9.8a
3165143000-3165243000 ---p 00043000 fd:00 196648 /lib64/libssl.so.0.9.8a
3165243000-3165249000 rw-p 00043000 fd:00 196648 /lib64/libssl.so.0.9.8a
2aaaaaaab000-2aaaaaaac000 rw-p 2aaaaaaab000 00:00 0
2aaaaaab5000-2aaaaaab7000 rw-p 2aaaaaab5000 00:00 0
2aaaaaab7000-2aaaaab28000 r-xp 00000000 fd:01 689653 /usr/lib64/libavformat.so.50.5.0
2aaaaab28000-2aaaaac28000 ---p 00071000 fd:01 689653 /usr/lib64/libavformat.so.50.5.0
2aaaaac28000-2aaaaac32000 rw-p 00071000 fd:01 689653 /usr/lib64/libavformat.so.50.5.0
2aaaaac32000-2aaaaaee8000 r-xp 00000000 fd:01 689651 /usr/lib64/libavcodec.so.51.11.0
2aaaaaee8000-2aaaaafe8000 ---p 002b6000 fd:01 689651 /usr/lib64/libavcodec.so.51.11.0
2aaaaafe8000-2aaaaaff8000 rw-p 002b6000 fd:01 689651 /usr/lib64/libavcodec.so.51.11.0
2aaaaaff8000-2aaaab058000 rw-p 2aaaaaff8000 00:00 0
2aaaab058000-2aaaab180000 r-xp 00000000 fd:01 753872 /usr/lib64/mysql/libmysqlclient.so.15.0.0
2aaaab180000-2aaaab27f000 ---p 00128000 fd:01 753872 /usr/lib64/mysql/libmysqlclient.so.15.0.0
2aaaab27f000-2aaaab2c6000 rw-p 00127000 fd:01 753872 /usr/lib64/mysql/libmysqlclient.so.15.0.0
2aaaab2c6000-2aaaab2c7000 rw-p 2aaaab2c6000 00:00 0
2aaaab2c7000-2aaaab2e7000 r-xp 00000000 fd:01 689412 /usr/lib64/libpq.so.4.1
2aaaab2e7000-2aaaab3e7000 ---p 00020000 fd:01 689412 /usr/lib64/libpq.so.4.1
2aaaab3e7000-2aaaab3e9000 rw-p 00020000 fd:01 689412 /usr/lib64/libpq.so.4.1
2aaaab3e9000-2aaaab3ea000 rw-p 2aaaab3e9000 00:00 0
2aaaab3ea000-2aaaab3ee000 r-xp 00000000 fd:01 689655 /usr/lib64/libavutil.so.49.0.0
2aaaab3ee000-2aaaab4ed000 ---p 00004000 fd:01 689655 /usr/lib64/libavutil.so.49.0.0
2aaaab4ed000-2aaaab4ee000 rw-p 00003000 fd:01 689655 /usr/lib64/libavutil.so.49.0.0
2aaaab4ee000-2aaaab4f3000 r-xp 00000000 fd:01 689621 /usr/lib64/libogg.so.0.5.3
2aaaab4f3000-2aaaab5f2000 ---p 00005000 fd:01 689621 /usr/lib64/libogg.so.0.5.3
2aaaab5f2000-2aaaab5f3000 rw-p 00004000 fd:01 689621 /usr/lib64/libogg.so.0.5.3
2aaaab5f3000-2aaaab5f5000 r-xp 00000000 fd:00 196632 /lib64/libdl-2.4.so
2aaaab5f5000-2aaaab6f5000 ---p 00002000 fd:00 196632 /lib64/libdl-2.4.so
2aaaab6f5000-2aaaab6f6000 r--p 00002000 fd:00 196632 /lib64/libdl-2.4.so
2aaaab6f6000-2aaaab6f7000 rw-p 00003000 fd:00 196632 /lib64/libdl-2.4.so
2aaaab6f7000-2aaaab6f8000 rw-p 2aaaab6f7000 00:00 0
2aaaab6f8000-2aaaab705000 r-xp 00000000 fd:01 689641 /usr/lib64/libgsm.so.1.0.10
2aaaab705000-2aaaab804000 ---p 0000d000 fd:01 689641 /usr/lib64/libgsm.so.1.0.10
2aaaab804000-2aaaab805000 rw-p 0000c000 fd:01 689641 /usr/lib64/libgsm.so.1.0.10
2aaaab805000-2aaaab84a000 r-xp 00000000 fd:01 689645 /usr/lib64/libmp3lame.so.0.0.0
2aaaab84a000-2aaaab949000 ---p 00045000 fd:01 689645 /usr/lib64/libmp3lame.so.0.0.0
2aaaab949000-2aaaab94b000 rw-p 00044000 fd:01 689645 /usr/lib64/libmp3lame.so.0.0.0
2aaaab94b000-2aaaab99f000 rw-p 2aaaab94b000 00:00 0
2aaaab99f000-2aaaab9bc000 r-xp 00000000 fd:01 689623 /usr/lib64/libvorbis.so.0.3.1
2aaaab9bc000-2aaaababc000 ---p 0001d000 fd:01 689623 /usr/lib64/libvorbis.so.0.3.1
2aaaababc000-2aaaabacb000 rw-p 0001d000 fd:01 689623 /usr/lib64/libvorbis.so.0.3.1
2aaaabacb000-2aaaabacc000 rw-p 2aaaabacb000 00:00 0
2aaaabacc000-2aaaabae6000 r-xp 00000000 fd:01 689625 /usr/lib64/libvorbisenc.so.2.0.2
2aaaabae6000-2aaaabbe6000 ---p 0001a000 fd:01 689625 /usr/lib64/libvorbisenc.so.2.0.2
2aaaabbe6000-2aaaabda5000 rw-p 0001a000 fd:01 689625 /usr/lib64/libvorbisenc.so.2.0.2
2aaaabda5000-2aaaabdaa000 rw-p 2aaaabda5000 00:00 0
2aaaabdaa000-2aaaabe16000 r-xp 00000000 fd:01 689647 /usr/lib64/libxvidcore.so.4.1
2aaaabe16000-2aaaabf16000 ---p 0006c000 fd:01 689647 /usr/lib64/libxvidcore.so.4.1
2aaaabf16000-2aaaabf17000 rw-p 0006c000 fd:01 689647 /usr/lib64/libxvidcore.so.4.1
2aaaabf17000-2aaaabf8a000 rw-p 2aaaabf17000 00:00 0
2aaaabf8a000-2aaaabf98000 r-xp 00000000 fd:01 689631 /usr/lib64/libfaac.so.0.0.0
2aaaabf98000-2aaaac098000 ---p 0000e000 fd:01 689631 /usr/lib64/libfaac.so.0.0.0
2aaaac098000-2aaaac09b000 rw-p 0000e000 fd:01 689631 /usr/lib64/libfaac.so.0.0.0
2aaaac09b000-2aaaac09c000 rw-p 2aaaac09b000 00:00 0
2aaaac09c000-2aaaac0df000 r-xp 00000000 fd:01 689643 /usr/lib64/libfaad.so.0.0.0
2aaaac0df000-2aaaac1de000 ---p 00043000 fd:01 689643 /usr/lib64/libfaad.so.0.0.0
2aaaac1de000-2aaaac1e1000 rw-p 00042000 fd:01 689643 /usr/lib64/libfaad.so.0.0.0
2aaaac1e1000-2aaaac1e3000 rw-p 2aaaac1e1000 00:00 0
2aaaac1e3000-2aaaac2cb000 r-xp 00000000 fd:01 689008 /usr/lib64/libstdc++.so.6.0.8
2aaaac2cb000-2aaaac3cb000 ---p 000e8000 fd:01 689008 /usr/lib64/libstdc++.so.6.0.8
2aaaac3cb000-2aaaac3d1000 r--p 000e8000 fd:01 689008 /usr/lib64/libstdc++.so.6.0.8
2aaaac3d1000-2aaaac3d4000 rw-p 000ee000 fd:01 689008 /usr/lib64/libstdc++.so.6.0.8
2aaaac3d4000-2aaaac3e6000 rw-p 2aaaac3d4000 00:00 0
2aaaac3e6000-2aaaac486000 r-xp 00000000 fd:01 689629 /usr/lib64/libmp4v2.so.0.0.0
2aaaac486000-2aaaac586000 ---p 000a0000 fd:01 689629 /usr/lib64/libmp4v2.so.0.0.0
2aaaac586000-2aaaac58c000 rw-p 000a0000 fd:01 689629 /usr/lib64/libmp4v2.so.0.0.0
2aaaac58c000-2aaaac591000 rw-p 2aaaac58c000 00:00 0
2aaaac600000-2aaaac621000 rw-p 2aaaac600000 00:00 0
2aaaac621000-2aaaac700000 ---p 2aaaac621000 00:00 0
2aaaac700000-2aaaac70a000 r-xp 00000000 fd:00 196637 /lib64/libnss_files-2.4.so
2aaaac70a000-2aaaac809000 ---p 0000a000 fd:00 196637 /lib64/libnss_files-2.4.so
2aaaac809000-2aaaac80a000 r--p 00009000 fd:00 196637 /lib64/libnss_files-2.4.so
2aaaac80a000-2aaaac80b000 rw-p 0000a000 fd:00 196637 /lib64/libnss_files-2.4.so
2aaaac80b000-2aaaac80f000 r-xp 00000000 fd:00 196635 /lib64/libnss_dns-2.4.so
2aaaac80f000-2aaaac90f000 ---p 00004000 fd:00 196635 /lib64/libnss_dns-2.4.so
2aaaac90f000-2aaaac910000 r--p 00004000 fd:00 196635 /lib64/libnss_dns-2.4.so
2aaaac910000-2aaaac911000 rw-p 00005000 fd:00 196635 /lib64/libnss_dns-2.4.so
2aaaac982000-2aaaad5d7000 rw-p 2aaaac982000 00:00 0
7fffa273c000-7fffa2752000 rw-p 7fffa273c000 00:00 0 [stack]
ffffffffff600000-ffffffffffe00000 ---p 00000000 00:00 0 [vdso]
Environment
Motion version: |
3.2.7 |
ffmpeg version: |
0.4.9-0.23.20060817.lvn5 |
Libraries: |
ffmpeg, mysql, postgresql |
Server OS: |
Fedora Core 5 / 2.6.17-1.2174_FC5 |
--
TimFletcher - 01 Sep 2006
Answer
It is difficult to verify this because I do not have a 64 bit OS, I do not have an opteron either.
This has been open since Sep 2006 so I have to close it unanswered.
Reopen if anyone has something new to add.
--
KennethLavrsen - 26 Jul 2007