Sean P. Miller created LOGCXX-491:
-------------------------------------
Summary: SizeBasedRollingTest cases fail when defining
LOG4CXX_MULTI_PROCESS
Key: LOGCXX-491
URL: https://issues.apache.org/jira/browse/LOGCXX-491
Project: Log4cxx
Issue Type: Bug
Components: Tests
Affects Versions: 0.11.0
Environment: gcc version 4.4.7 20120313 (Red Hat 4.4.7-17) (GCC)
gcc version 5.4.0 20160609 (Ubuntu 5.4.0-6ubuntu1~16.04.4)
Reporter: Sean P. Miller
Priority: Minor
I've encountered this with revisions 1755031 and 1802636 on both environments
listed. Abbreviated debugging session:
{noformat}
ubuntu@ip-[...]:~/dev/log4cxx$ gdb src/test/cpp/.libs/lt-testsuite
[...]
Reading symbols from src/test/cpp/.libs/lt-testsuite...done.
(gdb) run -v sizebasedrollingtest
Starting program: /home/ubuntu/dev/log4cxx/src/test/cpp/.libs/lt-testsuite -v
sizebasedrollingtest
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib/x86_64-linux-gnu/libthread_db.so.1".
LC_CTYPE: en_US.UTF-8
sizebasedrollingtest: -2017-07-21 19:28:52,889 DEBUG
org.apache.log4j.rolling.SizeBasedRollingTest -Hello---0
2017-07-21 19:28:52,889 DEBUG org.apache.log4j.rolling.SizeBasedRollingTest
-Hello---1
[...]
2017-07-21 19:28:52,898 DEBUG org.apache.log4j.rolling.SizeBasedRollingTest
-Hello---9
2017-07-21 19:28:52,898 DEBUG org.apache.log4j.rolling.SizeBasedRollingTest
-Hello--10
log4cxx: Exception during rollover
Program received signal SIGSEGV, Segmentation fault.
log4cxx::rolling::RollingFileAppenderSkeleton::subAppend (this=0x757d40,
event=..., p=...) at rollingfileappender.cpp:378
378 apr_file_t* _fd =
getWriter()->getOutPutStreamPtr()->getFileOutPutStreamPtr().getFilePtr();
(gdb) bt
#0 log4cxx::rolling::RollingFileAppenderSkeleton::subAppend (this=0x757d40,
event=..., p=...) at rollingfileappender.cpp:378
#1 0x00007ffff766adc2 in log4cxx::AppenderSkeleton::doAppend (this=0x757d40,
event=..., pool1=...) at appenderskeleton.cpp:142
#2 0x00007ffff7668abf in
log4cxx::helpers::AppenderAttachableImpl::appendLoopOnAppenders (this=0x7574e0,
event=..., p=...) at appenderattachableimpl.cpp:69
#3 0x00007ffff76b07e8 in log4cxx::Logger::callAppenders
(this=this@entry=0x757400, event=..., p=...) at logger.cpp:96
#4 0x00007ffff76b0a3e in log4cxx::Logger::forcedLog (this=0x757400,
level1=..., message="Hello--10", location=...) at logger.cpp:127
#5 0x00000000004845e3 in SizeBasedRollingTest::common (logger1=...,
this=0x7fffffffe150) at rolling/sizebasedrollingtest.cpp:88
#6 SizeBasedRollingTest::test6 (this=0x7fffffffe150) at
rolling/sizebasedrollingtest.cpp:339
#7 0x0000000000489366 in LogUnit::runTest<SizeBasedRollingTest>
(tc=0x7fffffffe3a0, func=(void (SizeBasedRollingTest::*)(SizeBasedRollingTest *
const)) 0x483e30 <SizeBasedRollingTest::test6()>) at rolling/../logunit.h:112
#8 0x00000000004898c0 in
SizeBasedRollingTest::RegisterSuite::test6Registration::run (tc=<optimized
out>) at rolling/sizebasedrollingtest.cpp:57
#9 0x00000000004b4005 in abts_run_test (ts=ts@entry=0x74ee20, f=0x4898b0
<SizeBasedRollingTest::RegisterSuite::test6Registration::run(abts_case*,
void*)>, value=value@entry=0x0) at abts.cpp:174
#10 0x00000000004c7cf1 in LogUnit::TestSuite::run (this=0x734f20
<SizeBasedRollingTest::getSuite()::suite>, suite=suite@entry=0x74ee20) at
logunit.cpp:232
#11 0x00000000004c7f28 in abts_run_suites (suite=0x74ee20, suite@entry=0x0) at
logunit.cpp:59
#12 0x000000000041bd7d in main (argc=3, argv=0x7fffffffe558) at abts.cpp:433
(gdb)
{noformat}
Diff applied for multi-process support:
{noformat}
diff -urN log4cxx-0.11.0.orig/configure.ac log4cxx-0.11.0/configure.ac
--- log4cxx-0.11.0.orig/configure.ac 2016-08-26 16:32:29.205000000 +0000
+++ log4cxx-0.11.0/configure.ac 2016-08-26 16:32:55.919000000 +0000
@@ -55,6 +55,8 @@
AC_PROG_CXXCPP
AC_LANG(C++)
+AC_DEFINE(LOG4CXX_MULTI_PROCESS)
+
# CXX fine tuning
case "$host" in
*-dec-osf*)
{noformat}
Tests run via {{make check}}. I believe this is v0.11.0 code (?).
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)