SIGSEGV (Segmentation fault) on calling dcmGenerateUniqueIdentifier ()

All other questions regarding DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
amateurPro2
Posts: 3
Joined: Mon, 2005-01-31, 23:28

SIGSEGV (Segmentation fault) on calling dcmGenerateUniqueIdentifier ()

#1 Post by amateurPro2 »

Hi,

I am trying to create new series UID for DICOM images using dcmGenerateUniqueIdentifier ().

The relevant code snippet is as follows:
==================
FUNCTION: updateDICOMHdr ()
====================

strncpy(UIDRoot, oldSOPuid, count);

UIDRoot[count] = '\0';

// Now create a image series UID.
// This will be used for all written images

char* newuid = new char[TEMP_STR_LEN];

cout << " Before calling dcmGenerateUniqueIdentifier().." << endl;
cout << "UIDRoot:" << UIDRoot << endl;

dcmGenerateUniqueIdentifier(newuid, UIDRoot); // SIGSEGV HERE!!!

cout << " After calling dcmGenerateUniqueIdentifier().." << endl;
cout << "newuid:" << newuid << endl;

........

Here is the stack trace from gdb:
=======================
Program received signal SIGSEGV, Segmentation fault.
0x081037b5 in _dl_relocate_object ()
(gdb) bt
#0 0x081037b5 in _dl_relocate_object ()
#1 0x081021af in dl_open_worker ()
#2 0x080fbb7b in _dl_catch_error ()
#3 0x081023a3 in _dl_open ()
#4 0x080fcc2e in do_dlopen ()
#5 0x080fbb7b in _dl_catch_error ()
#6 0x080fcb21 in __libc_dlopen ()
#7 0x080f0692 in __nss_lookup_function ()
#8 0x080f0d1a in __nss_lookup ()
#9 0x080f1503 in __nss_hosts_lookup ()
#10 0x080c51f8 in gethostbyname_r ()
#11 0x080c4c7b in gethostid ()
#12 0x0804bb00 in dcmGenerateUniqueIdentifier ()
#13 0x0804a403 in updateDICOMHdr (finalImg=0xbfffca60 "asl0001.dcm", diffdata=0x81aa4e0, pixels=4096, imgcount=36) at ASL.cc:710
#14 0x080494e7 in createAvgDiffImage (filelist=0xbfffe09b "/usr/g/insite/tmp/filelist", num_files=36, num_slices=18,
num_volumes=2, pixels=4096) at ASL.cc:358
#15 0x08048634 in main (argc=2, argv=0xbfffd114) at ASL.cc:132


Any suggestions on how to get around this problem will be much
appreciated.

Thanks!!

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1445
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

#2 Post by Marco Eichelberg »

The stack trace shows that the segmentation fault happens somewhere deep inside the system libraries, inside the gethostbyname_r system function. It seems as if something has gone wrong while the system tried to load a shared object needed for gethostbyname_r. Possibly a damaged shared object somewhere in /usr/lib?

amateurPro2
Posts: 3
Joined: Mon, 2005-01-31, 23:28

#3 Post by amateurPro2 »

Marco Eichelberg wrote:The stack trace shows that the segmentation fault happens somewhere deep inside the system libraries, inside the gethostbyname_r system function. It seems as if something has gone wrong while the system tried to load a shared object needed for gethostbyname_r. Possibly a damaged shared object somewhere in /usr/lib?
Thanks Marco. So how would I go about debugging this issue. Is there any
way to find out what shared object was missing/corrupt?

Thanks again..

Marco Eichelberg
OFFIS DICOM Team
OFFIS DICOM Team
Posts: 1445
Joined: Tue, 2004-11-02, 17:22
Location: Oldenburg, Germany
Contact:

#4 Post by Marco Eichelberg »

To be honest, I have no idea :oops:

amateurPro2
Posts: 3
Joined: Mon, 2005-01-31, 23:28

#5 Post by amateurPro2 »

Marco Eichelberg wrote:To be honest, I have no idea :oops:
Got it to work after one of my colleagues suggested compiling dcmtk and
my code on a newer version of gcc (3.3)

Thanks anyways

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest