[asterisk-commits] wdoekes: trunk r397379 - in /trunk: ./ default.exports main/asterisk.exports.in

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Aug 22 03:27:02 CDT 2013


Author: wdoekes
Date: Thu Aug 22 03:26:55 2013
New Revision: 397379

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=397379
Log:
Add _IO_stdin_used in version-script to fix SIGBUSes on Sparc.

The --version-script,asterisk.exports linker flag (and the module
exports) didn't provide _IO_stdin_used in the list of exported symbols.
That causes some kind of libc compatibility mode to kick in, where
stdio file structures (stdout/stderr) land somewhere else. In the
case of the Sparc, they landed on misaligned memory.

This became apparent first after r376428 (Reorder startup sequence)
when a lot of ast_log's were replaced with fprintf's. Writing to
stderr triggered a SIGBUS. (Compared to x86 and amd64 architectures,
the Sparc is very picky about memory alignment.)

(issue ASTERISK-21763)
(issue ASTERISK-21665)

Reported by: Jeremy Kister
Review: https://reviewboard.asterisk.org/r/2760/
........

Merged revisions 397377 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 397378 from http://svn.asterisk.org/svn/asterisk/branches/11

Modified:
    trunk/   (props changed)
    trunk/default.exports
    trunk/main/asterisk.exports.in

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Modified: trunk/default.exports
URL: http://svnview.digium.com/svn/asterisk/trunk/default.exports?view=diff&rev=397379&r1=397378&r2=397379
==============================================================================
--- trunk/default.exports (original)
+++ trunk/default.exports Thu Aug 22 03:26:55 2013
@@ -1,4 +1,8 @@
 {
+	global:
+		/* See main/asterisk.exports.in for an explanation why this is
+		 * needed. */
+		_IO_stdin_used;
 	local:
 		*;
 };

Modified: trunk/main/asterisk.exports.in
URL: http://svnview.digium.com/svn/asterisk/trunk/main/asterisk.exports.in?view=diff&rev=397379&r1=397378&r2=397379
==============================================================================
--- trunk/main/asterisk.exports.in (original)
+++ trunk/main/asterisk.exports.in Thu Aug 22 03:26:55 2013
@@ -49,6 +49,25 @@
 		LINKER_SYMBOL_PREFIXres_srtp;
 		LINKER_SYMBOL_PREFIXres_srtp_policy;
 		LINKER_SYMBOL_PREFIXsecure_call_info;
+		/*
+
+		If _IO_stdin_used is not exported, stdout/stderr may not get
+		properly aligned. That causes breakage on some architectures.
+
+		http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=634261#51
+		http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=634261#94
+		http://lists.gnu.org/archive/html/bug-glibc/2001-12/msg00203.html
+
+		We export the symbol to get proper behaviour. Now printf
+		doesn't SIGBUS anymore on the SPARC.
+
+		Michael Karcher wrote on Jan 13, 2013:
+		> A build process that mangles the export of _IO_stdin_used is
+		> (as defined by the libc ABI, even if not explicitly written
+		> down) broken. [...]
+
+		*/
+		LINKER_SYMBOL_PREFIX_IO_stdin_used;
 	local:
 		*;
 };




More information about the asterisk-commits mailing list