Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#36597 closed defect (fixed)

portpkg.tcl script fails with segfault

Reported by: damoclark (Damo) Owned by: macports-tickets@…
Priority: Normal Milestone: MacPorts 2.1.3
Component: base Version: 2.1.2
Keywords: Cc:
Port:

Description (last modified by ryandesign (Ryan Carsten Schmidt))

Like 189 of portpkg.tcl uses the findBinary procedure to locate the full path to the cpio binary and then uses that as the value to the -x parameter of the pax command. This causes pax to segmentation fault.

The command that fails is:

cd /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_multimedia_mythtv-core.25/mythtv-core.25/work/destroot && /bin/pax -x /usr/bin/cpio -w -z . > /opt/local/var/macports/build/_opt_local_var_macports_sources_rsync.macports.org_release_tarballs_ports_multimedia_mythtv-core.25/mythtv-core.25/work/mythtv-core.25-0.25.2-Fixes-20120918.pkg/Contents/Archive.pax.gz

The attached patch file simply uses 'cpio' as the parameter to -x option of pax rather than the calculated full path (ie /usr/bin/pax). With just 'cpio' there is no segmentation fault.

Attachments (2)

portpkg.tcl.patch (330 bytes) - added by damoclark (Damo) 11 years ago.
Patch to portpkg.tcl setting the archive format to 'cpio' rather than '/usr/bin/cpio'
pax_2012-10-14-155510_Mini-Bigroom.crash (6.7 KB) - added by damoclark (Damo) 11 years ago.
Crash log from pax command

Download all attachments as: .zip

Change History (8)

Changed 11 years ago by damoclark (Damo)

Attachment: portpkg.tcl.patch added

Patch to portpkg.tcl setting the archive format to 'cpio' rather than '/usr/bin/cpio'

comment:1 Changed 11 years ago by damoclark (Damo)

Sorry, I should have added that this was on OSX 10.8.1 I suspect earlier versions of Mac OS had a more tolerant pax command.

Damien.

comment:2 Changed 11 years ago by ryandesign (Ryan Carsten Schmidt)

Description: modified (diff)
Keywords: pkg removed
Priority: HighNormal

Could you attach the crash log from that segmentation fault? It should be in ~/Library/Logs/DiagnosticReports

Changed 11 years ago by damoclark (Damo)

Crash log from pax command

comment:3 Changed 11 years ago by damoclark (Damo)

Crash log attached. The segfault can be reproduced directly from the command line:

pax -x /usr/bin/cpio -w -z /tmp >/dev/null

If you run it without the full path, there is no segfault:

pax -x cpio -w -z /tmp >/dev/null

This is on 10.8.1. Both the above commands work fine on 10.7.5.

comment:4 Changed 11 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: newclosed

This was already fixed in r96262. You can't hit the problematic code if you have PackageMaker installed, BTW.

comment:5 Changed 11 years ago by jmroot (Joshua Root)

Milestone: MacPorts Future

comment:6 Changed 11 years ago by jmroot (Joshua Root)

Milestone: MacPorts FutureMacPorts 2.1.3
Note: See TracTickets for help on using tickets.