View Issue Details Jump to Notes ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0013114CMakeCPackpublic2012-04-09 13:232016-06-10 14:31
ReporterCesar 
Assigned ToKitware Robot 
PriorityurgentSeverityblockReproducibilityalways
StatusclosedResolutionmoved 
Platformx86OSSolarisOS Versionany
Product VersionCMake 2.8.7 
Target VersionFixed in Version 
Summary0013114: CPack segfaults if too many people belong to a certain group
DescriptionCPack, when trying to generate a TGZ package, segfaults in lookup_gname_helper when there are too many people in the GID it is trying to identify. My builds started failing immediately after that number was reached when IT added a new member to the staff group. The realloc in case of ERANGE segfaults. If I increase the buffer size to something larger by hand and recompile it works.

CPack is not the first to run into this issue:

https://issues.apache.org/bugzilla/show_bug.cgi?id=41105 [^]
Steps To ReproduceRun CPack to generate TGZs as a user belonging to a group containing "too many people".

Also, the file in "addidional information" reproduces the problem every time for our 5000 gid. If I increase the initial bufsize to 1024 it works. It is a Solaris only problem, as our other platforms (Linux, Windows, Mac) work fine.
Additional Information#define _POSIX_PTHREAD_SEMANTICS
#include <grp.h>
#include <iostream>

int main(void)
{
  struct group grent, *result;
  result = &grent;

  int bufsize=512;
  char* buffer=(char*)malloc(bufsize);

  for(;;)
  {
      int status = getgrgid_r(5000,
        &grent,buffer,bufsize,&result);

      if(!status)
      {
        std::cerr << "Buffer: " << buffer << std::endl;
        break;
      }
      else if(status==34)
      {
        std::cerr << "Small buffer\n";
        bufsize*=2;
        buffer=(char*)realloc(buffer,bufsize);
      }
  }

  return 0;
}
TagsNo tags attached.
Attached Files

 Relationships

  Notes
(0029106)
Cesar (reporter)
2012-04-09 14:32

I replaced the "buff_size = 256" by "buff_size = 8192" in ./Utilities/cmlibarchive/libarchive/archive_read_disk_set_standard_lookup.c in the meantime to try to get around the problem.
(0029107)
Cesar (reporter)
2012-04-09 14:39

On the realloc segfault: the first realloc works (from 256 to 512), but when it tries the 1024 realloc it segfaults.
(0029148)
Eric NOULARD (developer)
2012-04-13 11:49

As you may have guessed this "bug" is inherited from upstream
libarchive, could you go there
http://code.google.com/p/libarchive/ [^]
and see if it has been reported there as well.
(0030402)
David Cole (manager)
2012-08-11 21:35

Sending old, never assigned issues to the backlog.

(The age of the bug, plus the fact that it's never been assigned to anyone means that nobody is actively working on it...)

If an issue you care about is sent to the backlog when you feel it should have been addressed in a different manner, please bring it up on the CMake mailing list for discussion. Sign up for the mailing list here, if you're not already on it: http://www.cmake.org/mailman/listinfo/cmake [^]

It's easy to re-activate a bug here if you can find a CMake developer who has the bandwidth to take it on, and ferry a fix through to our 'next' branch for dashboard testing.
(0042020)
Kitware Robot (administrator)
2016-06-10 14:28

Resolving issue as `moved`.

This issue tracker is no longer used. Further discussion of this issue may take place in the current CMake Issues page linked in the banner at the top of this page.

 Issue History
Date Modified Username Field Change
2012-04-09 13:23 Cesar New Issue
2012-04-09 14:32 Cesar Note Added: 0029106
2012-04-09 14:39 Cesar Note Added: 0029107
2012-04-13 11:49 Eric NOULARD Note Added: 0029148
2012-08-11 21:35 David Cole Status new => backlog
2012-08-11 21:35 David Cole Note Added: 0030402
2016-06-10 14:28 Kitware Robot Note Added: 0042020
2016-06-10 14:28 Kitware Robot Status backlog => resolved
2016-06-10 14:28 Kitware Robot Resolution open => moved
2016-06-10 14:28 Kitware Robot Assigned To => Kitware Robot
2016-06-10 14:31 Kitware Robot Status resolved => closed


Copyright © 2000 - 2018 MantisBT Team