Mailing-List: contact cygwin-developers-help AT sourceware DOT cygnus DOT com; run by ezmlm List-Subscribe: List-Archive: List-Post: List-Help: , Sender: cygwin-developers-owner AT sourceware DOT cygnus DOT com Delivered-To: mailing list cygwin-developers AT sourceware DOT cygnus DOT com Message-ID: <779F20BCCE5AD31186A50008C75D9979171740@silldn_mail1.sanwaint.com> From: "Fifer, Eric" To: cygwin-developers AT sourceware DOT cygnus DOT com Subject: _impure_ptr uninitialized in DLLs? Date: Wed, 5 Jul 2000 12:50:29 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2650.21) Content-Type: text/plain; charset="iso-8859-1" Starting with the Jul-01 snapshot, something changed with the handling of _impure_ptr so that within a newly compiled DLL its value is NULL. Previously compiled DLLs continue to work. Presumably this is related to the restructuring of user_data. I'll try to hunt down the problem, but thought I should report it in the meantime. This is a demonstration of the problem: d.c: #include int __declspec(dllexport) d() { printf("in d\n"); printf("_impure_ptr=%x\n", _impure_ptr); fprintf(stdout, "in d\n"); } m.c: #include main() { printf("_impure_ptr=%x\n", _impure_ptr); d(); } compile: gcc -g -c d.c dllwrap --output-lib libd.a --dllname libd.dll d.o gcc -g -c m.c gcc -o m m.o -L. -Wl,--Bstatic -ld -Wl,--Bdynamic run: _impure_ptr=6108c0c0 in d _impure_ptr=0 0 [main] m 1130 handle_exceptions: Exception: STATUS_ACCESS_VIOLATION 8923 [main] m 1130 stackdump: Dumping stack trace to m.exe.stackdump prior to Jul-01: _impure_ptr=6108c0c0 in d _impure_ptr=6108c0c0 in d Thanks, Eric Fifer