Skip to content

Commit

Permalink
[tests] Remove NullLogger usage to prevent crash
Browse files Browse the repository at this point in the history
This prevents an occasionally occurring crash.

Program terminated with signal SIGSEGV, Segmentation fault.
0  0x0000000003e21700 in ?? ()

Thread 2 (Thread 0x2ab2e881b940 (LWP 28679)):
0  0x00002ab2f156a330 in std::string::_Rep::_M_destroy(std::allocator<char> const&) () from /usr/lib/x86_64-linux-gnu/libstdc++.so.6
1  0x0000000001079821 in CAdvancedSettings::~CAdvancedSettings() ()
2  0x0000000001079ae9 in CAdvancedSettings::~CAdvancedSettings() ()
3  0x00000000008b0f21 in xbmcutil::GlobalsSingleton<CAdvancedSettings>::Deleter<std::shared_ptr<CAdvancedSettings> >::~Deleter() ()
4  0x00002ab2f1a06259 in __run_exit_handlers (status=0, listp=0x2ab2f1d886c8 <__exit_funcs>, run_list_atexit=run_list_atexit@entry=true) at exit.c:82
5  0x00002ab2f1a062a5 in __GI_exit (status=<optimized out>) at exit.c:104
6  0x00002ab2f19ebecc in __libc_start_main (main=0x855a50 <main>, argc=2, argv=0x7ffef5ebbcf8, init=<optimized out>, fini=<optimized out>, rtld_fini=<optimized out>, stack_end=0x7ffef5ebbce8) at libc-start.c:321
7  0x0000000000855984 in _start ()

Thread 1 (Thread 0x2ab3006d4700 (LWP 28684)):
0  0x0000000003e21700 in ?? ()
1  0x0000000000e492a2 in XbmcCommons::ILogger::Log(int, char const*, ...) ()
2  0x0000000000c507c2 in CThread::staticThread(void*) ()
3  0x00002ab2e89cb182 in start_thread (arg=0x2ab3006d4700) at pthread_create.c:312
4  0x00002ab2f1ac447d in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:111
  • Loading branch information
fetzerch committed Feb 20, 2016
1 parent 65aa269 commit 9f6aa55
Showing 1 changed file with 0 additions and 12 deletions.
12 changes: 0 additions & 12 deletions xbmc/test/xbmc-test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,17 @@
#include <cstdio>
#include <cstdlib>

class NullLogger : public XbmcCommons::ILogger
{
public:
void log(int loglevel, const char* message) {}
};

int main(int argc, char **argv)
{
testing::InitGoogleTest(&argc, argv);
CXBMCTestUtils::Instance().ParseArgs(argc, argv);

// we need to configure CThread to use a dummy logger
NullLogger* nullLogger = new NullLogger();
CThread::SetLogger(nullLogger);

if (!testing::AddGlobalTestEnvironment(new TestBasicEnvironment()))
{
fprintf(stderr, "Unable to add basic test environment.\n");
exit(EXIT_FAILURE);
}
int ret = RUN_ALL_TESTS();

delete nullLogger;

return ret;
}

0 comments on commit 9f6aa55

Please sign in to comment.