Opened 13 years ago

Closed 13 years ago

Last modified 12 years ago

#30310 closed defect (fixed)

cdrtools-3.00 hangs during configure/compilation creating avoffset.h

Reported by: pkutzner+macports@… Owned by: bytestorm@…
Priority: Normal Milestone:
Component: ports Version: 2.0.0
Keywords: lion Cc: soehn@…, mullikine@…, macports@…, jiri@…, lee_yiu_chung@…, mat.hudson@…, brent@…, thimo@…, KNIZEK.MILAN@…, bs1984@…
Port: cdrtools

Description

When attempting to compile cdrecord on Lion, compilation hangs when generating avoffset.h with 99% cpu utilization, but will not complete. See attached output.

Attachments (1)

cdrtools_build.txt (25.0 KB) - added by pkutzner+macports@… 13 years ago.

Download all attachments as: .zip

Change History (23)

Changed 13 years ago by pkutzner+macports@…

Attachment: cdrtools_build.txt added

comment:1 Changed 13 years ago by ryandesign (Ryan Carsten Schmidt)

Keywords: cdrtools removed
Owner: changed from macports-tickets@… to bytestorm@…
Port: cdrtools added

comment:2 Changed 13 years ago by ben@…

sudo port install cdrtools stops on my system too but is stopping on compiling the smake dependency of cdrtools. System is Lion 10.7. System hard disk was formatted prior Lion install.

smake errors of interest:

./psmake/smake: Found illegal option '--jobserver-fds=6,7 -j' in MAKEFLAGS.
./psmake/smake: Skipping illegal option '--jobserver-fds=6,7'.

creating cache ./config.cache
checking host system type... Invalid configuration `unknownCPU-unknownMFR-unknownOS': machine `unknownCPU-unknownMFR' not recognized

	==> LINKING "OBJ/i386-darwin-cc/avoffset"
ld: warning: directory not found for option '-L../libs/i386-darwin-cc'
ld: warning: directory not found for option '-L../libs/i386-darwin-cc'
	==> GENERATING include file "../incs/i386-darwin-cc/avoffset.h"

This is where the compile of of the smake dependency stops.

comment:3 Changed 13 years ago by macports@…

I have the same problem in smake. I see the errors ben lists but that isn't where it dies. I am on 10.6.8, so this problem is not related to Lion, but maybe macports-2.0.0 as I did just update to that. Last line in the log is :info:build checking for nanosleep..

There is a process named avoffset using 99.8% CUP to apparently do nothing as its been running for hours.

Killing that process allows the smake build to finish up almost instantly, too fast for me to see in the log what the result is. The build goes on to cdrtools without any immediately apparent error. However, it too gets stuck with this avoffset process using up one core to sit on its ass. The log is not being properly flushed once this process hangs, obvious as the last entry is just :i

Again, killing the hung process allows the build to go on and eventually complete without any immediately apparent error. The build of cdrtools take sufficiently longer than smake did to be able to reload the log file and see what was going on. Skipping down a few dozen lines, out of the config script and to where its actually build, we can see something perhaps useful.

:info:build 	==> MAKING "all" ON SUBCOMPONENT "SRCROOT/inc/avoffset.mk"
:info:build 	==> MAKING DEPENDENCIES "avoffset.d"
:info:build 	==> COMPILING "avoffset.o"
:info:build 	==> LINKING "OBJ/i386-darwin-cc/avoffset"
:info:build ld: warning: directory not found for option '-L../libs/i386-darwin-cc'
:info:build ld: warning: directory not found for option '-L../libs/i386-darwin-cc'
:info:build 	==> GENERATING include file "../incs/i386-darwin-cc/avoffset.h"
:info:build sh: line 1: 99211 Terminated              OBJ/i386-darwin-cc/avoffset > ../incs/i386-darwin-cc/avoffset.h
:info:build smake: Unknown error: 143. *** Code 143 from command line for target '../incs/i386-darwin-cc/avoffset.h'.
:info:build smake: The following command caused the error:
:info:build echo "	==> GENERATING include file \"../incs/i386-darwin-cc/avoffset.h\""; OBJ/i386-darwin-cc/avoffset > ../incs/i386-darwin-cc/avoffset.h
:info:build smake: Couldn't make 'all'.
:info:build smake: Leaving  'smake'[2] from directory '/usr/local/var/macports/build/_usr_local_var_macports_sources_rsync.macports.org_release_ports_sysutils_cdrtools/cdrtools/work/cdrtools-3.00/inc'
:info:build smake: Default commandline target: 'all'
:info:build smake: Doing                       exit(1)
:info:build smake: Operation not permitted. *** Code 1 from command line for target 'all'.
:info:build smake: The following command caused the error:
:info:build  for MK in align_test.mk avoffset.mk ;					\
:info:build 	do								\
:info:build 		(							\
:info:build 		if [ -r ./$MK ] ; then					\
:info:build 			echo "	==> MAKING \"all\" ON SUBCOMPONENT \"SRCROOT/inc/$MK\""; "smake" -f $MK  XARCH=x86_64-darwin-cc all;\
:info:build 		else							\
:info:build 			echo "NOTICE: Partial source (SRCROOT/inc/$MK) missing";\
:info:build 		fi							\
:info:build 		);							\
:info:build 	done
:info:build smake: Couldn't make 'all'.
:info:build smake: Leaving  'smake'[1] from directory '/usr/local/var/macports/build/_usr_local_var_macports_sources_rsync.macports.org_release_ports_sysutils_cdrtools/cdrtools/work/cdrtools-3.00/inc'
:info:build smake: Default commandline target: 'all'
:info:build smake: Doing                       exit(1)

It would seem the generation of avoffset.h hits the same problem regardless if the build is smake or cdrtools. There may be other ports affected as well. I do not reach my goal port due to an error along the way in another dependency, but that appears to be unrelated to the avoffset problem.

comment:7 Changed 13 years ago by jhiesey@…

I have been having this problem (avoffset hangs during smake build) on Snow Leopard with XCode 4.0.2 as well as on Lion with XCode 4.1.

I attached gdb to the hung avoffset process, and from this it looks like avoffset.c is being miscompiled. The loop to scan the stack looks like this:

	while (fp->fr_savfp) {
		if (fp->fr_savpc == 0)
			break;

		fp = (struct frame *)fp->fr_savfp;

		i++;
	}

but the compiler generates a wrong jump at the top of the loop, causing it to just loop forever on that line:

0x000000010ace3ab0 <main+304>:	jmp    0x10ace3ab0 <main+304>

This looks like a backend bug in llvm to me. Compiling with gcc-4.2 works, while clang and llvm-gcc-4.2 both fail.

Since I've never submitted a patch for MacPorts before (or even posted on a ticket), I think I'll let someone else submit a patch for the portfile.

comment:8 Changed 13 years ago by soehn@…

Cc: soehn@… added

Cc Me!

comment:9 Changed 13 years ago by mullikine@…

Cc: mullikine@… added

Cc Me!

comment:10 Changed 13 years ago by macports@…

Cc: macports@… added

Cc Me!

comment:11 Changed 13 years ago by jiri@…

Cc: jiri@… added

Cc Me!

comment:12 Changed 13 years ago by lee_yiu_chung@…

Cc: lee_yiu_chung@… added

Cc Me!

comment:13 Changed 13 years ago by gleirsch@…

I can confirm this problem. I wanted to install cdrtools on 10.6.8 using 2.0.3.

sudo port clean --dist smake; 
sudo port install smake configure.compiler=gcc-4.2

didn't help. Maybe because smake does not support switching to gcc-4.2 via the configure option. I'm not an expert, but anyway, killing the avoffset process helped.

Any news on this?

comment:14 Changed 13 years ago by brandongabbard@…

Confirmed on a brand new installation of Lion & MacPorts today

comment:15 Changed 13 years ago by mat.hudson@…

Cc: mat.hudson@… added

Cc Me!

comment:16 Changed 13 years ago by brent@…

Cc: brent@… added

Cc Me!

comment:17 Changed 13 years ago by thimo@…

Cc: thimo@… added

Cc Me!

comment:18 Changed 13 years ago by KNIZEK.MILAN@…

Cc: KNIZEK.MILAN@… added

Cc Me!

comment:19 Changed 13 years ago by lambda@…

I've reported this bug upstream to the LLVM bugzilla, with a somewhat reduced test case.

Two possible quick solutions would be to disable avoffset entirely (or replace it with something that produces a blank avoffset.h file), as everything still works even if it produces empty output, or to compile it without the -O flag, which is what appears to trigger this bug.

comment:20 Changed 13 years ago by lambda@…

The LLVM folks closed that bug as invalid, since the avoffset code relies on undefined behavior. I reported the bug to Jörg Schilling, the author and maintainer of smake and cdrtools, and he has added a patch to the development version of his code, ftp://ftp.berlios.de/pub/schily/schily-dist-pre.tar.bz2, that no longer compiles into an infinite loop under LLVM. We could either extract the patch from this development version, and apply it to the current version of smake and cdrtools in MacPorts, or we could wait for the next version of these packages to be released.

comment:21 Changed 13 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: newclosed

comment:22 Changed 12 years ago by ryandesign (Ryan Carsten Schmidt)

I have fixed the WikiFormatting of the above posts, and deleted the subsequent posts that arose only because of the formatting issues.

comment:23 Changed 12 years ago by bs1984@…

Hi - I still observe macports stalling at avoffset on smake and cdrtools on OSX 10.7.5 (gcc42 is not available to this platform). XCode version 4.5.

$ port info cdrtools smake
cdrtools @3.00, Revision 1 (sysutils)

Description:          The cdrtools software includes programs to create and/or extract
                      ISO 9660 filesystems, verify their integrity, and write them to
                      a disc. Note, this port conflicts with the dvdrtools port.
Homepage:             http://cdrecord.berlios.de/old/private/cdrecord.html

Build Dependencies:   smake
Library Dependencies: gettext
Platforms:            darwin
License:              CDDL-1 BSD LGPL-2.1 GPL-2+ GPL-2
Maintainers:          bytestorm@gmail.com, openmaintainer@macports.org
--
smake @1.2.1 (devel)

Description:          Smake is a highly portable make program with automake features.
                      It is currently mainly targeted to be used with the makefiles
                      system.
Homepage:             http://cdrecord.berlios.de/old/private/smake.html

Platforms:            darwin
License:              CDDL
Maintainers:          mww@macports.org

comment:24 Changed 12 years ago by bs1984@…

Cc: bs1984@… added

Cc Me!

comment:25 Changed 12 years ago by bs1984@…

To clarify, I was unable to install using the default case:

  sudo port install cdrtools

Stalled at avoffset (according to ps)

  sudo port install cdrtools configure.compiler=clang
  sudo port install cdrtools configure.compiler=gcc-4.2

Also failed. The following set of commands finally worked.

  sudo port install apple-gcc42
  sudo port uninstall smake cdrtools
  sudo port install cdrtools configure.compiler=apple-gcc-4.2

Perhaps apple-gcc42 should be a requirement until the upstream package resolves the various llvm/clang issues?

Last edited 12 years ago by bs1984@… (previous) (diff)
Note: See TracTickets for help on using tickets.