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!!
SIGSEGV (Segmentation fault) on calling dcmGenerateUniqueIdentifier ()
Moderator: Moderator Team
-
- Posts: 3
- Joined: Mon, 2005-01-31, 23:28
-
- OFFIS DICOM Team
- Posts: 1445
- Joined: Tue, 2004-11-02, 17:22
- Location: Oldenburg, Germany
- Contact:
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?
-
- Posts: 3
- Joined: Mon, 2005-01-31, 23:28
Thanks Marco. So how would I go about debugging this issue. Is there anyMarco 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?
way to find out what shared object was missing/corrupt?
Thanks again..
-
- OFFIS DICOM Team
- Posts: 1445
- Joined: Tue, 2004-11-02, 17:22
- Location: Oldenburg, Germany
- Contact:
-
- Posts: 3
- Joined: Mon, 2005-01-31, 23:28
Who is online
Users browsing this forum: Bing [Bot], Google [Bot] and 1 guest