From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 11048 invoked by alias); 12 Mar 2004 11:17:58 -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 11038 invoked from network); 12 Mar 2004 11:17:57 -0000 Received: from unknown (HELO hotmail.com) (65.54.246.83) by sources.redhat.com with SMTP; 12 Mar 2004 11:17:57 -0000 Received: from mail pickup service by hotmail.com with Microsoft SMTPSVC; Fri, 12 Mar 2004 03:17:56 -0800 Received: from 62.245.182.10 by bay2-dav26.bay2.hotmail.com with DAV; Fri, 12 Mar 2004 11:17:56 +0000 X-Originating-IP: [62.245.182.10] X-Originating-Email: [vcotirlea1@hotmail.com] X-Sender: vcotirlea1@hotmail.com From: "vc" To: , "Brian Bazyk" References: <200403112330.i2BNU2Oh004379@phaenicia.ucdavis.edu> Subject: Re: CRT runtime error with .Net 2003 Date: Fri, 12 Mar 2004 11:17:00 -0000 MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-ID: X-OriginalArrivalTime: 12 Mar 2004 11:17:56.0367 (UTC) FILETIME=[AB4749F0:01C40823] X-SW-Source: 2004/txt/msg00032.txt.bz2 Hi Brian, I have never tried to use pthread as a static lib, so I can't help you here. But if you use the pthread as a dll, and if you use the /MT flag, one of it's tests will fail, so for a dll you have to use the /MD flag. Nevertheless, you should use for your app the same flag /MT or /MD for _all_ the modules involved, otherwise you can get into trouble. Viv ----- Original Message ----- From: "Brian Bazyk" To: Sent: Friday, March 12, 2004 12:30 AM Subject: CRT runtime error with .Net 2003 > > 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 | file>.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 >