From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7266 invoked by alias); 25 Feb 2011 21:37:34 -0000 Received: (qmail 7255 invoked by uid 22791); 25 Feb 2011 21:37:34 -0000 X-SWARE-Spam-Status: No, hits=-0.1 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,TW_QW,T_TO_NO_BRKTS_FREEMAIL X-Spam-Check-By: sourceware.org Received: from mail-qw0-f41.google.com (HELO mail-qw0-f41.google.com) (209.85.216.41) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 25 Feb 2011 21:37:29 +0000 Received: by qwd7 with SMTP id 7so2018024qwd.0 for ; Fri, 25 Feb 2011 13:37:27 -0800 (PST) MIME-Version: 1.0 Received: by 10.229.82.14 with SMTP id z14mr2210056qck.257.1298669847692; Fri, 25 Feb 2011 13:37:27 -0800 (PST) Received: by 10.229.84.144 with HTTP; Fri, 25 Feb 2011 13:37:27 -0800 (PST) Date: Fri, 25 Feb 2011 21:37:00 -0000 Message-ID: Subject: Still fighting 64-bit From: Yuri Sadykov To: pthreads-win32@sourceware.org Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact pthreads-win32-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: pthreads-win32-owner@sourceware.org X-SW-Source: 2011/txt/msg00009.txt.bz2 Guys, I still unclear of 64-bit support of current pthread inmlementation on Windows. I use Visual Studio 2008 to produce native 64-bit executable. I got pthread sources from top of cvs repository and build the library. I read somewhere that static lib is not good for some reasons, so I build DLL. But I have problem with pthread_cond_destroy(), program crashes on that call. pthread_cond_destroy() calls pthread_mutex_trylock(), which tries to call by zero pointer. ptw32_interlocked_compare_exchange should point to actual function but it is NULL pointer. if (0 == (LONG) PTW32_INTERLOCKED_COMPARE_EXCHANGE ( (PTW32_INTERLOCKED_LPLONG) &mx->lock_idx, (PTW32_INTERLOCKED_LONG) 1, (PTW32_INTERLOCKED_LONG) 0)) Any thoughts? Did I miss some important build steps, like special defines or something, or maybe there are patches to current CVS trunk? Best, --Yuri /* * We do a quick check to see if we need to do more work * to initialise a static mutex. We check * again inside the guarded section of ptw32_mutex_check_need_init() * to avoid race conditions. */ if (*mutex >= PTHREAD_ERRORCHECK_MUTEX_INITIALIZER) 0000000180006432 mov rax,qword ptr [mutex] 000000018000643A cmp qword ptr [rax],0FFFFFFFFFFFFFFFDh 000000018000643E jb pthread_mutex_trylock+61h (180006461h) { if ((result = ptw32_mutex_check_need_init (mutex)) != 0) 0000000180006440 mov rcx,qword ptr [mutex] 0000000180006448 call @ILT+440(ptw32_mutex_check_need_init) (1800011BDh) 000000018000644D mov dword ptr [result],eax 0000000180006451 cmp dword ptr [result],0 0000000180006456 je pthread_mutex_trylock+61h (180006461h) { return (result); 0000000180006458 mov eax,dword ptr [result] 000000018000645C jmp pthread_mutex_trylock+13Ch (18000653Ch) } } mx = *mutex; 0000000180006461 mov rax,qword ptr [mutex] 0000000180006469 mov rax,qword ptr [rax] 000000018000646C mov qword ptr [mx],rax if (0 == (LONG) PTW32_INTERLOCKED_COMPARE_EXCHANGE ( (PTW32_INTERLOCKED_LPLONG) &mx->lock_idx, (PTW32_INTERLOCKED_LONG) 1, (PTW32_INTERLOCKED_LONG) 0)) 0000000180006471 xor r8d,r8d 0000000180006474 mov edx,1 0000000180006479 mov rcx,qword ptr [mx] 000000018000647E call qword ptr [ptw32_interlocked_compare_exchange (180016240h)] 0000000180006484 test eax,eax 0000000180006486 jne pthread_mutex_trylock+0CFh (1800064CFh) { if (mx->kind != PTHREAD_MUTEX_NORMAL) 0000000180006488 mov rax,qword ptr [mx] 000000018000648D cmp dword ptr [rax+8],0 0000000180006491 je pthread_mutex_trylock+0CDh (1800064CDh) { mx->recursive_count = 1;