Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dicomweb json on metadata malforfated json Error #26

Open
hakancicektr opened this issue Sep 7, 2022 · 37 comments
Open

dicomweb json on metadata malforfated json Error #26

hakancicektr opened this issue Sep 7, 2022 · 37 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@hakancicektr
Copy link

hakancicektr commented Sep 7, 2022

Hello i were testing 1.5.0c
i found issue with dicomweb json on metadata there is problem with creating json response.
json response is invalid. there some values lost and json format damaged.
when i tried with 2 images study . its working (OHIF)
but if image more than 2 images json is malformated. OHIF throw Sopclass error.

here is sample.
"0020000D":{"vr":"UI","Value":["1.2.},"000.7.572041167.76106034234"]},"" malformated part
"0020000E":{"vr":"UI","Value":["1.3.46.670589.11.72012.5.0.3812.2017031407141108960"]}
,"00200011":{"vr":"IS","Value":[101]},
"00200012":{"vr":"IS","Value":[1]}
,"00200013":{"vr":"IS","Value":[9]

looks like sprintf mixing while putting values. i can provide more samples.

i am using centos 7 i couldnt complie servertask due compile errors. i tried to dgate rather it still work fine.

Problem looks like on dgate.cpp

static int luaserialize(lua_State *L) function.

@marcelvanherk
Copy link
Owner

marcelvanherk commented Sep 7, 2022 via email

@marcelvanherk
Copy link
Owner

marcelvanherk commented Sep 7, 2022 via email

@marcelvanherk
Copy link
Owner

marcelvanherk commented Sep 7, 2022 via email

@hakancicektr
Copy link
Author

Hello,

in this part there " }, " between 1.2. and 000.7
is must not there .

"0020000D":{"vr":"UI","Value":["1.2.},"000.7.572041167.76106034234"]},""

should be correct one
"0020000D":{"vr":"UI","Value":["1.2.000.7.572041167.76106034234"]},""

i sent you files . Patient Images and Metadata
one correct metadata ( single image )
one incorrect (multi images)

i am using conquest linux 1417e with appox 1 million patients per month.

i would like to conturbate and share expriences.

If you interested you can contact me by +90 554 8848998 whatsapp or telegram (might better for fastest communication)

correct_json_metadata.txt
malformat_json_metada.txt
63791833_12.zip

@marcelvanherk
Copy link
Owner

marcelvanherk commented Sep 7, 2022 via email

@marcelvanherk
Copy link
Owner

Hi,

I think this is data corruption while transmitting from conquest to servertask. What compiler flags do you use?

Marcel

@hakancicektr
Copy link
Author

its looks like problem with pointer usage
there is result pointer but some codes writing over it indirectly
while Vr->data formating its adding to result but there is index to where data will put. some how index moving backward and writing data to wrong position then is overwrite existing data.
that is what am susspected.
i am still analizing your codes.

@marcelvanherk
Copy link
Owner

marcelvanherk commented Sep 7, 2022 via email

@marcelvanherk
Copy link
Owner

This issue appears in socket.cxx and buffer.cxx. You could roll them back to 1417d version to see what happens.

@hakancicektr
Copy link
Author

i have changed default break size to oldvalue / 2
then all worked fine.

include "dicom.hpp"

#ifdef UNIX

define DEFAULT_BREAK_SIZE 4096

#else

define DEFAULT_BREAK_SIZE 16384

#endif

@hakancicektr
Copy link
Author

but still there is corruption on image even i treid smaller value
image

@marcelvanherk
Copy link
Owner

marcelvanherk commented Sep 8, 2022

Ah,

This is the same issue. I will send an update to socket.cxx tonight to try and fix it.

Edit: api/dicom uses a lot of internal tcp/ip communication and apparantly that is more sensitive for bugs in the socket layer. This is good, because I though they have been fixed, but apparently not. I think I will use luasockets code and link that to socket.cxx.

Marcel

@marcelvanherk
Copy link
Owner

marcelvanherk commented Sep 8, 2022 via email

@marcelvanherk
Copy link
Owner

ctest.zip

@hakancicektr
Copy link
Author

Hello thank you for your efort

after complie dgate listener got error

***Error in Accept() function call
***Attemping to re-bind socket

@hakancicektr
Copy link
Author

if i use new complied as bridge (rather servertask) and on server side old one complied
then server side

***No valid presentation contexts/transfer syntax found in 0 candidates
***In 0 presentation contexts
***#Possible transfer syntaxes: 13
*** multiplex: connection terminated
***No valid presentation contexts/transfer syntax found in 0 candidates
***In 0 presentation contexts
***#Possible transfer syntaxes: 13
*** multiplex: connection terminated

@marcelvanherk
Copy link
Owner

marcelvanherk commented Sep 9, 2022 via email

@marcelvanherk
Copy link
Owner

marcelvanherk commented Sep 9, 2022 via email

@hakancicektr
Copy link
Author

Hi, i have some ideas and kind of request for improve conquest. i have to many working experiences with conquest. where i can share with you here new topic or by direct email ?

@marcelvanherk
Copy link
Owner

marcelvanherk commented Sep 9, 2022 via email

@hakancicektr
Copy link
Author

Okay. i did open thread devoloper section. i have allready appox 700 hospitals runing Teleradilogy services 500k~1m patients per months and i am using conquest at backend.

i might helpfull and happy improve conquest.

@marcelvanherk
Copy link
Owner

marcelvanherk commented Sep 10, 2022

socket_test.zip

Hi again, can you try this socket version on centos? Absolutely not suitable for production but this on tests OK (now properly tested) on Debian and Windows (OHIF runs).

Curious if it helps with the json/image corruption issues. Expect a few more versions for testing.

@marcelvanherk
Copy link
Owner

The accept sockets times out after 5 minutes, so only use it for short tests.

@hakancicektr
Copy link
Author

Hello,
Better than before but still error in json and corrupted images.

@hakancicektr
Copy link
Author

no no json is okay. error during load images only.

@hakancicektr
Copy link
Author

***No valid presentation contexts/transfer syntax found in 0 candidates
***In 1 presentation contexts
***#Possible transfer syntaxes: 13
*** multiplex: connection terminated
***No accepted presentation contexts/transfer syntax found in 1 candidates
*** lua run error [string " local ae='01';..."]:5: attempt to index a nil value in ' local ae='01';
local level='STUDY';
local dicomweb=true;
local q2=DicomObject:new(' {"00201208":"","00201206":"","00200010":"","0020000D":"","00100040":"","00100030":"","00100020":"","00100010":"","00080201":"","00081190":"","00080090":"","00080061":"","00080056":"","00080054":"","00080050":"","00080030":"","00080020":"","00080005":"","limit":"25","offset":"0","fuzzymatching":"false","includefield":"00081030,00080060","99990C01":"25","99990C02":"0"} ');
local r = dicomquery(ae, level, q2):Serialize(true,false,dicomweb);
local s=tempfile('.txt') local f=io.open(s, "wb") f:write(r) returnfile=s f:close();
'

@hakancicektr
Copy link
Author

small json is okay. larger json serie with too many images still json error

@marcelvanherk
Copy link
Owner

marcelvanherk commented Sep 10, 2022 via email

@hakancicektr
Copy link
Author

okay i did same error like begin. directly json error.

@hakancicektr
Copy link
Author

files from 1.4.17.e2

@marcelvanherk
Copy link
Owner

marcelvanherk commented Sep 11, 2022 via email

@marcelvanherk
Copy link
Owner

socket_logging.zip

Hi,

this is socket.cxx with a simple logging. It would be nice if this could help spot the error.

The output it produces looks like:

0140 reads 100 bytes sum 2164
0144 writes 100 bytes sum 2164
0140 reads 276 bytes sum 9307
0144 writes 276 bytes sum 9307
0144 writes 100 bytes sum 2164
0140 reads 100 bytes sum 2164
0140 reads 274 bytes sum 9245
0144 writes 274 bytes sum 9245
0144 writes 100 bytes sum 2164
0140 reads 100 bytes sum 2164
0144 writes 276 bytes sum 9287
0144 writes 100 bytes sum 2164
0140 reads 376 bytes sum 11451
0144 writes 274 bytes sum 9241
0144 writes 100 bytes sum 2164
0140 reads 374 bytes sum 11405

Can you try it out on Centos?

Marcel

@hakancicektr
Copy link
Author

should i revert to all files to orginal version ? 1.5.0.c ?

@marcelvanherk
Copy link
Owner

marcelvanherk commented Sep 13, 2022 via email

@hakancicektr
Copy link
Author

hakancicektr commented Oct 11, 2022 via email

@marcelvanherk
Copy link
Owner

marcelvanherk commented Oct 11, 2022 via email

@marcelvanherk
Copy link
Owner

Hi PDUSize can be configured in dicom.ini in 1.5.0e. Try to see if this can be sorted by changing PDUsize. Have no solution otherwise.

@marcelvanherk marcelvanherk added help wanted Extra attention is needed bug Something isn't working labels Oct 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants