public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* 1.7.9: static const std::string initialization lost in child process when using fork, dlopen
@ 2011-08-21 11:48 whans
  2011-08-21 16:50 ` Christopher Faylor
  2011-08-21 17:05 ` Christopher Faylor
  0 siblings, 2 replies; 13+ messages in thread
From: whans @ 2011-08-21 11:48 UTC (permalink / raw)
  To: cygwin

[-- Attachment #1: Type: text/plain, Size: 2565 bytes --]

Hello,
 
it seems that a child process does not see the initialization of a
static const std::string variable if it is defined in a dll. Instead this corrupt variable
lead to a STATUS_ACCESS_VIOLATION.
 
The following 4 example files demonstrate this behaviour:
 
1) dllif.h:      (define the dll's interface)
#include <string>
class cTestIf {
public:
  virtual std::string get() = 0;
};
 
 
2) dll.h:        (member variable t will cause the child's stackdump)
#include "dllif.h"
class cTest : public cTestIf {
public:
  static const std::string t;
  virtual std::string get() {
      return cTest::t;
  }
};
 
 
3) dll.cpp      (definition of dll including initializer of t)
#include "dll.h"
const std::string cTest::t = "Test";
 
extern "C" cTest* getTest() {
   return new cTest();
}
 
 
4) test.cpp    (fork child, load dll and print cTest::t both in parent and child)
#include <unistd.h>
#include <dlfcn.h>
#include "dllif.h"
#include <iostream>
 
typedef cTestIf *(*tFunc)();
 
void load(const char *p) {
  void* lib = dlopen("libdll.dll", RTLD_NOW|RTLD_GLOBAL);
  tFunc func = (tFunc)dlsym(lib, "getTest");
  cTestIf* test = func();
  std::cerr << p << ":" << test->get() << "\n";
}
 
main() {
   if (fork())
      load("parent");
   else {
      sleep(30);  // keep child alive to enable attachment from gdb
      load("child");
   }
}
 
 
 
commands used to create dll and test program:
g++ -g -c dll.cpp -o dll.o
g++ -shared -o libdll.dll dll.o
g++ -g -c test.cpp -o test.o
g++ -o test test.o -L. -ldll
 
 
./test.exe prints only 'parent:Test' - parent works as expected - and gives a
test.exe.stackdump - after 30 seconds.
 
 
an example gdb session looks like:
attach <child pid>
b load
c           (needs up to 30 seconds for return)
n
n
n
s           (step into dll's cTest::get method)
p t         (print cTest::t, _M_p seems to be corrupt)
$1 = {static npos = <optimized out>,
  _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<
No data fields>}, <No data fields>}, _M_p = 0x0}}
n
Program received signal SIGSEGV, Segmentation fault.
0x6c4b95be in cygstdc++-6!_ZNSsC1ERKSs () from /usr/bin/cygstdc++-6.dll
 
 Any idea to fix or circumvent this error?

Regards,
Werner
___________________________________________________________
Schon gehört? WEB.DE hat einen genialen Phishing-Filter in die
Toolbar eingebaut! http://produkte.web.de/go/toolbar

[-- Attachment #2: test.exe.stackdump --]
[-- Type: application/octet-stream, Size: 636 bytes --]

Exception: STATUS_ACCESS_VIOLATION at eip=6C4B95BE
eax=00000000 ebx=0022CD30 ecx=68F01870 edx=FFFFFFF4 esi=61243A2F edi=00000000
ebp=0022CCE8 esp=0022CCC0 program=D:\temp\MAts50\test\test.exe, pid 9440, thread main
cs=001B ds=0023 es=0023 fs=003B gs=0000 ss=0023
Stack trace:
Frame     Function  Args
0022CCE8  6C4B95BE  (0022CD30, 68F04020, 0022CD08, 68F011D5)
0022CD08  68F0188C  (0022CD30, 004B8420, 00000BB8, 61243A26)
0022CD48  00401249  (004020BE, 0022CD70, 0022CD98, 61007038)
0022CD58  0040130F  (61243A2F, 00000000, 0022CD98, 61007038)
0022CD98  61007038  (00000000, 0022CDD4, 61006980, 7FFD8000)
End of stack trace

[-- Attachment #3: cygcheck.out --]
[-- Type: application/octet-stream, Size: 28601 bytes --]


Cygwin Configuration Diagnostics
Current System Time: Sun Aug 21 12:27:37 2011

Windows XP Professional Ver 5.1 Build 2600 Service Pack 3

Path:	C:\Programme\cygwin\usr\local\bin
	C:\Programme\cygwin\bin
	C:\Programme\Oracle\Client\bin
	C:\Programme\Java\jdk6\bin
	C:\WINDOWS\system32
	C:\WINDOWS
	C:\WINDOWS\System32\Wbem
	C:\WINDOWS\system32\nls
	C:\WINDOWS\system32\nls\ENGLISH
	C:\PROGRA~1\IBM\SQLLIB\BIN
	C:\PROGRA~1\IBM\SQLLIB\FUNCTION
	C:\PROGRA~1\IBM\SQLLIB\SAMPLES\REPL
	C:\WINDOWS\system32\WindowsPowerShell\v1.0
	C:\Programme\Windows Imaging
	C:\Programme\WinSCP\PuTTY
	C:\Programme\WinSCP

Output from C:\Programme\cygwin\bin\id.exe
UID: 12244(weh)      GID: 10513(mkgroup)
10513(mkgroup)       0(root)              544(Administratoren)
545(Benutzer)        1006(ORA_DBA)

SysDir: C:\WINDOWS\system32
WinDir: C:\WINDOWS

USER = 'weh'
PWD = '/cygdrive/d/temp/MAts50/test'
HOME = '/home/weh'

HOMEPATH = '\Dokumente und Einstellungen\weh'
MANPATH = '/usr/local/man:/usr/share/man:/usr/man::/usr/ssl/man'
DB2INSTANCE = 'DB2'
APPDATA = 'D:\Dokumente und Einstellungen\weh\Anwendungsdaten'
HOSTNAME = 'DEACN292'
TERM = 'cygwin'
VWS_LOGGING = 'C:\PROGRA~1\IBM\SQLLIB\LOGGING'
PROCESSOR_IDENTIFIER = 'x86 Family 6 Model 23 Stepping 6, GenuineIntel'
WINDIR = 'C:\WINDOWS'
DB2TEMPDIR = 'C:\PROGRA~1\IBM\SQLLIB\'
OLDPWD = '/cygdrive/d/temp/MAts50'
JBOSS_HOME = 'D:\appserver\jboss-5.0.1.GA'
UATDATA = 'C:\WINDOWS\system32\CCM\UATData\D9F8C395-CAB8-491d-B8AC-179A1FE1BE77'
OS = 'Windows_NT'
ALLUSERSPROFILE = 'D:\Dokumente und Einstellungen\All Users'
VBOX_INSTALL_PATH = 'C:\Programme\VirtualBox\'
TEMP = '/tmp'
DEFLOGDIR = 'D:\Dokumente und Einstellungen\All Users\Anwendungsdaten\McAfee\DesktopProtection'
COMMONPROGRAMFILES = 'C:\Programme\Gemeinsame Dateien'
LIB = ';C:\PROGRA~1\IBM\SQLLIB\LIB'
USERNAME = 'weh'
PROCESSOR_LEVEL = '6'
PSModulePath = 'C:\WINDOWS\system32\WindowsPowerShell\v1.0\Modules\'
FP_NO_HOST_CHECK = 'NO'
SYSTEMDRIVE = 'C:'
__COMPAT_LAYER = 'EnableNXShowUI '
JAVA_HOME = 'C:\Programme\Java\jdk6'
LANG = 'C.UTF-8'
VWS_TEMPLATES = 'C:\PROGRA~1\IBM\SQLLIB\TEMPLATES'
USERPROFILE = 'D:\Dokumente und Einstellungen\weh'
PS1 = '\[\][\u@\h] \W \$ '
LOGONSERVER = '\\DEACDC002'
SQLPATH = 'C:\Programme\Oracle\Client\sqlplus'
MeetingCenterApp = 'C:\Programme\Meeting Center\'
PROCESSOR_ARCHITECTURE = 'x86'
!C: = 'C:\Programme\cygwin\bin'
SHLVL = '1'
USERDNSDOMAIN = 'DEAC.AWL.ATOSORIGIN.NET'
PATHEXT = '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.PSC1'
HOMEDRIVE = 'D:'
VWSPATH = 'C:\PROGRA~1\IBM\SQLLIB'
PROMPT = '$P$G'
COMSPEC = 'C:\WINDOWS\system32\cmd.exe'
TMP = '/tmp'
SYSTEMROOT = 'C:\WINDOWS'
PRINTER = '\\DEACCRP001\DEACPR060_Erweitert'
PROCESSOR_REVISION = '1706'
CLASSPATH = '.;C:\PROGRA~1\IBM\SQLLIB\java\db2java.zip;C:\PROGRA~1\IBM\SQLLIB\java\db2jcc.jar;C:\PROGRA~1\IBM\SQLLIB\java\db2jcc_license_cu.jar;C:\PROGRA~1\IBM\SQLLIB\bin;C:\PROGRA~1\IBM\SQLLIB\tools\db2XTrigger.jar;C:\PROGRA~1\IBM\SQLLIB\java\common.jar'
INFOPATH = '/usr/local/info:/usr/share/info:/usr/info:'
PROGRAMFILES = 'C:\Programme'
NUMBER_OF_PROCESSORS = '2'
VSEDEFLOGDIR = 'D:\Dokumente und Einstellungen\All Users\Anwendungsdaten\McAfee\DesktopProtection'
INCLUDE = 'C:\PROGRA~1\IBM\SQLLIB\INCLUDE;C:\PROGRA~1\IBM\SQLLIB\LIB'
SESSIONNAME = 'Console'
COMPUTERNAME = 'DEACN292'
_ = '/usr/bin/cygcheck'

HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2
  (default) = '/cygdrive'
  cygdrive flags = 0x00000022
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2\/
  (default) = 'C:\Programme\cygwin'
  flags = 0x00000002
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2\/usr/bin
  (default) = 'C:\Programme\cygwin/bin'
  flags = 0x00000002
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\mounts v2\/usr/lib
  (default) = 'C:\Programme\cygwin/lib'
  flags = 0x00000002
HKEY_CURRENT_USER\Software\Cygnus Solutions\Cygwin\Program Options
HKEY_CURRENT_USER\Software\Cygwin
HKEY_CURRENT_USER\Software\Cygwin\Program Options
HKEY_CURRENT_USER\Software\Cygwin\setup
HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\MenuOrder\Start Menu\Programs\Cygwin
  (default) = (unsupported type)
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\mounts v2
HKEY_LOCAL_MACHINE\SOFTWARE\Cygnus Solutions\Cygwin\Program Options
HKEY_LOCAL_MACHINE\SOFTWARE\Cygwin
HKEY_LOCAL_MACHINE\SOFTWARE\Cygwin\Installations
  (default) = '\??\C:\Programme\cygwin'
HKEY_LOCAL_MACHINE\SOFTWARE\Cygwin\Program Options
HKEY_LOCAL_MACHINE\SOFTWARE\Cygwin\setup
  (default) = 'C:\Programme\cygwin'

obcaseinsensitive set to 1

Cygwin installations found in the registry:
  System: Key: 08faf5097008e83b Path: C:\Programme\cygwin

c:  hd  NTFS     35000Mb  59% CP CS UN PA FC     Winxp
d:  hd  NTFS     41315Mb  94% CP CS UN PA FC     DATEN
e:  cd             N/A    N/A                    
f:  hd  NTFS      8191Mb  33% CP CS UN PA FC     

C:\Programme\cygwin      /          system  binary,auto
C:\Programme\cygwin\bin  /usr/bin   system  binary,auto
C:\Programme\cygwin\lib  /usr/lib   system  binary,auto
cygdrive prefix          /cygdrive  user    binary,auto

Found: C:\Programme\cygwin\bin\awk
 -> C:\Programme\cygwin\bin\gawk.exe
Found: C:\Programme\cygwin\bin\bash.exe
Found: C:\Programme\cygwin\bin\cat.exe
Found: C:\Programme\cygwin\bin\cp.exe
Found: C:\Programme\cygwin\bin\cpp.exe
 -> C:\Programme\cygwin\etc\alternatives\cpp
 -> C:\Programme\cygwin\bin\cpp-4.exe
Not Found: crontab
Found: C:\Programme\cygwin\bin\find.exe
Found: C:\WINDOWS\system32\find.exe
Warning: C:\Programme\cygwin\bin\find.exe hides C:\WINDOWS\system32\find.exe
Found: C:\Programme\cygwin\bin\gcc.exe
 -> C:\Programme\cygwin\etc\alternatives\gcc
 -> C:\Programme\cygwin\bin\gcc-4.exe
Found: C:\Programme\cygwin\bin\gdb.exe
Found: C:\Programme\cygwin\bin\grep.exe
Found: C:\Programme\cygwin\bin\kill.exe
Found: C:\Programme\cygwin\bin\ld.exe
Found: C:\Programme\cygwin\bin\ls.exe
Found: C:\Programme\cygwin\bin\make.exe
Found: C:\Programme\cygwin\bin\mv.exe
Not Found: patch
Found: C:\Programme\cygwin\bin\perl.exe
Found: C:\Programme\cygwin\bin\rm.exe
Found: C:\Programme\cygwin\bin\sed.exe
Not Found: ssh
Found: C:\Programme\cygwin\bin\sh.exe
Found: C:\Programme\cygwin\bin\tar.exe
Found: C:\Programme\cygwin\bin\test.exe
Found: C:\Programme\cygwin\bin\vi
 -> C:\Programme\cygwin\bin\vim-nox.exe
Found: C:\Programme\cygwin\bin\vim
 -> C:\Programme\cygwin\etc\alternatives\vim
 -> C:\Programme\cygwin\bin\vim-nox.exe

  117k 2011/05/16 C:\Programme\cygwin\bin\cygapr-1-0.dll - os=4.0 img=1.0 sys=4.0
                  "cygapr-1-0.dll" v0.0 ts=2011/5/16 19:15
   86k 2010/10/04 C:\Programme\cygwin\bin\cygaprutil-1-0.dll - os=4.0 img=1.0 sys=4.0
                  "cygaprutil-1-0.dll" v0.0 ts=2010/10/5 0:28
   15k 2009/12/27 C:\Programme\cygwin\bin\cygattr-1.dll - os=4.0 img=1.0 sys=4.0
                  "cygattr-1.dll" v0.0 ts=2009/11/18 13:52
   64k 2010/05/17 C:\Programme\cygwin\bin\cygboost_date_time-mt-1_43.dll - os=4.0 img=1.0 sys=4.0
                  "cygboost_date_time-mt-1_43.dll" v0.0 ts=2010/5/17 4:04
   76k 2010/05/17 C:\Programme\cygwin\bin\cygboost_filesystem-mt-1_43.dll - os=4.0 img=1.0 sys=4.0
                  "cygboost_filesystem-mt-1_43.dll" v0.0 ts=2010/5/17 4:04
  346k 2010/05/17 C:\Programme\cygwin\bin\cygboost_graph-mt-1_43.dll - os=4.0 img=1.0 sys=4.0
                  "cygboost_graph-mt-1_43.dll" v0.0 ts=2010/5/17 4:04
   92k 2010/05/17 C:\Programme\cygwin\bin\cygboost_iostreams-mt-1_43.dll - os=4.0 img=1.0 sys=4.0
                  "cygboost_iostreams-mt-1_43.dll" v0.0 ts=2010/5/17 4:04
  122k 2010/05/17 C:\Programme\cygwin\bin\cygboost_math_c99-mt-1_43.dll - os=4.0 img=1.0 sys=4.0
                  "cygboost_math_c99-mt-1_43.dll" v0.0 ts=2010/5/17 4:00
  122k 2010/05/17 C:\Programme\cygwin\bin\cygboost_math_c99f-mt-1_43.dll - os=4.0 img=1.0 sys=4.0
                  "cygboost_math_c99f-mt-1_43.dll" v0.0 ts=2010/5/17 4:01
  270k 2010/05/17 C:\Programme\cygwin\bin\cygboost_math_tr1-mt-1_43.dll - os=4.0 img=1.0 sys=4.0
                  "cygboost_math_tr1-mt-1_43.dll" v0.0 ts=2010/5/17 3:59
  272k 2010/05/17 C:\Programme\cygwin\bin\cygboost_math_tr1f-mt-1_43.dll - os=4.0 img=1.0 sys=4.0
                  "cygboost_math_tr1f-mt-1_43.dll" v0.0 ts=2010/5/17 3:59
   56k 2010/05/17 C:\Programme\cygwin\bin\cygboost_prg_exec_monitor-mt-1_43.dll - os=4.0 img=1.0 sys=4.0
                  "cygboost_prg_exec_monitor-mt-1_43.dll" v0.0 ts=2010/5/17 4:03
  297k 2010/05/17 C:\Programme\cygwin\bin\cygboost_program_options-mt-1_43.dll - os=4.0 img=1.0 sys=4.0
                  "cygboost_program_options-mt-1_43.dll" v0.0 ts=2010/5/17 4:01
  269k 2010/05/17 C:\Programme\cygwin\bin\cygboost_python-mt-1_43.dll - os=4.0 img=1.0 sys=4.0
                  "cygboost_python-mt-1_43.dll" v0.0 ts=2010/5/17 3:58
   17k 2010/05/17 C:\Programme\cygwin\bin\cygboost_random-mt-1_43.dll - os=4.0 img=1.0 sys=4.0
                  "cygboost_random-mt-1_43.dll" v0.0 ts=2010/5/17 3:58
  627k 2010/05/17 C:\Programme\cygwin\bin\cygboost_regex-mt-1_43.dll - os=4.0 img=1.0 sys=4.0
                  "cygboost_regex-mt-1_43.dll" v0.0 ts=2010/5/17 4:04
  435k 2010/05/17 C:\Programme\cygwin\bin\cygboost_serialization-mt-1_43.dll - os=4.0 img=1.0 sys=4.0
                  "cygboost_serialization-mt-1_43.dll" v0.0 ts=2010/5/17 4:02
   72k 2010/05/17 C:\Programme\cygwin\bin\cygboost_signals-mt-1_43.dll - os=4.0 img=1.0 sys=4.0
                  "cygboost_signals-mt-1_43.dll" v0.0 ts=2010/5/17 4:03
   15k 2010/05/17 C:\Programme\cygwin\bin\cygboost_system-mt-1_43.dll - os=4.0 img=1.0 sys=4.0
                  "cygboost_system-mt-1_43.dll" v0.0 ts=2010/5/17 4:04
   74k 2010/05/17 C:\Programme\cygwin\bin\cygboost_thread-mt-1_43.dll - os=4.0 img=1.0 sys=4.0
                  "cygboost_thread-mt-1_43.dll" v0.0 ts=2010/5/17 4:03
  574k 2010/05/17 C:\Programme\cygwin\bin\cygboost_unit_test_framework-mt-1_43.dll - os=4.0 img=1.0 sys=4.0
                  "cygboost_unit_test_framework-mt-1_43.dll" v0.0 ts=2010/5/17 4:03
  994k 2010/05/17 C:\Programme\cygwin\bin\cygboost_wave-mt-1_43.dll - os=4.0 img=1.0 sys=4.0
                  "cygboost_wave-mt-1_43.dll" v0.0 ts=2010/5/17 4:04
   62k 2011/05/21 C:\Programme\cygwin\bin\cygbz2-1.dll - os=4.0 img=1.0 sys=4.0
                  "cygbz2-1.dll" v0.0 ts=2011/5/21 21:16
    8k 2011/01/28 C:\Programme\cygwin\bin\cygcharset-1.dll - os=4.0 img=1.0 sys=4.0
                  "cygcharset-1.dll" v0.0 ts=2011/1/28 4:51
  108k 2010/01/05 C:\Programme\cygwin\bin\cygcloog-0.dll - os=4.0 img=1.0 sys=4.0
                  "cygcloog-0.dll" v0.0 ts=2010/1/5 1:45
  231k 2009/03/31 C:\Programme\cygwin\bin\cygcppunit-1-12-1.dll - os=4.0 img=1.0 sys=4.0
                  "cygcppunit-1-12-1.dll" v0.0 ts=2009/4/1 0:38
    7k 2003/10/19 C:\Programme\cygwin\bin\cygcrypt-0.dll - os=4.0 img=1.0 sys=4.0
                  "cygcrypt-0.dll" v0.0 ts=2003/10/19 9:57
 1147k 2011/03/16 C:\Programme\cygwin\bin\cygcrypto-0.9.8.dll - os=4.0 img=1.0 sys=4.0
                  "cygcrypto-0.9.8.dll" v0.0 ts=2011/3/16 21:54
  943k 2007/12/17 C:\Programme\cygwin\bin\cygdb-4.5.dll - os=4.0 img=1.0 sys=4.0
                  "cygdb-4.5.dll" v0.0 ts=2007/12/17 14:12
 1296k 2007/12/17 C:\Programme\cygwin\bin\cygdb_cxx-4.5.dll - os=4.0 img=1.0 sys=4.0
                  "cygdb_cxx-4.5.dll" v0.0 ts=2007/12/17 14:12
  118k 2008/05/09 C:\Programme\cygwin\bin\cygexpat-1.dll - os=4.0 img=1.0 sys=4.0
                  "cygexpat-1.dll" v0.0 ts=2008/5/9 6:03
   22k 2011/03/22 C:\Programme\cygwin\bin\cygffi-4.dll - os=4.0 img=1.0 sys=4.0
                  "cygffi-4.dll" v0.0 ts=2011/3/22 5:13
   43k 2010/01/02 C:\Programme\cygwin\bin\cygform-10.dll - os=4.0 img=1.0 sys=4.0
                  "cygform-10.dll" v0.0 ts=2010/1/2 15:49
   40k 2009/03/01 C:\Programme\cygwin\bin\cygform-8.dll - os=4.0 img=1.0 sys=4.0
                  "cygform-8.dll" v0.0 ts=2009/3/1 7:32
   43k 2009/11/20 C:\Programme\cygwin\bin\cygform-9.dll - os=4.0 img=1.0 sys=4.0
                  "cygform-9.dll" v0.0 ts=2009/11/20 20:14
   47k 2010/01/02 C:\Programme\cygwin\bin\cygformw-10.dll - os=4.0 img=1.0 sys=4.0
                  "cygformw-10.dll" v0.0 ts=2010/1/2 18:31
   44k 2011/03/22 C:\Programme\cygwin\bin\cyggcc_s-1.dll - os=4.0 img=1.0 sys=4.0
                  "cyggcc_s-1.dll" v0.0 ts=2011/3/22 5:02
   19k 2009/02/26 C:\Programme\cygwin\bin\cyggdbm-4.dll - os=4.0 img=1.0 sys=4.0
                  "cyggdbm-4.dll" v0.0 ts=2009/2/26 8:58
    8k 2009/02/26 C:\Programme\cygwin\bin\cyggdbm_compat-4.dll - os=4.0 img=1.0 sys=4.0
                  "cyggdbm_compat-4.dll" v0.0 ts=2009/2/26 8:58
  317k 2011/07/31 C:\Programme\cygwin\bin\cyggmp-3.dll - os=4.0 img=1.0 sys=4.0
                  "cyggmp-3.dll" v0.0 ts=2011/7/31 7:14
   14k 2011/07/31 C:\Programme\cygwin\bin\cyggmpxx-4.dll - os=4.0 img=1.0 sys=4.0
                  "cyggmpxx-4.dll" v0.0 ts=2011/7/31 12:31
   25k 2011/03/22 C:\Programme\cygwin\bin\cyggomp-1.dll - os=4.0 img=1.0 sys=4.0
                  "cyggomp-1.dll" v0.0 ts=2011/3/22 5:16
   25k 2011/01/26 C:\Programme\cygwin\bin\cyghistory7.dll - os=4.0 img=1.0 sys=4.0
                  "cyghistory7.dll" v0.0 ts=2011/1/26 4:25
  358k 2011/04/29 C:\Programme\cygwin\bin\cygicons-0.dll - os=4.0 img=1.4 sys=4.0
                  "cygicons-0.dll" v0.0 ts=2011/4/29 6:37
  980k 2011/01/28 C:\Programme\cygwin\bin\cygiconv-2.dll - os=4.0 img=1.0 sys=4.0
                  "cygiconv-2.dll" v0.0 ts=2011/1/28 4:52
10921k 2009/12/27 C:\Programme\cygwin\bin\cygicudata38.dll - os=4.0 img=1.0 sys=4.0
                  "cygicudata38.dll" v0.0 ts=2009/12/27 12:06
 1218k 2009/12/27 C:\Programme\cygwin\bin\cygicui18n38.dll - os=4.0 img=1.0 sys=4.0
                  "cygicui18n38.dll" v0.0 ts=2009/12/27 12:02
   35k 2009/12/27 C:\Programme\cygwin\bin\cygicuio38.dll - os=4.0 img=1.0 sys=4.0
                  "cygicuio38.dll" v0.0 ts=2009/12/27 12:06
  230k 2009/12/27 C:\Programme\cygwin\bin\cygicule38.dll - os=4.0 img=1.0 sys=4.0
                  "cygicule38.dll" v0.0 ts=2009/12/27 12:03
   42k 2009/12/27 C:\Programme\cygwin\bin\cygiculx38.dll - os=4.0 img=1.0 sys=4.0
                  "cygiculx38.dll" v0.0 ts=2009/12/27 12:04
  115k 2010/09/16 C:\Programme\cygwin\bin\cygicutu45.dll - os=4.0 img=1.0 sys=4.0
                  "cygicutu45.dll" v0.0 ts=2010/9/16 13:15
 1038k 2009/12/27 C:\Programme\cygwin\bin\cygicuuc38.dll - os=4.0 img=1.0 sys=4.0
                  "cygicuuc38.dll" v0.0 ts=2009/12/27 11:59
   31k 2009/04/03 C:\Programme\cygwin\bin\cygintl-8.dll - os=4.0 img=1.0 sys=4.0
                  "cygintl-8.dll" v0.0 ts=2009/4/3 3:15
   39k 2008/09/07 C:\Programme\cygwin\bin\cyglber-2-3-0.dll - os=4.0 img=1.0 sys=4.0
                  "cyglber-2-3-0.dll" v0.0 ts=2008/9/7 14:28
  189k 2008/09/07 C:\Programme\cygwin\bin\cygldap-2-3-0.dll - os=4.0 img=1.0 sys=4.0
                  "cygldap-2-3-0.dll" v0.0 ts=2008/9/7 14:29
  201k 2008/09/07 C:\Programme\cygwin\bin\cygldap_r-2-3-0.dll - os=4.0 img=1.0 sys=4.0
                  "cygldap_r-2-3-0.dll" v0.0 ts=2008/9/7 14:31
    5k 2011/03/29 C:\Programme\cygwin\bin\cyglsa.dll - os=4.0 img=1.0 sys=4.0
                  "cyglsa.dll" v0.0 ts=2011/3/28 23:14
    9k 2011/03/29 C:\Programme\cygwin\bin\cyglsa64.dll - os=5.2 img=0.0 sys=5.2
   30k 2010/09/23 C:\Programme\cygwin\bin\cygltdl-7.dll - os=4.0 img=1.0 sys=4.0
                  "cygltdl-7.dll" v0.0 ts=2010/9/23 21:45
  123k 2011/05/19 C:\Programme\cygwin\bin\cyglzma-5.dll - os=4.0 img=1.0 sys=4.0
                  "cyglzma-5.dll" v0.0 ts=2011/5/19 4:41
  103k 2011/02/03 C:\Programme\cygwin\bin\cygmagic-1.dll - os=4.0 img=1.0 sys=4.0
                  "cygmagic-1.dll" v0.0 ts=2011/2/3 10:47
   25k 2010/01/02 C:\Programme\cygwin\bin\cygmenu-10.dll - os=4.0 img=1.0 sys=4.0
                  "cygmenu-10.dll" v0.0 ts=2010/1/2 15:48
   21k 2009/03/01 C:\Programme\cygwin\bin\cygmenu-8.dll - os=4.0 img=1.0 sys=4.0
                  "cygmenu-8.dll" v0.0 ts=2009/3/1 7:31
   25k 2009/11/20 C:\Programme\cygwin\bin\cygmenu-9.dll - os=4.0 img=1.0 sys=4.0
                  "cygmenu-9.dll" v0.0 ts=2009/11/20 20:13
   25k 2010/01/02 C:\Programme\cygwin\bin\cygmenuw-10.dll - os=4.0 img=1.0 sys=4.0
                  "cygmenuw-10.dll" v0.0 ts=2010/1/2 18:30
   24k 2008/10/30 C:\Programme\cygwin\bin\cygminires.dll - os=4.0 img=1.2 sys=4.0
                  "cygminires.dll" v0.0 ts=2008/10/31 0:53
  213k 2011/07/31 C:\Programme\cygwin\bin\cygmp-3.dll - os=4.0 img=1.0 sys=4.0
                  "cygmp-3.dll" v0.0 ts=2011/7/31 7:12
   64k 2009/11/09 C:\Programme\cygwin\bin\cygmpc-1.dll - os=4.0 img=1.0 sys=4.0
                  "cygmpc-1.dll" v0.0 ts=2009/11/9 2:21
  269k 2009/06/07 C:\Programme\cygwin\bin\cygmpfr-1.dll - os=4.0 img=1.0 sys=4.0
                  "cygmpfr-1.dll" v0.0 ts=2009/6/7 23:10
   63k 2010/01/02 C:\Programme\cygwin\bin\cygncurses++-10.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses++-10.dll" v0.0 ts=2010/1/2 16:00
   66k 2009/03/01 C:\Programme\cygwin\bin\cygncurses++-8.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses++-8.dll" v0.0 ts=2009/3/1 7:39
   63k 2009/11/20 C:\Programme\cygwin\bin\cygncurses++-9.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses++-9.dll" v0.0 ts=2009/11/20 20:25
   63k 2010/01/02 C:\Programme\cygwin\bin\cygncurses++w-10.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses++w-10.dll" v0.0 ts=2010/1/2 18:41
  195k 2010/01/02 C:\Programme\cygwin\bin\cygncurses-10.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses-10.dll" v0.0 ts=2010/1/2 15:45
  237k 2009/03/01 C:\Programme\cygwin\bin\cygncurses-8.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses-8.dll" v0.0 ts=2009/3/1 7:28
  198k 2009/11/20 C:\Programme\cygwin\bin\cygncurses-9.dll - os=4.0 img=1.0 sys=4.0
                  "cygncurses-9.dll" v0.0 ts=2009/11/20 20:10
  244k 2010/01/02 C:\Programme\cygwin\bin\cygncursesw-10.dll - os=4.0 img=1.0 sys=4.0
                  "cygncursesw-10.dll" v0.0 ts=2010/1/2 18:28
   13k 2010/01/02 C:\Programme\cygwin\bin\cygpanel-10.dll - os=4.0 img=1.0 sys=4.0
                  "cygpanel-10.dll" v0.0 ts=2010/1/2 15:47
   11k 2009/03/01 C:\Programme\cygwin\bin\cygpanel-8.dll - os=4.0 img=1.0 sys=4.0
                  "cygpanel-8.dll" v0.0 ts=2009/3/1 7:30
   13k 2009/11/20 C:\Programme\cygwin\bin\cygpanel-9.dll - os=4.0 img=1.0 sys=4.0
                  "cygpanel-9.dll" v0.0 ts=2009/11/20 20:12
   13k 2010/01/02 C:\Programme\cygwin\bin\cygpanelw-10.dll - os=4.0 img=1.0 sys=4.0
                  "cygpanelw-10.dll" v0.0 ts=2010/1/2 17:30
  224k 2010/06/15 C:\Programme\cygwin\bin\cygpcre-0.dll - os=4.0 img=1.0 sys=4.0
                  "cygpcre-0.dll" v0.0 ts=2010/6/15 6:10
   10k 2010/06/15 C:\Programme\cygwin\bin\cygpcreposix-0.dll - os=4.0 img=1.0 sys=4.0
                  "cygpcreposix-0.dll" v0.0 ts=2010/6/15 6:11
 1627k 2010/08/29 C:\Programme\cygwin\bin\cygperl5_10.dll - os=4.0 img=1.0 sys=4.0
                  "cygperl5_10.dll" v0.0 ts=2010/8/28 20:17
   22k 2002/06/09 C:\Programme\cygwin\bin\cygpopt-0.dll - os=4.0 img=1.0 sys=4.0
                  "cygpopt-0.dll" v0.0 ts=2002/6/9 7:45
  695k 2009/04/18 C:\Programme\cygwin\bin\cygppl-7.dll - os=4.0 img=1.0 sys=4.0
                  "cygppl-7.dll" v0.0 ts=2009/4/18 14:44
 2481k 2009/04/18 C:\Programme\cygwin\bin\cygppl_c-2.dll - os=4.0 img=1.0 sys=4.0
                  "cygppl_c-2.dll" v0.0 ts=2009/4/18 14:47
  103k 2009/01/07 C:\Programme\cygwin\bin\cygpq.dll - os=4.0 img=1.0 sys=4.0
                  "cygpq.dll" v0.0 ts=2009/1/7 17:46
   18k 2009/04/18 C:\Programme\cygwin\bin\cygpwl-4.dll - os=4.0 img=1.0 sys=4.0
                  "cygpwl-4.dll" v0.0 ts=2009/4/18 14:44
  164k 2011/01/26 C:\Programme\cygwin\bin\cygreadline7.dll - os=4.0 img=1.0 sys=4.0
                  "cygreadline7.dll" v0.0 ts=2011/1/26 4:25
   84k 2010/07/02 C:\Programme\cygwin\bin\cygsasl2-2.dll - os=4.0 img=1.0 sys=4.0
                  "cygsasl2-2.dll" v0.0 ts=2010/7/2 5:19
    8k 2011/05/05 C:\Programme\cygwin\bin\cygsigsegv-2.dll - os=4.0 img=1.0 sys=4.0
                  "cygsigsegv-2.dll" v0.0 ts=2011/5/5 9:33
 1613k 2010/12/01 C:\Programme\cygwin\bin\cygsqlite3-0.dll - os=4.0 img=1.0 sys=4.0
                  "cygsqlite3-0.dll" v0.0 ts=2010/12/1 13:20
  263k 2011/03/16 C:\Programme\cygwin\bin\cygssl-0.9.8.dll - os=4.0 img=1.0 sys=4.0
                  "cygssl-0.9.8.dll" v0.0 ts=2011/3/16 21:54
    8k 2011/03/22 C:\Programme\cygwin\bin\cygssp-0.dll - os=4.0 img=1.0 sys=4.0
                  "cygssp-0.dll" v0.0 ts=2011/3/22 5:12
  771k 2011/03/22 C:\Programme\cygwin\bin\cygstdc++-6.dll - os=4.0 img=1.0 sys=4.0
                  "cygstdc++-6.dll" v0.0 ts=2011/3/22 5:53
   48k 2010/01/02 C:\Programme\cygwin\bin\cygtic-10.dll - os=4.0 img=1.0 sys=4.0
                  "cygtic-10.dll" v0.0 ts=2010/1/2 15:45
   48k 2009/11/20 C:\Programme\cygwin\bin\cygtic-9.dll - os=4.0 img=1.0 sys=4.0
                  "cygtic-9.dll" v0.0 ts=2009/11/20 20:10
   48k 2010/01/02 C:\Programme\cygwin\bin\cygticw-10.dll - os=4.0 img=1.0 sys=4.0
                  "cygticw-10.dll" v0.0 ts=2010/1/2 18:28
   16k 2010/06/24 C:\Programme\cygwin\bin\cyguuid-1.dll - os=4.0 img=1.0 sys=4.0
                  "cyguuid-1.dll" v0.0 ts=2010/6/24 21:19
   76k 2010/08/01 C:\Programme\cygwin\bin\cygz.dll - os=4.0 img=1.0 sys=4.0
                  "cygz.dll" v0.0 ts=2010/8/1 23:04
 2604k 2011/03/29 C:\Programme\cygwin\bin\cygwin1.dll - os=4.0 img=1.0 sys=4.0
                  "cygwin1.dll" v0.0 ts=2011/3/29 10:10
    Cygwin DLL version info:
        DLL version: 1.7.9
        DLL epoch: 19
        DLL old termios: 5
        DLL malloc env: 28
        Cygwin conv: 181
        API major: 0
        API minor: 237
        Shared data: 5
        DLL identifier: cygwin1
        Mount registry: 3
        Cygwin registry name: Cygwin
        Program options name: Program Options
        Installations name: Installations
        Cygdrive default prefix: 
        Build date: 
        Shared id: cygwin1S5


Potential app conflicts:

ZoneAlarm Personal Firewall
Detected: HKLM Registry Key, Named file.


Can't find the cygrunsrv utility, skipping services check.


Cygwin Package Information
Last downloaded files to: G:\Cygwin
Last downloaded files from: 

Package              Version              Status
_update-info-dir     00972-1              OK
alternatives         1.3.30c-10           OK
autoconf             10-1                 OK
autoconf2.1          2.13-10              OK
autoconf2.5          2.68-1               OK
automake             4-10                 OK
automake1.10         1.10.3-1             OK
automake1.11         1.11.1-1             OK
automake1.4          1.4p6-10             OK
automake1.5          1.5-10               OK
automake1.6          1.6.3-11             OK
automake1.7          1.7.9-10             OK
automake1.8          1.8.5-10             OK
automake1.9          1.9.6-10             OK
base-cygwin          3.0-1                OK
base-files           4.0-6                OK
bash                 4.1.10-4             OK
binutils             2.21.53-1            OK
bison                2.4.2-1              OK
bzip2                1.0.6-2              OK
coreutils            8.10-1               OK
cppunit              1.12.1-1             OK
crypt                1.1-1                OK
cygutils             1.4.6-1              OK
cygwin               1.7.9-1              OK
cygwin-doc           1.7-1                OK
dash                 0.5.6.1-2            OK
diffutils            2.9-1                OK
dos2unix             5.3-1                OK
editrights           1.01-2               OK
file                 5.05-1               OK
findutils            4.5.9-2              OK
flex                 2.5.35-1             OK
gawk                 4.0.0-1              OK
gcc4                 4.5.0-1              OK
gcc4-core            4.3.4-4              OK
gcc4-g++             4.3.4-4              OK
gdb                  6.8-2                OK
gettext              0.17-11              OK
grep                 2.6.3-1              OK
groff                1.20.1-2             OK
gzip                 1.4-1                OK
ipc-utils            1.0-1                OK
less                 444-1                OK
libapr1              1.4.4-1              OK
libapr1-devel        1.4.4-1              OK
libaprutil1          1.3.10-1             OK
libaprutil1-devel    1.3.10-1             OK
libattr1             2.4.43-1             OK
libboost-devel       1.43.0-1             OK
libboost1.43         1.43.0-1             OK
libboost_python1.43  1.43.0-1             OK
libbz2-devel         1.0.6-2              OK
libbz2_1             1.0.6-2              OK
libcharset1          1.13.1-2             OK
libcloog0            0.15.7-1             OK
libdb4.5             4.5.20.2-2           OK
libdb4.5-devel       4.5.20.2-2           OK
libexpat1            2.0.1-1              OK
libexpat1-devel      2.0.1-1              OK
libffi4              4.3.4-4              OK
libgcc1              4.3.4-4              OK
libgdbm-devel        1.8.3-20             OK
libgdbm4             1.8.3-20             OK
libgmp3              4.3.2-1              OK
libgmpxx4            4.3.2-1              OK
libgomp1             4.3.4-4              OK
libiconv             1.13.1-2             OK
libiconv2            1.13.1-2             OK
libicu-devel         4.5.1-1              OK
libicu38             3.8-7                OK
libintl8             0.17-11              OK
libltdl7             2.4-1                OK
liblzma5             5.0.2_20110517-1     OK
libmpc1              0.8-1                OK
libmpfr1             2.4.1-4              OK
libncurses-devel     5.7-18               OK
libncurses10         5.7-18               OK
libncurses8          5.5-10               OK
libncurses9          5.7-16               OK
libncursesw10        5.7-18               OK
libopenldap2_3_0     2.3.43-1             OK
libopenssl098        0.9.8r-2             OK
libpcre0             8.02-1               OK
libpopt0             1.6.4-4              OK
libppl               0.10.2-1             OK
libpq-devel          8.2.11-1             OK
libpq5               8.2.11-1             OK
libreadline7         6.1.2-2              OK
libsasl2             2.1.23-1             OK
libsasl2-devel       2.1.23-1             OK
libsigsegv2          2.10-1               OK
libsqlite3_0         3.7.3-1              OK
libssp0              4.3.4-4              OK
libstdc++6           4.3.4-4              OK
libstdc++6-devel     4.3.4-4              OK
libtool              2.4-1                OK
libuuid-devel        2.17.2-1             OK
libuuid1             2.17.2-1             OK
libxerces-c-devel    2.8.0-5              OK
login                1.10-10              OK
m4                   1.4.16-1             OK
make                 3.81-2               OK
man                  1.6f-1               OK
minires              1.02-1               OK
mksh                 40-2                 OK
openldap-devel       2.3.43-1             OK
openssl              0.9.8r-2             OK
openssl-devel        0.9.8r-2             OK
perl                 5.10.1-5             OK
python               2.6.5-2              OK
rebase               3.0.1-1              OK
run                  1.1.13-1             OK
rxvt                 20050409-20          OK
sed                  4.2.1-1              OK
tar                  1.25-1               OK
tcltk                20080420-1           OK
terminfo             5.7_20091114-14      OK
terminfo0            5.5_20061104-12      OK
texinfo              4.13-3               OK
tzcode               2010j-1              OK
vim                  7.3.003-1            OK
w32api               3.17-2               OK
which                2.20-2               OK
xz                   5.0.2_20110517-1     OK
zlib                 1.2.5-1              OK
zlib-devel           1.2.5-1              OK
zlib0                1.2.5-1              OK
Use -h to see help about each section

[-- Attachment #4: Type: text/plain, Size: 218 bytes --]

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 1.7.9: static const std::string initialization lost in child process when using fork, dlopen
  2011-08-21 11:48 1.7.9: static const std::string initialization lost in child process when using fork, dlopen whans
@ 2011-08-21 16:50 ` Christopher Faylor
  2011-08-21 17:10   ` Cliff Hones
  2011-08-21 17:05 ` Christopher Faylor
  1 sibling, 1 reply; 13+ messages in thread
From: Christopher Faylor @ 2011-08-21 16:50 UTC (permalink / raw)
  To: cygwin

On Sun, Aug 21, 2011 at 01:48:21PM +0200, whans@web.de wrote:
>Hello,
>??
>it seems that a child process does not see the initialization of a
>static const std::string variable if it is defined in a dll. Instead this corrupt variable
>lead to a STATUS_ACCESS_VIOLATION.
>??
>The following 4 example files demonstrate this behaviour:

Am I the only person who sees lots of strange characters in the examples
below where, presumably there is supposed to be whitespace?

cgf

>1) dllif.h: ?? ?? ??(define the dll's interface)
>#include <string>
>class cTestIf {
>public:
>?? virtual std::string get() = 0;
>};
>??
>??

...

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 1.7.9: static const std::string initialization lost in child process when using fork, dlopen
  2011-08-21 11:48 1.7.9: static const std::string initialization lost in child process when using fork, dlopen whans
  2011-08-21 16:50 ` Christopher Faylor
@ 2011-08-21 17:05 ` Christopher Faylor
  1 sibling, 0 replies; 13+ messages in thread
From: Christopher Faylor @ 2011-08-21 17:05 UTC (permalink / raw)
  To: cygwin

On Sun, Aug 21, 2011 at 01:48:21PM +0200, whans@web.de wrote:
>./test.exe prints only 'parent:Test' - parent works as expected - and gives a
>test.exe.stackdump - after 30 seconds.
>  
>  
>an example gdb session looks like:
>attach <child pid>
>b load
>c                (needs up to 30 seconds for return)
>n
>n
>n
>s                (step into dll's cTest::get method)
>p t             (print cTest::t, _M_p seems to be corrupt)
>$1 = {static npos = <optimized out>,
>   _M_dataplus = {<std::allocator<char>> = {<__gnu_cxx::new_allocator<char>> = {<
>No data fields>}, <No data fields>}, _M_p = 0x0}}
>n
>Program received signal SIGSEGV, Segmentation fault.
>0x6c4b95be in cygstdc++-6!_ZNSsC1ERKSs () from /usr/bin/cygstdc++-6.dll
>  
>  Any idea to fix or circumvent this error 

I don't get a coredump.  What I do get, after a 30 second wait, is:

child:Test

Maybe a snapshot will work better for you:  http://cygwin.com/snapshots/

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 1.7.9: static const std::string initialization lost in child process when using fork, dlopen
  2011-08-21 16:50 ` Christopher Faylor
@ 2011-08-21 17:10   ` Cliff Hones
  2011-08-21 18:39     ` Christopher Faylor
  0 siblings, 1 reply; 13+ messages in thread
From: Cliff Hones @ 2011-08-21 17:10 UTC (permalink / raw)
  To: cygwin

On 21/08/2011 17:50, Christopher Faylor wrote:
> On Sun, Aug 21, 2011 at 01:48:21PM +0200, whans@web.de wrote:
>> Hello,
>> ??
>> it seems that a child process does not see the initialization of a
>> static const std::string variable if it is defined in a dll. Instead this corrupt variable
>> lead to a STATUS_ACCESS_VIOLATION.
>> ??
>> The following 4 example files demonstrate this behaviour:
> 
> Am I the only person who sees lots of strange characters in the examples
> below where, presumably there is supposed to be whitespace?
> 
> cgf
> 
>> 1) dllif.h: ?? ?? ??(define the dll's interface)
>> #include <string>
>> class cTestIf {
>> public:
>> ?? virtual std::string get() = 0;
>> };
>> ??
>> ??
> 
> ...

Well, I'm afraid my mind-reading skills aren't good enough to answer that,
but my mail client doesn't show them (TB under Windows).

However, it didn't take long to find out that they are UTF-8 C2 A0
sequences, which is the code for a non-breaking white space.

The mime header does have "Content-Type: text/plain; charset="UTF-8"", so
it looks like your email client may be to blame.

-- Cliff


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 1.7.9: static const std::string initialization lost in child process when using fork, dlopen
  2011-08-21 17:10   ` Cliff Hones
@ 2011-08-21 18:39     ` Christopher Faylor
  2011-08-21 21:15       ` Thomas D. Dean
  0 siblings, 1 reply; 13+ messages in thread
From: Christopher Faylor @ 2011-08-21 18:39 UTC (permalink / raw)
  To: cygwin

On Sun, Aug 21, 2011 at 06:10:12PM +0100, Cliff Hones wrote:
>On 21/08/2011 17:50, Christopher Faylor wrote:
>> On Sun, Aug 21, 2011 at 01:48:21PM +0200, whans@web.de wrote:
>>> Hello,
>>> ??
>>> it seems that a child process does not see the initialization of a
>>> static const std::string variable if it is defined in a dll. Instead this corrupt variable
>>> lead to a STATUS_ACCESS_VIOLATION.
>>> ??
>>> The following 4 example files demonstrate this behaviour:
>> 
>> Am I the only person who sees lots of strange characters in the examples
>> below where, presumably there is supposed to be whitespace?
>> 
>>> 1) dllif.h: ?? ?? ??(define the dll's interface)
>>> #include <string>
>>> class cTestIf {
>>> public:
>>> ?? virtual std::string get() = 0;
>>> };
>>> ??
>>> ??
>> 
>> ...
>
>Well, I'm afraid my mind-reading skills aren't good enough to answer
>that,

Sorry for the confusion.  I wasn't expecting people to psychically
determine if anyone else had problems.

While I appreciate the inclusion of a simple test case, it's always best
if the simple test case actually compiles.  Since C++ doesn't accept the
strange characters as whitespace, the test case did not compile.  I did,
obviously, work around the problem but its always best to put in as few
barriers as possible if you want help.  Inclusion of illegal characters
in a source program program is a barrier.

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 1.7.9: static const std::string initialization lost in child process when using fork, dlopen
  2011-08-21 18:39     ` Christopher Faylor
@ 2011-08-21 21:15       ` Thomas D. Dean
  2011-08-21 22:19         ` Christopher Faylor
  0 siblings, 1 reply; 13+ messages in thread
From: Thomas D. Dean @ 2011-08-21 21:15 UTC (permalink / raw)
  To: cygwin

On Sun, 2011-08-21 at 14:38 -0400, Christopher Faylor wrote:

I get the stack dump - I retyped the examples to be sure no strange
chars.

And, I see no strange characters in the emails - evolution Ubuntu 10.04

tomdean



--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 1.7.9: static const std::string initialization lost in child process when using fork, dlopen
  2011-08-21 21:15       ` Thomas D. Dean
@ 2011-08-21 22:19         ` Christopher Faylor
  2011-08-21 23:15           ` Thomas D. Dean
  2011-08-21 23:56           ` Thomas D. Dean
  0 siblings, 2 replies; 13+ messages in thread
From: Christopher Faylor @ 2011-08-21 22:19 UTC (permalink / raw)
  To: cygwin

On Sun, Aug 21, 2011 at 02:15:16PM -0700, Thomas D. Dean wrote:
>On Sun, 2011-08-21 at 14:38 -0400, Christopher Faylor wrote:
>
>I get the stack dump - I retyped the examples to be sure no strange
>chars.

Did you try the snapshot as I suggested?

>And, I see no strange characters in the emails - evolution Ubuntu 10.04

Whether you see them or not, they are there.  Maybe your browser will show
them:

http://cygwin.com/ml/cygwin/2011-08/msg00404.html

Regardless, I've replaced the characters with spaces, compiled the
program, and don't see the problem that you're reporting.

If you don't want to try a snapshot for some reason then you could also
try setting the base address of the DLL by using the --auto-image-base
option when linking the DLL.

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 1.7.9: static const std::string initialization lost in child process when using fork, dlopen
  2011-08-21 22:19         ` Christopher Faylor
@ 2011-08-21 23:15           ` Thomas D. Dean
  2011-08-21 23:56           ` Thomas D. Dean
  1 sibling, 0 replies; 13+ messages in thread
From: Thomas D. Dean @ 2011-08-21 23:15 UTC (permalink / raw)
  To: cygwin

On Sun, 2011-08-21 at 18:19 -0400, Christopher Faylor wrote:
> On Sun, Aug 21, 2011 at 02:15:16PM -0700, Thomas D. Dean wrote:
> >On Sun, 2011-08-21 at 14:38 -0400, Christopher Faylor wrote:
> >
> >I get the stack dump - I retyped the examples to be sure no strange
> >chars.
> 
> Did you try the snapshot as I suggested?

I hesitate to alter the system - I had a hard time getting things to
work and produce 64 bit executables.

> 
> >And, I see no strange characters in the emails - evolution Ubuntu 10.04
> 
> Whether you see them or not, they are there.  Maybe your browser will show
> them:
> 

I typed the examples into emacs on windows 7.  So, there are no strange
characters in the example.




--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 1.7.9: static const std::string initialization lost in child process when using fork, dlopen
  2011-08-21 22:19         ` Christopher Faylor
  2011-08-21 23:15           ` Thomas D. Dean
@ 2011-08-21 23:56           ` Thomas D. Dean
  2011-08-22  1:44             ` Christopher Faylor
  1 sibling, 1 reply; 13+ messages in thread
From: Thomas D. Dean @ 2011-08-21 23:56 UTC (permalink / raw)
  To: cygwin

On Sun, 2011-08-21 at 18:19 -0400, Christopher Faylor wrote:
> 're reporting.
> 
> If you don't want to try a snapshot for some reason then you could also
> try setting the base address of the DLL by using the --auto-image-base
> option when linking the DLL.

I used 

g++ -Wall -I. -shared -g -c dll.cpp -o dll.o
g++ -Wall -shared -o libdll.dll dll.o
g++ -Wall -I. -g -c dlltest.cpp -o dlltest.o
g++ -Wall -o dlltest dlltest.o -L. -ldll -Wl,--enable-auto-image-base

I still have the stackdump problem.

I used hd to look at the files I created with emacs and there are no
strange characters.

tomdean


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 1.7.9: static const std::string initialization lost in child process when using fork, dlopen
  2011-08-21 23:56           ` Thomas D. Dean
@ 2011-08-22  1:44             ` Christopher Faylor
  2011-08-22  3:57               ` Thomas D. Dean
  0 siblings, 1 reply; 13+ messages in thread
From: Christopher Faylor @ 2011-08-22  1:44 UTC (permalink / raw)
  To: cygwin

On Sun, Aug 21, 2011 at 04:56:31PM -0700, Thomas D. Dean wrote:
>On Sun, 2011-08-21 at 18:19 -0400, Christopher Faylor wrote:
>> 're reporting.
>> 
>> If you don't want to try a snapshot for some reason then you could also
>> try setting the base address of the DLL by using the --auto-image-base
>> option when linking the DLL.
>
>I used 
>
>g++ -Wall -I. -shared -g -c dll.cpp -o dll.o
>g++ -Wall -shared -o libdll.dll dll.o
>g++ -Wall -I. -g -c dlltest.cpp -o dlltest.o
>g++ -Wall -o dlltest dlltest.o -L. -ldll -Wl,--enable-auto-image-base
>
>I still have the stackdump problem.
>
>I used hd to look at the files I created with emacs and there are no
>strange characters.

I certainly understand that you didn't mean to include strange
characters.  The web archives show strange characters.  Lets move on.

Please read what I said above:  "when linking the DLL", not when
linking *with*.  So put the -Wl,--enable-auto-image-base on the
line which produces the dll.

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 1.7.9: static const std::string initialization lost in child process when using fork, dlopen
  2011-08-22  1:44             ` Christopher Faylor
@ 2011-08-22  3:57               ` Thomas D. Dean
  2011-08-22  5:11                 ` Christopher Faylor
  0 siblings, 1 reply; 13+ messages in thread
From: Thomas D. Dean @ 2011-08-22  3:57 UTC (permalink / raw)
  To: cygwin

On Sun, 2011-08-21 at 21:44 -0400, Christopher Faylor wrote:
> On Sun, Aug 21, 2011 at 04:56:31PM -0700, Thomas D. Dean wrote:
> >On Sun, 2011-08-21 at 18:19 -0400, Christopher Faylor wrote:
> >> 're reporting.
> >> 
> >> If you don't want to try a snapshot for some reason then you could also
> >> try setting the base address of the DLL by using the --auto-image-base
> >> option when linking the DLL.
> >
> >I used 
> >
> >g++ -Wall -I. -shared -g -c dll.cpp -o dll.o
> >g++ -Wall -shared -o libdll.dll dll.o
> >g++ -Wall -I. -g -c dlltest.cpp -o dlltest.o
> >g++ -Wall -o dlltest dlltest.o -L. -ldll -Wl,--enable-auto-image-base
> >
> >I still have the stackdump problem.
> >
> >I used hd to look at the files I created with emacs and there are no
> >strange characters.
> 
> I certainly understand that you didn't mean to include strange
> characters.  The web archives show strange characters.  Lets move on.

You are confusing me with the original poster.  I just attempted to
duplicate either of your results.

> 
> Please read what I said above:  "when linking the DLL", not when
> linking *with*.  So put the -Wl,--enable-auto-image-base on the
> line which produces the dll.

I still get the stackdump...

I will watch for a resolution...

tomdean


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 1.7.9: static const std::string initialization lost in child process when using fork, dlopen
  2011-08-22  3:57               ` Thomas D. Dean
@ 2011-08-22  5:11                 ` Christopher Faylor
  2011-08-22  5:52                   ` Thomas D. Dean
  0 siblings, 1 reply; 13+ messages in thread
From: Christopher Faylor @ 2011-08-22  5:11 UTC (permalink / raw)
  To: cygwin

On Sun, Aug 21, 2011 at 08:57:08PM -0700, Thomas D. Dean wrote:
>On Sun, 2011-08-21 at 21:44 -0400, Christopher Faylor wrote:
>You are confusing me with the original poster.  I just attempted to
>duplicate either of your results.

You're right.  I was confusing you with the original poster.  The
sentiment is the same, however.  Lets move on.

>> Please read what I said above:  "when linking the DLL", not when
>> linking *with*.  So put the -Wl,--enable-auto-image-base on the
>> line which produces the dll.
>
>I still get the stackdump...
>
>I will watch for a resolution...

I just tried the test case with 1.7.9.  I do sometimes (and sometimes
not) see a "child:Test" from the child but I also get a stackdump.  So
my initial suggestion to use a snapshot is probably the best solution.

cgf

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 13+ messages in thread

* Re: 1.7.9: static const std::string initialization lost in child process when using fork, dlopen
  2011-08-22  5:11                 ` Christopher Faylor
@ 2011-08-22  5:52                   ` Thomas D. Dean
  0 siblings, 0 replies; 13+ messages in thread
From: Thomas D. Dean @ 2011-08-22  5:52 UTC (permalink / raw)
  To: cygwin

Thanks,

I just built a DLL I am interested in - it works.

tomdean


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 13+ messages in thread

end of thread, other threads:[~2011-08-22  5:52 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-08-21 11:48 1.7.9: static const std::string initialization lost in child process when using fork, dlopen whans
2011-08-21 16:50 ` Christopher Faylor
2011-08-21 17:10   ` Cliff Hones
2011-08-21 18:39     ` Christopher Faylor
2011-08-21 21:15       ` Thomas D. Dean
2011-08-21 22:19         ` Christopher Faylor
2011-08-21 23:15           ` Thomas D. Dean
2011-08-21 23:56           ` Thomas D. Dean
2011-08-22  1:44             ` Christopher Faylor
2011-08-22  3:57               ` Thomas D. Dean
2011-08-22  5:11                 ` Christopher Faylor
2011-08-22  5:52                   ` Thomas D. Dean
2011-08-21 17:05 ` Christopher Faylor

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).