Project

General

Profile

Task #739

non-portable readdir_r() use can cause segmentation fault

Added by Nathan Weeks over 8 years ago. Updated over 8 years ago.

Status:
Closed
Priority:
Normal
Assignee:
-
Category:
-
Target version:
Difficulty:
uncategorized
Close

Description

The gromacs 4.5.4 pdb2gmx causes a segmentation fault on Solaris due
to a non-portable use of readdir_r() in futil.c. On Solaris, memory must
be allocated for the dirent structure, since the d_name member is defined
as "char d_name1" (on Linux it is "char d_name256").

The attached patch fixes the issue using by allocating memory for the
dirent structure as suggested in the Linux readdir(3) man page:

http://www.kernel.org/doc/man-pages/online/pages/man3/readdir.3.html

futil.c.patch (1.1 KB) futil.c.patch Nathan Weeks, 04/22/2011 10:04 PM

Associated revisions

Revision 56f9e557 (diff)
Added by Berk Hess over 8 years ago

fixed dirrent_t memory allocation issue on Solaris, fixes #739

History

#1 Updated by Rossen Apostolov over 8 years ago

  • Target version set to 4.5.5

#2 Updated by Berk Hess over 8 years ago

  • Status changed from New to Closed

I fixed this issue, although in a slightly different way.

Also available in: Atom PDF