Uploaded image for project: 'Axis2-C'
  1. Axis2-C
  2. AXIS2C-1611

Seg fault if error on building conf

    XMLWordPrintableJSON

Details

    Description

      There is a segfault when an error ocurrs in creating conf.

      To reproduce the bug:

      • Install axis2c trunk, and compile samples
      • go to AXIS2C_HOME/lib and remove or move one of the libraries (cd $AXIS2C_HOME/lib &&sudo mv libaxis2_http_receiver.so.0.7.0 libaxis2_http_receiver.so.0.7.0.1)
      • execute one of the samples (i.e. echo) it will segfault.

      Altough it is an error not beeing able to find an so, it should close gracefully, I think that this segfault may arise under other circumstances which cause conf building to fail...

      Examining the issue with valgrind it seems that there is a double freeing of dep_engine.
      dep_engine has a reference to conf and conf has a reference to dep_engine, and when it fails on creating conf, it deletes the conf (dep_engine.c:968) and when it exits the function tries to delete dep_engine again, which causes the segfault.

      The proposed solution is to set the dep_engine ptr from conf to NULL before deleting the conf.
      The proposed patch avoids the segfault, and doesn't leak memory in normal or error cases, please let me know if it is OK.

      Attachments

        Activity

          People

            xydinesh Dinesh Weerapurage
            alexmantaut Alex Mantaut
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - 0.5h
                0.5h
                Remaining:
                Remaining Estimate - 0.5h
                0.5h
                Logged:
                Time Spent - Not Specified
                Not Specified