From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1LiBGX-00024t-C3 for qemu-devel@nongnu.org; Fri, 13 Mar 2009 13:33:49 -0400 Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1LiBGS-000243-Mx for qemu-devel@nongnu.org; Fri, 13 Mar 2009 13:33:49 -0400 Received: from [199.232.76.173] (port=57480 helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1LiBGS-000240-Hz for qemu-devel@nongnu.org; Fri, 13 Mar 2009 13:33:44 -0400 Received: from main.gmane.org ([80.91.229.2]:58369 helo=ciao.gmane.org) by monty-python.gnu.org with esmtps (TLS-1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.60) (envelope-from ) id 1LiBGS-0005Fr-5m for qemu-devel@nongnu.org; Fri, 13 Mar 2009 13:33:44 -0400 Received: from list by ciao.gmane.org with local (Exim 4.43) id 1LiBGP-0006j4-9d for qemu-devel@nongnu.org; Fri, 13 Mar 2009 17:33:41 +0000 Received: from 204.147.152.1 ([204.147.152.1]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 13 Mar 2009 17:33:41 +0000 Received: from void by 204.147.152.1 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 13 Mar 2009 17:33:41 +0000 From: Consul Date: Fri, 13 Mar 2009 10:33:28 -0700 Message-ID: References: <49B1E13C.9060900@codemonkey.ws> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit In-Reply-To: Sender: news Subject: [Qemu-devel] Re: SIGSEGV on Windows with KQEMU enabled Reply-To: qemu-devel@nongnu.org List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Johannes Schindelin wrote: > compiling with --std=c99? with -std=c99 it does not even compile > > Alternatively, you might want to try to > > #define snprintf __mingw_snprintf > #define vsnprintf __mingw_vsnprintf > These give linker undefined symbol errors. But really funny think is the change that triggers the bug is precisely this: -Monitor *cur_mon; +Monitor *cur_mon = NULL; Obviously, kqemu is happier having garbage in the cur_mon than NULL > in a central place. > > Explanation: M$' C runtime is not C99 compliant. It interprets %llu to > mean "unsigned long", not "unsigned long long". As a consequence, the > bitwidths of the parameters are interpreted wrong, so that pointers after > that parameter point anywhere but the correct address. > > As far as I can tell, TDM's GCC works around most of the issue, but forgot > snprintf and vsnprintf. > > You might also be interested in this: > > https://sourceforge.net/tracker/index.php?func=detail&aid=2671742&group_id=200665&atid=974439 > > Hth, > Dscho > > > >