Author: mvidner Date: Tue Feb 2 10:41:53 2010 New Revision: 60651 URL: http://svn.opensuse.org/viewcvs/yast?rev=60651&view=rev Log: Fixed a crash in LogTail by adding a mutex to the shared variable (bnc#565918) And re-enabled the liby2util-r testsuite for that. Merged 60640-60650 from branches/SuSE-Code-11-SP1-Branch Added: trunk/core/liby2util-r/testsuite/test_thread_log.cc - copied unchanged from r60650, branches/SuSE-Code-11-SP1-Branch/core/liby2util-r/testsuite/test_thread_log.cc Modified: trunk/core/ (props changed) trunk/core/VERSION trunk/core/liby2util-r/src/y2log.cc trunk/core/liby2util-r/testsuite/ (props changed) trunk/core/liby2util-r/testsuite/Makefile.am trunk/core/liby2util-r/testsuite/lib/liby2util_init.exp trunk/core/liby2util-r/testsuite/liby2util.test/liby2util.exp trunk/core/liby2util-r/testsuite/test_chroot.cc trunk/core/package/yast2-core.changes Modified: trunk/core/VERSION URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/VERSION?rev=60651&r1=60650&r2=60651&view=diff ============================================================================== --- trunk/core/VERSION (original) +++ trunk/core/VERSION Tue Feb 2 10:41:53 2010 @@ -1 +1 @@ -2.19.0 +2.19.1 Modified: trunk/core/liby2util-r/src/y2log.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/liby2util-r/src/y2log.cc?rev=60651&r1=60650&r2=60651&view=diff ============================================================================== --- trunk/core/liby2util-r/src/y2log.cc (original) +++ trunk/core/liby2util-r/src/y2log.cc Tue Feb 2 10:41:53 2010 @@ -322,7 +322,11 @@ else tolog = y2_logfmt_prefix (level) + common; // store the message for worse times + // (lock the variable that is shared among threads, bnc#565918) + static pthread_mutex_t blanik_mutex = PTHREAD_MUTEX_INITIALIZER; + pthread_mutex_lock (&blanik_mutex); blanik.push_back (tolog); + pthread_mutex_unlock (&blanik_mutex); } } Modified: trunk/core/liby2util-r/testsuite/Makefile.am URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/liby2util-r/testsuite/Makefile.am?rev=60651&r1=60650&r2=60651&view=diff ============================================================================== --- trunk/core/liby2util-r/testsuite/Makefile.am (original) +++ trunk/core/liby2util-r/testsuite/Makefile.am Tue Feb 2 10:41:53 2010 @@ -15,14 +15,18 @@ -Xlinker --no-whole-archive noinst_PROGRAMS = \ - test_Y2SLog.prg \ - test_strutil.prg \ + test_Y2SLog \ + test_thread_log.prg \ + test_strutil \ test_mkdir.prg \ test_chroot.prg -test_Y2SLog_prg_SOURCES = test_Y2SLog.cc +test_Y2SLog_SOURCES = test_Y2SLog.cc -test_strutil_prg_SOURCES = test_strutil.cc +test_thread_log_prg_SOURCES = test_thread_log.cc +test_thread_log_prg_LDFLAGS = $(AM_LDFLAGS) -pthread + +test_strutil_SOURCES = test_strutil.cc test_mkdir_prg_SOURCES = test_mkdir.cc Modified: trunk/core/liby2util-r/testsuite/lib/liby2util_init.exp URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/liby2util-r/testsuite/lib/liby2util_init.exp?rev=60651&r1=60650&r2=60651&view=diff ============================================================================== --- trunk/core/liby2util-r/testsuite/lib/liby2util_init.exp (original) +++ trunk/core/liby2util-r/testsuite/lib/liby2util_init.exp Tue Feb 2 10:41:53 2010 @@ -40,13 +40,6 @@ return -1 } - # check return code from runprg - - if {$result != ""} { - warning "Run of $base_name results in '$result'" - return -1 - } - # ok, all is fine pass $base_name Modified: trunk/core/liby2util-r/testsuite/liby2util.test/liby2util.exp URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/liby2util-r/testsuite/liby2util.test/liby2util.exp?rev=60651&r1=60650&r2=60651&view=diff ============================================================================== --- trunk/core/liby2util-r/testsuite/liby2util.test/liby2util.exp (original) +++ trunk/core/liby2util-r/testsuite/liby2util.test/liby2util.exp Tue Feb 2 10:41:53 2010 @@ -10,5 +10,5 @@ # foreach file, call prg-run (from testsuite/lib) # Disable tests because *.prg programs aren't correctly set up as tests. -# foreach file $filenames { prg-run $file } -untested "*.prg aren't tested. Fix the testsuite." +#untested "*.prg aren't tested. Fix the testsuite." +foreach file $filenames { prg-run $file } Modified: trunk/core/liby2util-r/testsuite/test_chroot.cc URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/liby2util-r/testsuite/test_chroot.cc?rev=60651&r1=60650&r2=60651&view=diff ============================================================================== --- trunk/core/liby2util-r/testsuite/test_chroot.cc (original) +++ trunk/core/liby2util-r/testsuite/test_chroot.cc Tue Feb 2 10:41:53 2010 @@ -6,15 +6,15 @@ int main(int argc, char* argv[]) { - if(argc<2) + const char * chroot = "/"; + if(argc >= 2) { - cout << "must specify directory to chroot to" << endl; - return 1; + chroot = argv[1]; } const char* aa[] = { "ls" , "-al", NULL }; // string aa = "ls"; ExternalProgram* prog = new ExternalProgram(aa, ExternalProgram::Stderr_To_Stdout, - false, -1, true, argv[1]); + false, -1, true, chroot); if(!prog) return 1; string line; @@ -25,5 +25,5 @@ cout << line; } cout << "program exited with " << prog->close() << endl; - return 0; + return prog->close(); } Modified: trunk/core/package/yast2-core.changes URL: http://svn.opensuse.org/viewcvs/yast/trunk/core/package/yast2-core.changes?rev=60651&r1=60650&r2=60651&view=diff ============================================================================== --- trunk/core/package/yast2-core.changes (original) +++ trunk/core/package/yast2-core.changes Tue Feb 2 10:41:53 2010 @@ -1,4 +1,12 @@ ------------------------------------------------------------------- +Mon Feb 1 16:01:46 CET 2010 - mvidner@suse.cz + +- Fixed a crash in LogTail by adding a mutex to the shared variable + (bnc#565918). +- Re-enabled parts of liby2util-r testsuite. +- 2.19.1 + +------------------------------------------------------------------- Fri Dec 18 12:43:39 CET 2009 - aschnell@suse.de - allow Y2DIR to be a list of paths separated by ":" -- To unsubscribe, e-mail: yast-commit+unsubscribe@opensuse.org For additional commands, e-mail: yast-commit+help@opensuse.org