Opened 14 years ago

Closed 11 years ago

#2470 closed Support Requests (duplicate)

Problem with threads started in a dynamically loaded bundle under Mac OS X

Reported by: Daniel Fenner <dfenner@…> Owned by: viboes
Milestone: To Be Determined Component: thread
Version: Boost 1.36.0 Severity: Problem
Keywords: mac bundle thread Cc: viboes

Description

The attached program (main.cpp) loads a bundle and calls the function exported herein. The code in the bundle (bundle.cpp) simply starts a thread, joins it and exits. Then the bundle is unloaded. After a few hundred of these cycles program crashes.

To compile and create the bundle one might use the following command lines:

g++ -x c++ -arch i386 -IPATH/TO/BOOST/HEADER  -c bundle.cpp -o bundle.o

mkdir -p bundle.plugin/Contents/MacOS

g++ -o bundle.plugin/Contents/MacOS/bundle -LPATH/TO/BOOST/LIB -lboost_thread-xgcc40-mt-1_37 -arch i386 -bundle bundle.o 

and for the loader:

g++ -x c++ -arch i386 -I/Developer/Headers/FlatCarbon/ -c main.cpp -o main.o

g++ -o main -framework CoreFoundation -arch i386 main.o

I reproduced this behavior with macosx 10.4 / 10.5 and boost 1.35/1.36/1.37/current trunk. My gcc version is 4.0.1.

Attachments (2)

main.cpp (577 bytes ) - added by Daniel Fenner <dfenner@…> 14 years ago.
bundle.cpp (220 bytes ) - added by Daniel Fenner <dfenner@…> 14 years ago.

Download all attachments as: .zip

Change History (7)

by Daniel Fenner <dfenner@…>, 14 years ago

Attachment: main.cpp added

by Daniel Fenner <dfenner@…>, 14 years ago

Attachment: bundle.cpp added

comment:1 by viboes, 11 years ago

Could we consider that this is a duplicate of #3926 thread_specific_ptr + dlopen library causes a SIGSEGV, or vice versa?

comment:2 by viboes, 11 years ago

Cc: viboes added
Milestone: Boost 1.38.0To Be Determined
Owner: changed from Anthony Williams to viboes
Status: newassigned

comment:3 by viboes, 11 years ago

Type: BugsFeature Requests

Moved to Support request until resolution clarified

comment:4 by viboes, 11 years ago

Type: Feature RequestsSupport Requests

comment:5 by viboes, 11 years ago

Resolution: duplicate
Status: assignedclosed

Duplicate. #3926 thread_specific_ptr + dlopen library causes a SIGSEGV, or vice versa?

Note: See TracTickets for help on using tickets.