Bug 162483

Summary: archivers/rpm4: python -c "import rpm" crashes with a segfault
Product: Ports & Packages Reporter: Sean Mitchell <smitchell>
Component: Individual Port(s)Assignee: Johan van Selst <johans>
Status: Closed FIXED    
Severity: Affects Only Me    
Priority: Normal    
Version: Latest   
Hardware: Any   
OS: Any   
Description Flags
patch-misc_glob.h none

Description Sean Mitchell 2011-11-11 15:40:06 UTC
With the rpm4 port (rpm-, import the rpm module in python causes
a segfault.

The cause of the segfault is dereferencing glob_t.gl_pathv at line 629
in rpm-

The reason for the gl_pathv is set to an invalid pointer is because rpm
is using the header file rpm- which defines a different
glob_t structure then the one found in /usr/include/glob.h.  As the glob
function linked to is the one in libc.a and not misc/glob.c, resulting in
dereferencing the wrong address.


Replace the definition of the glob_t struct in misc/glob.h with the
definition found in /usr/include/glob.h
How-To-Repeat: install rpm4 port.  run python -c "import rpm"
Comment 1 Mark Linimon freebsd_committer freebsd_triage 2011-11-11 23:01:26 UTC
State Changed
From-To: open->feedback

I'm sorry, I don't understand.  Is this a problem with the python ports, 
or with rpm4?
Comment 2 Mark Linimon freebsd_committer freebsd_triage 2011-11-14 19:04:53 UTC
State Changed
From-To: feedback->open

reclassify based on input from submitter. 

Comment 3 Mark Linimon freebsd_committer freebsd_triage 2011-11-14 19:04:53 UTC
Responsible Changed
From-To: freebsd-ports-bugs->johans
Comment 4 dfilter service freebsd_committer 2011-11-14 21:48:01 UTC
johans      2011-11-14 21:47:47 UTC

  FreeBSD ports repository

  Modified files:
    archivers/rpm4       Makefile 
  Added files:
    archivers/rpm4/files patch-misc_glob.h 
  Fix conflicting glob_t definitions, which triggered a crash
  when importing the rpm4 module in Python.
  PR:             ports/162483
  Submitted by:   Sean Mitchell <smitchell@hcn-inc.com>
  Feature safe:   yes
  Revision  Changes    Path
  1.40      +1 -0      ports/archivers/rpm4/Makefile
  1.1       +18 -0     ports/archivers/rpm4/files/patch-misc_glob.h (new)
cvs-all@freebsd.org mailing list
To unsubscribe, send any mail to "cvs-all-unsubscribe@freebsd.org"
Comment 5 Johan van Selst freebsd_committer 2011-11-14 21:48:20 UTC
State Changed
From-To: open->closed

Thanks for the report and good analysis. Patch committed.