Endianess problem with dcmseg_roundtrip test

Compilation and installation of DCMTK

Moderator: Moderator Team

Post Reply
Message
Author
alciregi
Posts: 6
Joined: Wed, 2021-07-28, 13:14

Endianess problem with dcmseg_roundtrip test

#1 Post by alciregi » Wed, 2021-07-28, 13:24

Hello.
I'm trying to create an RPM package using the Fedora build infrastructure.
While dcmtk 3.6.6 builds successfully and all the tests pass on various architectures (i.e. x86_64, aarch64, ppc64le, etc.) I encountered a problem with s390x.
The dcmseg_roundtrip and dcmect_roundtrip tests fail, because (forgive me, but I'm not a developer):

Code: Select all

Dump produced: 
# Dicom-Data-Set
# Used TransferSyntax: Big Endian Explicit
...
Dump expected: 
# Dicom-Data-Set
# Used TransferSyntax: Little Endian Explicit
...
Here you can find the full log: https://kojipkgs.fedoraproject.org//wor ... /build.log of the build process.

Thank you if you would provide any hint.

J. Riesmeier
DCMTK Developer
Posts: 2314
Joined: Tue, 2011-05-03, 14:38
Location: Oldenburg, Germany
Contact:

Re: Endianess problem with dcmseg_roundtrip test

#2 Post by J. Riesmeier » Thu, 2021-07-29, 06:54

Could you please test the latest development version (from the public git repository)? I guess this issue has already been fixed with this commit: http://git.dcmtk.org/?p=dcmtk.git;a=com ... c5b1b32175

alciregi
Posts: 6
Joined: Wed, 2021-07-28, 13:14

Re: Endianess problem with dcmseg_roundtrip test

#3 Post by alciregi » Thu, 2021-07-29, 15:08

Thank you for the answer.
I applied the patch. I'm still able to compile for the various architectures; for x360s the dcmseg_roundtrip test now passes, but dcmect_roundtrip still fails.

Code: Select all

261/263 Test #263: dcmect_roundtrip .............................................***Failed    0.05 sec
FAILED test 'dcmect_roundtrip' at /builddir/build/BUILD/dcmtk-3.6.6/dcmect/tests/t_roundtrip.cc:622: frame[pix] == numInstance + 1
FAILED test 'dcmect_roundtrip' at /builddir/build/BUILD/dcmtk-3.6.6/dcmect/tests/t_roundtrip.cc:622: frame[pix] == numInstance + 1
FAILED test 'dcmect_roundtrip' at /builddir/build/BUILD/dcmtk-3.6.6/dcmect/tests/t_roundtrip.cc:622: frame[pix] == numInstance + 1
FAILED test 'dcmect_roundtrip' at /builddir/build/BUILD/dcmtk-3.6.6/dcmect/tests/t_roundtrip.cc:622: frame[pix] == numInstance + 1
FAILED test 'dcmect_roundtrip' at /builddir/build/BUILD/dcmtk-3.6.6/dcmect/tests/t_roundtrip.cc:622: frame[pix] == numInstance + 1
FAILED test 'dcmect_roundtrip' at /builddir/build/BUILD/dcmtk-3.6.6/dcmect/tests/t_roundtrip.cc:622: frame[pix] == numInstance + 1
FAILED test 'dcmect_roundtrip' at /builddir/build/BUILD/dcmtk-3.6.6/dcmect/tests/t_roundtrip.cc:622: frame[pix] == numInstance + 1
FAILED test 'dcmect_roundtrip' at /builddir/build/BUILD/dcmtk-3.6.6/dcmect/tests/t_roundtrip.cc:622: frame[pix] == numInstance + 1
Thanks.

alciregi
Posts: 6
Joined: Wed, 2021-07-28, 13:14

Re: Endianess problem with dcmseg_roundtrip test

#4 Post by alciregi » Fri, 2021-07-30, 08:03

So, debugging a little, it seems that

Code: Select all

frame[pix] == numInstance + 1
is

Code: Select all

256 == 1
and

Code: Select all

512 == 2

alciregi
Posts: 6
Joined: Wed, 2021-07-28, 13:14

Re: Endianess problem with dcmseg_roundtrip test

#5 Post by alciregi » Fri, 2021-07-30, 09:55

Indeed, if I use

Code: Select all

            OFCHECK(__bswap_16(frame[pix]) == numInstance + 1);
on line 622, it works.

Michael Onken
DCMTK Developer
Posts: 1830
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: Endianess problem with dcmseg_roundtrip test

#6 Post by Michael Onken » Fri, 2021-07-30, 10:45

Hi,

I'll look into it on Monday. Thank you for debugging.

Best regards,
Michael

Michael Onken
DCMTK Developer
Posts: 1830
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: Endianess problem with dcmseg_roundtrip test

#7 Post by Michael Onken » Mon, 2021-08-02, 15:05

Hi alciregi,

I added the swap in a corresponding way in DCMTK -- if it goes through the internal testing tonight, I'll publish the fix to master (and let you know).

Best,
Michael

Michael Onken
DCMTK Developer
Posts: 1830
Joined: Fri, 2004-11-05, 13:47
Location: Oldenburg, Germany
Contact:

Re: Endianess problem with dcmseg_roundtrip test

#8 Post by Michael Onken » Tue, 2021-08-03, 10:47

Hi, the related commits are now public on DCMTK master. It would be great if you could try this out in the next days.

Thank you,
Michael

alciregi
Posts: 6
Joined: Wed, 2021-07-28, 13:14

Re: Endianess problem with dcmseg_roundtrip test

#9 Post by alciregi » Tue, 2021-08-03, 10:54

Michael Onken wrote:
Tue, 2021-08-03, 10:47
Hi, the related commits are now public on DCMTK master. It would be great if you could try this out in the next days.
Thank you very much.
I will try ASAP.

alciregi
Posts: 6
Joined: Wed, 2021-07-28, 13:14

Re: Endianess problem with dcmseg_roundtrip test

#10 Post by alciregi » Tue, 2021-08-03, 13:54

Yes.
Using this patch http://git.dcmtk.org/?p=dcmtk.git;a=com ... a348922bc6 now the test passes successfully.
Thanks!

Post Reply

Who is online

Users browsing this forum: Google [Bot] and 1 guest