Bug 162483 - archivers/rpm4: python -c "import rpm" crashes with a segfault
Summary: archivers/rpm4: python -c "import rpm" crashes with a segfault
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Johan van Selst
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-11-11 15:40 UTC by Sean Mitchell
Modified: 2011-11-14 21:50 UTC (History)
0 users

See Also:


Attachments
patch-misc_glob.h (857 bytes, text/x-chdr; charset=US-ASCII)
2011-11-14 20:52 UTC, Sean Mitchell
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Sean Mitchell 2011-11-11 15:40:06 UTC
With the rpm4 port (rpm-4.9.1.2), 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-4.9.1.2/rpmio/rpmfileutil.c.

The reason for the gl_pathv is set to an invalid pointer is because rpm
is using the header file rpm-4.9.1.2/misc/glob.h 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.

Fix: 

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 
  Log:
  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
http://lists.freebsd.org/mailman/listinfo/cvs-all
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.