Git Product home page Git Product logo

Comments (2)

bajinsheng avatar bajinsheng commented on May 31, 2024

Which version of Dcmtk do you use? It is probably a conflict between Dcmtk and SGFuzz, because both of them are running the same process. I would suggest you gdb the Dcmtk to check what is happening.

For my previous experiments, I patched Dcmtk to avoid conflicts:

diff --git a/dcmqrdb/apps/dcmqrscp.cc b/dcmqrdb/apps/dcmqrscp.cc
index 0ddc933c1..edc1bc085 100644
--- a/dcmqrdb/apps/dcmqrscp.cc
+++ b/dcmqrdb/apps/dcmqrscp.cc
@@ -83,7 +83,7 @@ static char rcsid[] = "$dcmtk: " OFFIS_CONSOLE_APPLICATION " v"
 
 #define APPLICATIONTITLE "DCMQRSCP"
 
-const char *opt_configFileName = DEFAULT_CONFIGURATION_DIR "dcmqrscp.cfg";
+const char *opt_configFileName = "./dcmqrscp.cfg";
 OFBool      opt_checkFindIdentifier = OFFalse;
 OFBool      opt_checkMoveIdentifier = OFFalse;
 OFCmdUnsignedInt opt_port = 0;
diff --git a/dcmqrdb/libsrc/dcmqrsrv.cc b/dcmqrdb/libsrc/dcmqrsrv.cc
index 7f01409c5..73dd2c450 100644
--- a/dcmqrdb/libsrc/dcmqrsrv.cc
+++ b/dcmqrdb/libsrc/dcmqrsrv.cc
@@ -966,6 +966,7 @@ OFCondition DcmQueryRetrieveSCP::waitForAssociation(T_ASC_Network * theNet)
     char                buf[BUFSIZ];
     int timeout;
     OFBool go_cleanup = OFFalse;
+    OFBool go_fuzzercleanup = OFTrue;
 
     if (options_.singleProcess_) timeout = 1000;
     else
@@ -1083,6 +1084,7 @@ OFCondition DcmQueryRetrieveSCP::waitForAssociation(T_ASC_Network * theNet)
         {
             /* don't spawn a sub-process to handle the association */
             cond = handleAssociation(assoc, options_.correctUIDPadding_);
+            go_fuzzercleanup = OFFalse;
         }
 #ifdef HAVE_FORK
         else
@@ -1114,7 +1116,7 @@ OFCondition DcmQueryRetrieveSCP::waitForAssociation(T_ASC_Network * theNet)
 
     // cleanup code
     OFCondition oldcond = cond;    /* store condition flag for later use */
-    if (!options_.singleProcess_ && (cond != ASC_SHUTDOWNAPPLICATION))
+    if (go_fuzzercleanup)
     {
         /* the child will handle the association, we can drop it */
         cond = ASC_dropAssociation(assoc);
@@ -1128,7 +1130,7 @@ OFCondition DcmQueryRetrieveSCP::waitForAssociation(T_ASC_Network * theNet)
             DCMQRDB_ERROR("Cannot Destroy Association: " << DimseCondition::dump(temp_str, cond));
         }
     }
-
+    
     if (oldcond == ASC_SHUTDOWNAPPLICATION) cond = oldcond; /* abort flag is reported to top-level wait loop */
     return cond;
 }

from sgfuzz.

Br1m4zz avatar Br1m4zz commented on May 31, 2024

Thank you for your patch and it works!
The commit version I use is 7f8564c and I apply the patch on libsrc/dcmqrsrv.cc
It's probabaly because thread conflicts between libfuzzer and the target that leads to the exit

from sgfuzz.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.