[Log4cplus-devel] [ log4cplus-Bugs-3467112 ] ptd_cleanup_func posix segfault
Logging Framework for C++
Brought to you by:
wilx
From: SourceForge.net <no...@so...> - 2012-09-04 09:50:10
|
Bugs item #3467112, was opened at 2011-12-29 11:58 Message generated for change (Settings changed) made by wilx You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=429073&aid=3467112&group_id=40830 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: None >Group: v1.1.x Status: Pending Resolution: Fixed Priority: 6 Private: No Submitted By: rjmyst3 (rjmyst3) Assigned to: Václav Zeman (wilx) Summary: ptd_cleanup_func posix segfault Initial Comment: changes posix implementation of ptd_cleanup_func's call to internal::get_ptd to pass 'false' to prevent a segfault also move ptd_cleanup_func to the internal namespace ---------------------------------------------------------------------- Comment By: Václav Zeman (wilx) Date: 2012-09-04 02:49 Message: I think that this is now fixed in 1.1.0 in Bazaar repo on trunk and 1.1.x branches. See also https://sourceforge.net/tracker/index.php?func=detail&aid=3563699&group_id=40830&atid=429073# ---------------------------------------------------------------------- Comment By: Václav Zeman (wilx) Date: 2012-04-29 02:09 Message: Please could you be more specific about the environment you are working in? What OS/CPU are you using? What compiler and compiler version are you using? What library kind have you chosen: static library or dynamically linked library? What is the configure script command line that you are using to produce log4cplus binaries? Please attach config.log, defines.hxx files. Adding a self contained test case would also help tremendously. ---------------------------------------------------------------------- Comment By: Václav Zeman (wilx) Date: 2012-04-19 08:50 Message: Well, I still do not understand the new version of ptd_cleanup_func(): //! Thread local storage clean up function for POSIX threads. static void ptd_cleanup_func (void * arg) { // ??? Asserting for NULL return value from get_ptd() does not make sense to me. // ??? The get_ptd(false) invocation should return the per thread data allocated for this thread. // ??? It could be null but need not to be, AFAICS. assert (0 == internal::get_ptd (false)); // ??? This looks ok. However given the assertion above, it would be no-op. // ??? Maybe the assertion above should be assert (0 == internal::get_ptd (false) || arg == internal::get_ptd (false)); // ??? What do you think? delete reinterpret_cast<internal::per_thread_data*>(arg); } The rest of the patch seems ok. ---------------------------------------------------------------------- Comment By: w0lanto (w0lanto) Date: 2012-01-11 14:02 Message: I've test case that's causing segfault. I have one thread in which I configure log4cplus via configuration file( doConfigure method ). In this thread later on I'm creating a other thread, and waiting for it to finish. After the other thread is finished segfault occurs. The patch fixes this segfault, thanks rjmyst3! ---------------------------------------------------------------------- Comment By: Václav Zeman (wilx) Date: 2011-12-29 14:51 Message: I see the patch but I am not sure that I understand the reasons for it. Do you have a test case that segfaulting? I understand why it should call get_ptd (false) in the ptd_cleanup_func() but I do not understand the reason for splitting the function and the second version of it. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=429073&aid=3467112&group_id=40830 |