Opened 17 years ago

Closed 17 years ago

Last modified 15 years ago

#12149 closed defect (fixed)

BUG: Internal delete command segfaults with very long list of arguments

Reported by: jmpalacios (Juan Manuel Palacios) Owned by: kballard (Lily Ballard)
Priority: High Milestone: MacPorts 1.5
Component: base Version: 1.4.42
Keywords: Cc: jmpalacios (Juan Manuel Palacios), afb@…, kballard (Lily Ballard)
Port:

Description

Working on the rpm Portfile I wrote a line to take care of a bunch of files we don't want in the destroot:

eval delete [glob ${destroot}${prefix}/lib/libpopt.*]

But that causes MacPorts to segfault, presumably because the expansion yields a very long list of arguments:

DEBUG: delete: /opt/local/var/macports/build/_usr_local_src_macosforge_macports_trunk_dports_sysutils_rpm/work/destroot/opt/local/lib/libpopt.0.0.0.dylib /opt/local/var/macports/build/_usr_local_src_macosforge_macports_trunk_dports_sysutils_rpm/work/destroot/opt/local/lib/libpopt.0.dylib /opt/local/var/macports/build/_usr_local_src_macosforge_macports_trunk_dports_sysutils_rpm/work/destroot/opt/local/lib/libpopt.a /opt/local/var/macports/build/_usr_local_src_macosforge_macports_trunk_dports_sysutils_rpm/work/destroot/opt/local/lib/libpopt.dylib /opt/local/var/macports/build/_usr_local_src_macosforge_macports_trunk_dports_sysutils_rpm/work/destroot/opt/local/lib/libpopt.la
Segmentation fault

Are we exhausting a buffer somewhere? Any idea how we can insert all this into gdb?

-jmpp

PS: The delete command does work in other situations, as the line prior to the offending one above demonstrates:

eval delete [glob ${destroot}${prefix}/share/man/man3/popt.3*]

Producing:

DEBUG: delete: /opt/local/var/macports/build/_usr_local_src_macosforge_macports_trunk_dports_sysutils_rpm/work/destroot/opt/local/share/man/man3/popt.3

So it's not that delete is overall broken.

Change History (7)

comment:1 Changed 17 years ago by kballard (Lily Ballard)

Status: newassigned

If you run it in gdb (which should be easy enough) once you segfault you should be able to get a backtrace and give it to me.

I'll do some experimenting on my own to see if I can reproduce it.

comment:2 Changed 17 years ago by kballard (Lily Ballard)

Ok, I've reproduced it. I'll see if I can fix it now.

comment:3 Changed 17 years ago by kballard (Lily Ballard)

Resolution: fixed
Status: assignedclosed

D'oh! What a stupid mistake.

Fixed in r26397.

comment:4 Changed 17 years ago by jmpalacios (Juan Manuel Palacios)

Milestone: Needs developer reviewMacPorts base bugs

Milestone Needs developer review deleted

comment:5 Changed 17 years ago by nox@…

Priority: ImportantHigh
Summary: Internal delete command segfaults with very long list of argumentsBUG: Internal delete command segfaults with very long list of arguments

comment:6 Changed 16 years ago by tobypeterson

Milestone: MacPorts base bugsMacPorts Future

Milestone MacPorts base bugs deleted

comment:7 Changed 15 years ago by jmroot (Joshua Root)

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