|
From: SF/projects/mingw n. l. <min...@li...> - 2013-01-11 17:39:23
|
Bugs item #1445218, was opened at 2006-03-07 15:28 Message generated for change (Comment added) made by earnie You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=1445218&group_id=2435 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: gcc >Group: Aged issue >Status: Closed >Resolution: Out of Date Priority: 5 Private: No Submitted By: WhoopDeDo.org (telliamed) Assigned to: Nobody/Anonymous (nobody) Summary: DLL crashes when loaded by non-GCC app in Win9x Initial Comment: When a DLL that is compiled using GCC 3.4 is loaded by an EXE that was compiled by something other than GCC, the DLL may crash when the _w32_sharedptr is dereferenced. This only occurs in Windows 9x. WinXP and 2k seem to be unaffected. The following code will demonstrate the bug. // File: dlltester.c #include <windows.h> typedef void (__cdecl *proc)(const char*); int main(int argc, char *argv[]) { HMODULE l,m; proc o; m = LoadLibraryA("dlltest.dll"); o = (proc)GetProcAddress(m, "_Z14cplusplus_testPKc"); o("C++ Test Passed 1."); FreeLibrary(m); l = LoadLibraryA("dlltest.dll"); o = (proc)GetProcAddress(l, "_Z14cplusplus_testPKc"); o("C++ Test Passed 2."); return 0; } // File: dlltest.cc #include <iostream> void __declspec(dllexport) __cdecl cplusplus_test(const char * s) { std::cout << s << std::endl; } // End code. Build dlltester.exe using something other than GCC, and dlltest.dll with GCC. It should crash when the DLL function is accessed the second time. I suspect the use of malloc in w32_sharedptr.c. Changing this to the native GlobalAlloc function might avoid the problem. ---------------------------------------------------------------------- >Comment By: Earnie Boyd (earnie) Date: 2013-01-11 09:39 Message: Win9x is not being supported, no one has a system to test it, no one is supplying patches to the upstream systems, it is ludicrous to try to test all combinations of various compiler object with all versions of Windows. ---------------------------------------------------------------------- Comment By: Danny Smith (dannysmith) Date: 2006-09-02 02:23 Message: Logged In: YES user_id=11494 Sorry, I can't help since I don't have a W9x with which to test. FWIW, the w32_sharedptr business may get stuffed into an attic indefinitely (that is my personal opinion, based on maintenance burden it imposes) so the bug may just disappear anyway. Danny ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=102435&aid=1445218&group_id=2435 |