log4cplus

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
paolom
Posts: 169
Joined: Tue, 2008-09-16, 15:02

log4cplus

#1 Post by paolom »

I've compiled the latest snapshot ( dcmtk-3.6.0) under WinXP , Ubuntu 10.04 and Mac Os X 10.6.4.

Under Mac Os X 10.6.4 when I close my application that uses dcmtk-3.6.0, it often crash with this reports:

Code: Select all

Code Type:       X86 (Native)
OS Version:      Mac OS X 10.6.4 (10F569)
Report Version:  6

Interval Since Last Report:          769446 sec
Crashes Since Last Report:           360
Per-App Interval Since Last Report:  93843 sec
Per-App Crashes Since Last Report:   349
Anonymous UUID:                      95A201D5-5636-4C3F-985A-5521BC4E7786

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: 0x000000000000000d, 0x0000000000000000
Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
1   0x0060a9d2 log4cplus::NDC::remove() + 32
and sometimes with this:

Code: Select all

Code Type:       X86 (Native)
OS Version:      Mac OS X 10.6.4 (10F569)
Report Version:  6

Interval Since Last Report:          769446 sec
Crashes Since Last Report:           360
Per-App Interval Since Last Report:  93843 sec
Per-App Crashes Since Last Report:   349
Anonymous UUID:                      95A201D5-5636-4C3F-985A-5521BC4E7786

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: 0x000000000000000d, 0x0000000000000000
Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
1   0x0060a9b0 log4cplus::NDC::getPtr() + 22
2   0x0060a9d2 log4cplus::NDC::remove() + 32
My application works correctly with dcmtk-3.5.4
I've not changed anything.
Under WinXp an Ubuntu the application quit correctly.

Any suggestions ?

Thanks

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#2 Post by Jörg Riesmeier »

Thank you for the report. Could you please try to compile with --disable-threads (if possible).

paolom
Posts: 169
Joined: Tue, 2008-09-16, 15:02

#3 Post by paolom »

Tested under Mac Os X 10.6.4 with --disable-threads on the configure

The application still crash. This is the report:

Code: Select all

Code Type:       X86 (Native)

OS Version:      Mac OS X 10.6.4 (10F569)
Report Version:  6

Interval Since Last Report:          772736 sec
Crashes Since Last Report:           361
Per-App Interval Since Last Report:  94228 sec
Per-App Crashes Since Last Report:   350
Anonymous UUID:                      95A201D5-5636-4C3F-985A-5521BC4E7786

Exception Type:  EXC_BAD_ACCESS (SIGSEGV)
Exception Codes: 0x000000000000000d, 0x0000000000000000
Crashed Thread:  0  Dispatch queue: com.apple.main-thread

Thread 0 Crashed:  Dispatch queue: com.apple.main-thread
0   libSystem.B.dylib           0x91012918 pthread_getspecific + 4
1           	                 0x0060a9d0 log4cplus::NDC::getPtr() + 22
2            	                0x0060a9f2 log4cplus::NDC::remove() + 32

Uli Schlachter
DCMTK Developer
Posts: 120
Joined: Thu, 2009-11-26, 08:15

#4 Post by Uli Schlachter »

Weird, looks like --disable-threads doesn't work.

Could you remove line 90 in oflog/libsrc/oflog.cc, relink your application and test what happens?

Line 90 is "log4cplus::getNDC().remove();".

Thanks,
Uli

paolom
Posts: 169
Joined: Tue, 2008-09-16, 15:02

#5 Post by paolom »

I've re-tested all with the --disable-threads.

It seems to work correctly under all the platforms.

I'm sorry, but In the previous post it possible I've missed something on the compilation.

However, I'm going to continue to test it.

Uli Schlachter
DCMTK Developer
Posts: 120
Joined: Thu, 2009-11-26, 08:15

#6 Post by Uli Schlachter »

Ah, good to know.

Could you still test what I mentioned in my last post with threads enabled? That should hopefully fix the crash in this case, too.

paolom
Posts: 169
Joined: Tue, 2008-09-16, 15:02

#7 Post by paolom »

Ok. I'll try now on all the platforms.

paolom
Posts: 169
Joined: Tue, 2008-09-16, 15:02

#8 Post by paolom »

I've used the default --enable-thread and commented the 90th line of the oflog.cc.

I've tested on all the platforms with some type of modality images.

It works correctly.

paolom
Posts: 169
Joined: Tue, 2008-09-16, 15:02

#9 Post by paolom »

Is there any way to disable all the logger without --disable-threads ?

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#10 Post by Jörg Riesmeier »

The option --disable-threads does not disable the logger but the thread support.

What exactly do you want to do?

paolom
Posts: 169
Joined: Tue, 2008-09-16, 15:02

#11 Post by paolom »

I want to disable the OFLogger.

I don't want to show any level log.

Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#12 Post by Jörg Riesmeier »

One way is to add the define LOG4CPLUS_DISABLE_FATAL and recompile the DCMTK. See documentation for details.

However, I think that disabling the complete logging is no good idea. What about redirecting the logger output to a file or using the --quiet option of the command line tools?

paolom
Posts: 169
Joined: Tue, 2008-09-16, 15:02

#13 Post by paolom »

I've recompiled with the LOG4CPLUS_DISABLE_FATAL macro.

I obtain my goal ( log off ) but the Mac Os X crash is the same:

Code: Select all

Code Type:       X86 (Native) 
OS Version:      Mac OS X 10.6.4 (10F569) 
Report Version:  6 

Interval Since Last Report:          769446 sec 
Crashes Since Last Report:           360 
Per-App Interval Since Last Report:  93843 sec 
Per-App Crashes Since Last Report:   349 
Anonymous UUID:                      95A201D5-5636-4C3F-985A-5521BC4E7786 

Exception Type:  EXC_BAD_ACCESS (SIGSEGV) 
Exception Codes: 0x000000000000000d, 0x0000000000000000 
Crashed Thread:  0  Dispatch queue: com.apple.main-thread 

Thread 0 Crashed:  Dispatch queue: com.apple.main-thread 
1   0x0060a9d2 log4cplus::NDC::remove() + 32 


Jörg Riesmeier
ICSMED DICOM Services
ICSMED DICOM Services
Posts: 2217
Joined: Fri, 2004-10-29, 21:38
Location: Oldenburg, Germany

#14 Post by Jörg Riesmeier »

I thought that it worked for you after you've removed the code line in the destructor ... Also see the following commit.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest