From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23505 invoked by alias); 11 Mar 2004 23:30:06 -0000 Mailing-List: contact pthreads-win32-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: pthreads-win32-owner@sources.redhat.com Received: (qmail 23495 invoked from network); 11 Mar 2004 23:30:05 -0000 Received: from unknown (HELO havana.ucdavis.edu) (169.237.104.156) by sources.redhat.com with SMTP; 11 Mar 2004 23:30:05 -0000 Received: from phaenicia.ucdavis.edu (phaenicia.ucdavis.edu [169.237.104.170]) by havana.ucdavis.edu (8.12.10/8.12.9/it-defang-5.2.0) with ESMTP id i2BNU3vp015555 for ; Thu, 11 Mar 2004 15:30:03 -0800 (PST) Received: from phaenicia.ucdavis.edu (localhost [127.0.0.1]) by phaenicia.ucdavis.edu (8.12.10/8.12.9/UCD5.2.0) with ESMTP id i2BNU2FB004380 for ; Thu, 11 Mar 2004 15:30:02 -0800 (PST) Received: (from www@localhost) by phaenicia.ucdavis.edu (8.12.10/8.12.9/Submit) id i2BNU2Oh004379; Thu, 11 Mar 2004 15:30:02 -0800 (PST) Date: Thu, 11 Mar 2004 23:30:00 -0000 Message-Id: <200403112330.i2BNU2Oh004379@phaenicia.ucdavis.edu> To: pthreads-win32@sources.redhat.com Subject: CRT runtime error with .Net 2003 From: "Brian Bazyk" X-Errors-To: bnbazyk@scarlet.ucdavis.edu X-Originating-IP: [168.150.235.20] X-User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 1.1.4322) X-Scanned-By: MIMEDefang 2.36 X-SW-Source: 2004/txt/msg00030.txt.bz2 Hi, I'm very new here but you seem like a helpful bunch of people. I have the glorious job of porting a Linux application that uses pthreads to Win32 .Net 2003. The app used pthreads so I'm linking statically with the pthreadsVC library. I'm compiling with MTd runtime's and using IgnoreLib:libcmtd;libmmt to deal with some redefined function issues. I'm recieving a runtime write segfault on the line: fprintf(stderr,"Program usage: %s .pred | .pdb\n",argv[0]); Debugging at the segfault gives me (_file.c): void __cdecl _lock_file ( void *pf ) { /* * The way the FILE (pointed to by pf) is locked depends on whether * it is part of _iob[] or not */ if ( (pf >= (void *)_iob) && (pf <= (void *)(&_iob[_IOB_ENTRIES- 1])) ) /* * FILE lies in _iob[] so the lock lies in _locktable[]. */ _lock( _STREAM_LOCKS + (int)((FILE *)pf - _iob) ); else /* * Not part of _iob[]. Therefore, *pf is a _FILEX and the * lock field of the struct is an initialized critical * section. */ !!ThisLine!! EnterCriticalSection( &(((_FILEX *)pf)->lock) ); } Any idea what's wrong with my CRT? Are there any particular linker options or something else I may not be aware of? Could this even be related to pthreads or is it something else wrong with the project. Any ideas would be appreciated. Thanks in advance, ~Brian