From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 10047 invoked by alias); 28 Oct 2010 15:42:30 -0000 Received: (qmail 10036 invoked by uid 22791); 28 Oct 2010 15:42:29 -0000 X-SWARE-Spam-Status: No, hits=-2.1 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00,MISSING_MID,TW_DQ,TW_VD X-Spam-Check-By: sourceware.org Received: from localhost (HELO sourceware.org) (127.0.0.1) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 28 Oct 2010 15:42:26 +0000 From: "throctukes at gmail dot com" To: glibc-bugs@sources.redhat.com Subject: [Bug libc/12123] SIGBUS on strstr_sse42 due to bad alignment X-Bugzilla-Reason: CC X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: glibc X-Bugzilla-Component: libc X-Bugzilla-Keywords: X-Bugzilla-Severity: normal X-Bugzilla-Who: throctukes at gmail dot com X-Bugzilla-Status: NEW X-Bugzilla-Priority: P2 X-Bugzilla-Assigned-To: drepper.fsp at gmail dot com X-Bugzilla-Target-Milestone: --- X-Bugzilla-Changed-Fields: CC In-Reply-To: References: X-Bugzilla-URL: http://sourceware.org/bugzilla/ Auto-Submitted: auto-generated Content-Type: text/plain; charset="UTF-8" MIME-Version: 1.0 Date: Thu, 28 Oct 2010 15:42:00 -0000 Mailing-List: contact glibc-bugs-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: glibc-bugs-owner@sourceware.org X-SW-Source: 2010-10/txt/msg00178.txt.bz2 Message-ID: <20101028154200.Uq80fgqtMkxL_Uu1Ho8AGbMZ8WZlhZE7fujQz5vvoOU@z> http://sourceware.org/bugzilla/show_bug.cgi?id=12123 throctukes at gmail dot com changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |throctukes at gmail dot com --- Comment #17 from throctukes at gmail dot com 2010-10-28 15:42:10 UTC --- This looks very similar to a problem I've been seeing which manifests in the Mono soft debugger - although interestingly I've seen this on 64bit architecture. Discussion of the problem has been going on here: http://ubuntuforums.org/showthread.php?t=1602295 - Here's a summary: On machines using the sse4.2 instruction set there seems to be an issue with the use of the optimised strstr function in glibc which causes a segfault whenever the mono soft debugger is used. A VMWare image run on a machine without an sse4.2 capable processor will behave normally (i.e., no segfault), but if transferred onto a machine with an sse4.2 capable processor will segfault in the same way as the host would (i.e., will segfault during debugging), which suggests that when this issue occurs it's not due to a misconfigured system. If glibc is built without the sse4.2 optimised version of strstr enabled, this issue is not apparent. Inside strstr, the segfault traces to line 286 in x86_64/multiarch/strstr.c inside glibc: 280 /* p1 > 1 byte long. Load up to 16 bytes of fragment. */ 281 __m128i frag1 = strloadu (p1); 282 283 __m128i frag2; 284 if (p2[1] != '\0') 285 /* p2 is > 1 byte long. */ 286 frag2 = strloadu (p2); 287 else 288 frag2 = _mm_insert_epi8 (_mm_setzero_si128 (), LOADBYTE (p2[0]), 0); Checking the disassembly at this point: Program received signal SIGSEGV, Segmentation fault. 0x00007f85b165ee6b in __strstr_sse42 (s1=0x6d5280 "mono_create_corlib_exception_1", s2=0x6d3f05 "ves_array_new_va_") at ../sysdeps/x86_64/multiarch/strstr.c:286 ... (gdb) disassemble ... 0x00007f85b165ee60 <+880>: mov %rbx,%rax 0x00007f85b165ee63 <+883>: jmpq 0x7f85b165eb22 <__strstr_sse42+50> 0x00007f85b165ee68 <+888>: mov %r13,%rdi => 0x00007f85b165ee6b <+891>: movdqa %xmm0,(%rsp) 0x00007f85b165ee70 <+896>: callq 0x7f85b165e9b0 <__m128i_strloadu> 0x00007f85b165ee75 <+901>: movdqa %xmm0,0x10(%rsp) 0x00007f85b165ee7b <+907>: movdqa (%rsp),%xmm1 0x00007f85b165ee80 <+912>: jmpq 0x7f85b165eb98 <__strstr_sse42+168> ... (gdb) p $rsp $1 = (void *) 0x7fff829769e8 Bug report on the Mono bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=647464 A similar problem to this has been reported on the NVidia Developer Zone forum affecting the NVPerfKit tool (again a debugging tool as far as I can tell) http://developer.nvidia.com/forums/index.php?showtopic=4926 -- Configure bugmail: http://sourceware.org/bugzilla/userprefs.cgi?tab=email ------- You are receiving this mail because: ------- You are on the CC list for the bug.