Package: cmake
Version: 2.8.7-4
Severity: normal

Dear Maintainer,

To reproduce this bug, please download this source code:

http://chipmunk-physics.net/release/ChipmunkLatest.tgz

I tested it on version 6.0.3. Unfortunately, I did not find a link for
persistent versions of the source code on the website. So it would be
good to download the source before it is updated.

Then apply the cpack.diff file, which enables the use of CPack.

then run:

    cmake .
    make

If I run this command, I get a .tar.gz bundle:

    cpack -G TGZ

Those commands work for me.

If I run this command, desiring a .zip file bundle, I get a Segfault:

    cpack -G ZIP

I've attached the valgrind output log to this email.

I tried running the same commands (minus the need to patch) on a version
of minetest 0.4 from 3/26/12, but did not get a segfault when trying to
build the ZIP file or the TGZ file.

https://github.com/celeron55/minetest/tarball/master


I hope this helps.

Thanks,
-Andrew


*** End of the template - remove these lines ***


-- System Information:
Debian Release: wheezy/sid
  APT prefers testing
  APT policy: (700, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_US.utf8, LC_CTYPE=en_US.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages cmake depends on:
ii  cmake-data         2.8.7-4
ii  libarchive12       3.0.3-7
ii  libc6              2.13-27
ii  libcurl3-gnutls    7.24.0-1
ii  libexpat1          2.1.0~beta3-2
ii  libgcc1            1:4.6.3-1
ii  libstdc++6         4.6.3-1
ii  libxmlrpc-core-c3  1.16.33-3.1
ii  procps             1:3.3.2-3
ii  zlib1g             1:1.2.6.dfsg-2

cmake recommends no packages.

Versions of packages cmake suggests:
ii  gcc   4:4.6.2-4
ii  make  3.81-8.1

-- no debconf information

CPack: Create package using ZIP
CPack: Install projects
CPack: - Run preinstall target for: chipmunk
CPack: - Install project: chipmunk
CPack: Create package
rerun with -h for copyright info
==6859== Command: cpack -G ZIP
==6859== 
==6859== Syscall param ioctl(generic) points to uninitialised byte(s)
==6859==    at 0x5DC8957: ioctl (syscall-template.S:82)
==6859==    by 0x507FB23: ??? (in 
/usr/lib/x86_64-linux-gnu/libarchive.so.12.0.3)
==6859==    by 0x507FE32: archive_read_disk_entry_from_file (in 
/usr/lib/x86_64-linux-gnu/libarchive.so.12.0.3)
==6859==    by 0x4AFB85: cmArchiveWrite::AddFile(char const*, unsigned long, 
char const*) (in /usr/bin/cpack)
==6859==    by 0x4AFD44: cmArchiveWrite::AddPath(char const*, unsigned long, 
char const*) (in /usr/bin/cpack)
==6859==    by 0x4AFFBF: cmArchiveWrite::Add(std::string, unsigned long, char 
const*) (in /usr/bin/cpack)
==6859==    by 0x4AE360: cmCPackArchiveGenerator::PackageFiles() (in 
/usr/bin/cpack)
==6859==    by 0x48AB4A: cmCPackGenerator::DoPackage() (in /usr/bin/cpack)
==6859==    by 0x47FDCC: main (in /usr/bin/cpack)
==6859==  Address 0x7feffd2c4 is on thread 1's stack
==6859== 
==6859== Conditional jump or move depends on uninitialised value(s)
==6859==    at 0x507FB51: ??? (in 
/usr/lib/x86_64-linux-gnu/libarchive.so.12.0.3)
==6859==    by 0x507FE32: archive_read_disk_entry_from_file (in 
/usr/lib/x86_64-linux-gnu/libarchive.so.12.0.3)
==6859==    by 0x4AFB85: cmArchiveWrite::AddFile(char const*, unsigned long, 
char const*) (in /usr/bin/cpack)
==6859==    by 0x4AFD44: cmArchiveWrite::AddPath(char const*, unsigned long, 
char const*) (in /usr/bin/cpack)
==6859==    by 0x4AFFBF: cmArchiveWrite::Add(std::string, unsigned long, char 
const*) (in /usr/bin/cpack)
==6859==    by 0x4AE360: cmCPackArchiveGenerator::PackageFiles() (in 
/usr/bin/cpack)
==6859==    by 0x48AB4A: cmCPackGenerator::DoPackage() (in /usr/bin/cpack)
==6859==    by 0x47FDCC: main (in /usr/bin/cpack)
==6859== 
==6859== Conditional jump or move depends on uninitialised value(s)
==6859==    at 0x507FB6E: ??? (in 
/usr/lib/x86_64-linux-gnu/libarchive.so.12.0.3)
==6859==    by 0x507FE32: archive_read_disk_entry_from_file (in 
/usr/lib/x86_64-linux-gnu/libarchive.so.12.0.3)
==6859==    by 0x4AFB85: cmArchiveWrite::AddFile(char const*, unsigned long, 
char const*) (in /usr/bin/cpack)
==6859==    by 0x4AFD44: cmArchiveWrite::AddPath(char const*, unsigned long, 
char const*) (in /usr/bin/cpack)
==6859==    by 0x4AFFBF: cmArchiveWrite::Add(std::string, unsigned long, char 
const*) (in /usr/bin/cpack)
==6859==    by 0x4AE360: cmCPackArchiveGenerator::PackageFiles() (in 
/usr/bin/cpack)
==6859==    by 0x48AB4A: cmCPackGenerator::DoPackage() (in /usr/bin/cpack)
==6859==    by 0x47FDCC: main (in /usr/bin/cpack)
==6859== 
==6859== Conditional jump or move depends on uninitialised value(s)
==6859==    at 0x507FBE3: ??? (in 
/usr/lib/x86_64-linux-gnu/libarchive.so.12.0.3)
==6859==    by 0x507FE32: archive_read_disk_entry_from_file (in 
/usr/lib/x86_64-linux-gnu/libarchive.so.12.0.3)
==6859==    by 0x4AFB85: cmArchiveWrite::AddFile(char const*, unsigned long, 
char const*) (in /usr/bin/cpack)
==6859==    by 0x4AFD44: cmArchiveWrite::AddPath(char const*, unsigned long, 
char const*) (in /usr/bin/cpack)
==6859==    by 0x4AFFBF: cmArchiveWrite::Add(std::string, unsigned long, char 
const*) (in /usr/bin/cpack)
==6859==    by 0x4AE360: cmCPackArchiveGenerator::PackageFiles() (in 
/usr/bin/cpack)
==6859==    by 0x48AB4A: cmCPackGenerator::DoPackage() (in /usr/bin/cpack)
==6859==    by 0x47FDCC: main (in /usr/bin/cpack)
==6859== 
==6859== Invalid read of size 1
==6859==    at 0x40293A2: strlen (in 
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==6859==    by 0x4AF97B: cmArchiveWrite::AddData(char const*, unsigned long) 
(in /usr/bin/cpack)
==6859==    by 0x4AFCAC: cmArchiveWrite::AddFile(char const*, unsigned long, 
char const*) (in /usr/bin/cpack)
==6859==    by 0x4AFD44: cmArchiveWrite::AddPath(char const*, unsigned long, 
char const*) (in /usr/bin/cpack)
==6859==    by 0x4AFFBF: cmArchiveWrite::Add(std::string, unsigned long, char 
const*) (in /usr/bin/cpack)
==6859==    by 0x4AE360: cmCPackArchiveGenerator::PackageFiles() (in 
/usr/bin/cpack)
==6859==    by 0x48AB4A: cmCPackGenerator::DoPackage() (in /usr/bin/cpack)
==6859==    by 0x47FDCC: main (in /usr/bin/cpack)
==6859==  Address 0x0 is not stack'd, malloc'd or (recently) free'd
==6859== 
==6859== 
==6859== Process terminating with default action of signal 11 (SIGSEGV)
==6859==  Access not within mapped region at address 0x0
==6859==    at 0x40293A2: strlen (in 
/usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so)
==6859==    by 0x4AF97B: cmArchiveWrite::AddData(char const*, unsigned long) 
(in /usr/bin/cpack)
==6859==    by 0x4AFCAC: cmArchiveWrite::AddFile(char const*, unsigned long, 
char const*) (in /usr/bin/cpack)
==6859==    by 0x4AFD44: cmArchiveWrite::AddPath(char const*, unsigned long, 
char const*) (in /usr/bin/cpack)
==6859==    by 0x4AFFBF: cmArchiveWrite::Add(std::string, unsigned long, char 
const*) (in /usr/bin/cpack)
==6859==    by 0x4AE360: cmCPackArchiveGenerator::PackageFiles() (in 
/usr/bin/cpack)
==6859==    by 0x48AB4A: cmCPackGenerator::DoPackage() (in /usr/bin/cpack)
==6859==    by 0x47FDCC: main (in /usr/bin/cpack)
==6859==  If you believe this happened as a result of a stack
==6859==  overflow in your program's main thread (unlikely but
==6859==  possible), you can try to increase the size of the
==6859==  main thread stack using the --main-stacksize= flag.
==6859==  The main thread stack size used in this run was 8388608.
==6859== 
==6859== HEAP SUMMARY:
==6859==     in use at exit: 505,857 bytes in 4,932 blocks
==6859==   total heap usage: 29,393 allocs, 24,461 frees, 12,674,210 bytes 
allocated
==6859== 
==6859== LEAK SUMMARY:
==6859==    definitely lost: 120 bytes in 2 blocks
==6859==    indirectly lost: 480 bytes in 20 blocks
==6859==      possibly lost: 243,771 bytes in 2,783 blocks
==6859==    still reachable: 261,486 bytes in 2,127 blocks
==6859==         suppressed: 0 bytes in 0 blocks
==6859== Rerun with --leak-check=full to see details of leaked memory
==6859== 
==6859== For counts of detected and suppressed errors, rerun with: -v
==6859== Use --track-origins=yes to see where uninitialised values come from
==6859== ERROR SUMMARY: 109 errors from 5 contexts (suppressed: 10 from 6)

diff -r -U 5 a/chipmunk/CMakeLists.txt b/chipmunk/CMakeLists.txt
--- a/Chipmunk-6.0.3/CMakeLists.txt	2011-12-16 02:03:45.000000000 -0500
+++ b/Chipmunk-6.0.3/CMakeLists.txt	2012-03-30 17:11:39.844319159 -0400
@@ -41,5 +41,7 @@
 add_subdirectory(src)
 
 if(BUILD_DEMOS)
   add_subdirectory(Demo)
 endif()
+
+include(CPack)

Reply via email to