Opened 6 years ago

Closed 6 years ago

Last modified 6 years ago

#55204 closed defect (fixed)

mawk @1.3.4-20171017: Fails with 'Abort trap: 6' when using binary (source okay)

Reported by: anowacki (Andy Nowacki) Owned by: tobypeterson
Priority: Normal Milestone:
Component: ports Version: 2.4.2
Keywords: Cc:
Port: mawk

Description

The binary of mawk distributed on the MacPorts servers seems to have an error:

$ sudo port install mawk && mawk 'BEGIN{print 1}'
--->  Fetching archive for mawk
--->  Attempting to fetch mawk-1.3.4-20171017_0.darwin_16.x86_64.tbz2 from http://mse.uk.packages.macports.org/sites/packages.macports.org/mawk
--->  Attempting to fetch mawk-1.3.4-20171017_0.darwin_16.x86_64.tbz2.rmd160 from http://mse.uk.packages.macports.org/sites/packages.macports.org/mawk
--->  Installing mawk @1.3.4-20171017_0
--->  Activating mawk @1.3.4-20171017_0
--->  Cleaning mawk
--->  Updating database of binaries
--->  Scanning binaries for linking errors
--->  No broken files found.                             
Abort trap: 6

Running any mawk command fails in the same way.

Building from source is fine, however:

$ sudo port uninstall mawk && sudo port clean --dist mawk && sudo port -s install mawk && mawk 'BEGIN{print 1}'
--->  Deactivating mawk @1.3.4-20171017_0
--->  Cleaning mawk
--->  Uninstalling mawk @1.3.4-20171017_0
--->  Cleaning mawk
--->  Cleaning mawk
--->  Fetching distfiles for mawk
--->  Attempting to fetch mawk-1.3.4-20171017.tgz from http://mse.uk.distfiles.macports.org/sites/distfiles.macports.org/mawk
--->  Attempting to fetch mawk-1.3.4-20171017.tgz from https://distfiles.macports.org/mawk
--->  Attempting to fetch mawk-1.3.4-20171017.tgz from http://lil.fr.distfiles.macports.org/mawk
--->  Attempting to fetch mawk-1.3.4-20171017.tgz from http://osl.no.distfiles.macports.org/mawk
--->  Attempting to fetch mawk-1.3.4-20171017.tgz from http://nue.de.distfiles.macports.org/mawk
--->  Attempting to fetch mawk-1.3.4-20171017.tgz from http://fco.it.distfiles.macports.org/mirrors/macports-distfiles/mawk
--->  Attempting to fetch mawk-1.3.4-20171017.tgz from http://ykf.ca.distfiles.macports.org/MacPorts/mpdistfiles/mawk
--->  Attempting to fetch mawk-1.3.4-20171017.tgz from http://ywg.ca.distfiles.macports.org/mirror/macports/distfiles/mawk
--->  Attempting to fetch mawk-1.3.4-20171017.tgz from http://sea.us.distfiles.macports.org/macports/distfiles/mawk
--->  Attempting to fetch mawk-1.3.4-20171017.tgz from http://kmq.jp.distfiles.macports.org/mawk
--->  Attempting to fetch mawk-1.3.4-20171017.tgz from http://jnb.za.distfiles.macports.org/distfiles/mawk
--->  Attempting to fetch mawk-1.3.4-20171017.tgz from https://pek.cn.distfiles.macports.org/macports/distfiles/mawk
--->  Attempting to fetch mawk-1.3.4-20171017.tgz from http://jog.id.distfiles.macports.org/macports/distfiles/mawk
--->  Attempting to fetch mawk-1.3.4-20171017.tgz from http://cjj.kr.distfiles.macports.org/mawk
--->  Attempting to fetch mawk-1.3.4-20171017.tgz from http://aarnet.au.distfiles.macports.org/pub/macports/distfiles/mawk
--->  Attempting to fetch mawk-1.3.4-20171017.tgz from http://nou.nc.distfiles.macports.org/pub/macports/distfiles.macports.org/mawk
--->  Attempting to fetch mawk-1.3.4-20171017.tgz from ftp://ftp.invisible-island.net/mawk/
--->  Verifying checksums for mawk                                                   
--->  Extracting mawk
--->  Configuring mawk
--->  Building mawk
--->  Staging mawk into destroot
--->  Installing mawk @1.3.4-20171017_0
--->  Activating mawk @1.3.4-20171017_0
--->  Cleaning mawk
--->  Updating database of binaries
--->  Scanning binaries for linking errors
--->  No broken files found.                             
1

Attachments (1)

mawk_2017-10-31-132730_see3-54.crash (9.2 KB) - added by anowacki (Andy Nowacki) 6 years ago.
mawk crash log

Download all attachments as: .zip

Change History (10)

comment:1 Changed 6 years ago by anowacki (Andy Nowacki)

Should have mentioned:

  • macOS 10.12.6
  • Xcode 9.0.1

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

Could you attach the crash log file?

comment:3 Changed 6 years ago by mf2k (Frank Schima)

Cc: tobypeterson removed
Owner: set to tobypeterson
Status: newassigned

Changed 6 years ago by anowacki (Andy Nowacki)

mawk crash log

comment:4 Changed 6 years ago by ryandesign (Ryan Carsten Schmidt)

I can confirm this. Runs fine when built locally on my Mac with 10.12.6 with Xcode 9.0.1. Crashes when using the binary produced by the buildbot, which runs 10.12.6 with Xcode 8.3.3. I haven't tested other OS versions.

comment:5 Changed 6 years ago by tobypeterson

Relevant code hasn't changed in quite a while. I suppose the older mawk releases were built with a different Xcode version. So it's a compiler bug, I assume? The code looks fine to me.

comment:6 Changed 6 years ago by tobypeterson

I got my hands on a VM where I can repro this. Same problem occurs with mawk-1.3.4-20161120.

comment:7 Changed 6 years ago by tobypeterson

mawk is using a dynamically-sized struct (last member is str[2]), which certain older clang versions don't like. Possible fixes include converting the affected strcpy calls to use memcpy, or perhaps disabling _FORTIFY_SOURCE.

comment:8 Changed 6 years ago by tobypeterson

Resolution: fixed
Status: assignedclosed

Disabled _FORTIFY_SOURCE in [20d860625d3d6087809bfff4c578f70edf01a527/macports-ports].

We should undo that at some point.

Last edited 6 years ago by ryandesign (Ryan Carsten Schmidt) (previous) (diff)

comment:9 in reply to:  8 Changed 6 years ago by Schamschula (Marius Schamschula)

Replying to tobypeterson:

Disabled _FORTIFY_SOURCE in [20d860625d3d6087809bfff4c578f70edf01a527/macports-ports].

We should undo that at some point.

Unfortunately, this has no effect on the Abort trap.

Note: See TracTickets for help on using tickets.