This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

CreateFileMapping/MapViewOfFile and fork


As part of an application we're developing, we use
CreateFileMapping/MapViewOfFile to be able to share information among
processes.  I noticed today that if I try to reference the map
immediately after calling fork() but before calling exec, that my
application will crash.

I should be able to resolve this in my app but I was just curious if
this was unexpected behavior or not.

I've attached a test program parent_test.cpp and my cygcheck.out.

######################
sdaley@sdaley2 ~
$ gcc -Wall parent_test.cpp -o parent_test

sdaley@sdaley2 ~
$ ./parent_test.exe
Dumping map in parent
--> length = 11
--> name = test-string
Dumping map in child
    17 [main] parent_test 2460 _cygtls::handle_exceptions: Error while dumping
state (probably corrupted stack)

sdaley@sdaley2 ~
$
######################

Sean

Attachment: parent_test.cpp
Description: Binary data

Attachment: cygcheck.out
Description: Binary data

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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]