Loading ...
Sorry, an error occurred while loading the content.

Re: Access violation in gensock_connect() if server connection is refused in 2.7.5

Expand Messages
  • thomas_beutlich
    OK, the really working solution is to call delete conn; only if gensock_close(conn) return on error, i.e. retval = conn- get_connected (hostname, service); if
    Message 1 of 11 , Oct 21, 2011
    View Source
    • 0 Attachment
      OK, the really working solution is to call delete conn; only if gensock_close(conn) return on error, i.e.

      retval = conn->get_connected (hostname, service);
      if ( retval ) {
      if (gensock_close(conn))
      delete conn;
      *pst = 0;
      return(retval);
      }

      Regards,
      Thomas

      --- In blat@yahoogroups.com, "thomas_beutlich" <yahoo@...> wrote:
      >
      > Hi,
      >
      > I get an access violation in function gensock_connect() of file
      > gensock.cpp if get_connected() returns non-zero, for instance if server
      > connection fails. The access violation is on delete conn; however it is
      > already deleted by gensock_close() -> global_socket_list.remove().
      > If I remove this faulty delete conn; from gensock.cpp then all is fine
      > with working and failing sends and there are no memory leaks though
      > (checked with http://vld.codeplex.com/).
      >
      > Can you please reproduce and fix. Thanks!
      >
      > Regards,
      > Thomas
      >
      > P.S. Blat 2.6.2 seemed to be OK here, but I did not debug again.
      >
      > --
      > http://blat.tbeu.de
      >
      >
      > [Non-text portions of this message have been removed]
      >
    • Chip
      Thanks, I put this fix into the next version. :) Chip
      Message 2 of 11 , Oct 25, 2011
      View Source
      • 0 Attachment
        Thanks, I put this fix into the next version. :)

        Chip
      • thomas_beutlich
        What dou you think when next (maintenance) version is going to be released? In another 4 years ;-} ?
        Message 3 of 11 , Oct 26, 2011
        View Source
        • 0 Attachment
          What dou you think when next (maintenance) version is going to be released? In another 4 years ;-} ?

          --- In blat@yahoogroups.com, "Chip" <chip.programmer@...> wrote:
          >
          > Thanks, I put this fix into the next version. :)
          >
          > Chip
          >
        • Chip
          Actually, I had released several versions between 2.6.2 and 2.7.5, but they did not reach a wide audience. The fix you suggested will be released soon,
          Message 4 of 11 , Oct 26, 2011
          View Source
          • 0 Attachment
            Actually, I had released several versions between 2.6.2 and 2.7.5, but they
            did not reach a wide audience. The fix you suggested will be released soon,
            perhaps this weekend.

            Chip
          • thomas_beutlich
            Actually the bug was already posted on SF some years ago. So it was present in 2.6.2, too. Did not know that.
            Message 5 of 11 , Oct 28, 2011
            View Source
            • 0 Attachment
              Actually the bug was already posted on SF some years ago. So it was present in 2.6.2, too. Did not know that.
              http://sourceforge.net/tracker/?func=detail&aid=2796843&group_id=81910&atid=564431
              Can you please edit/resolve this SF bug when working on new release.

              Regards
              Thomas

              P.S. Do you plan to put Blat sources on SF as SVN repository such that Blat project members can develop together?

              --- In blat@yahoogroups.com, "Chip" <chip.programmer@...> wrote:
              >
              > Actually, I had released several versions between 2.6.2 and 2.7.5, but they
              > did not reach a wide audience. The fix you suggested will be released soon,
              > perhaps this weekend.
              >
              > Chip
              >
            • thomas_beutlich
              This access vialoation is still reproducible with 3.0.1 For me this change helps retval = conn- get_connected (hostname, service); if ( retval ) { if (
              Message 6 of 11 , Mar 11, 2012
              View Source
              • 0 Attachment
                This access vialoation is still reproducible with 3.0.1

                For me this change helps

                retval = conn->get_connected (hostname, service);
                if ( retval ) {
                if ( gensock_close(conn) )
                global_socket_list.remove(conn);
                *pst = 0;
                return(retval);
                }

                This is equivalent to always calling global_socket_list.remove(conn) in gensock_close no matter if conn->close() returns ERR_CLOSING or 0.

                Thus I am afraid my previous fix was not the best. Sorry for that.

                Kind regards,
                Thomas



                --- In blat@yahoogroups.com, "thomas_beutlich" <yahoo@...> wrote:
                >
                > OK, the really working solution is to call delete conn; only if gensock_close(conn) return on error, i.e.
                >
                > retval = conn->get_connected (hostname, service);
                > if ( retval ) {
                > if (gensock_close(conn))
                > delete conn;
                > *pst = 0;
                > return(retval);
                > }
                >
                > Regards,
                > Thomas
                >
                > --- In blat@yahoogroups.com, "thomas_beutlich" <yahoo@> wrote:
                > >
                > > Hi,
                > >
                > > I get an access violation in function gensock_connect() of file
                > > gensock.cpp if get_connected() returns non-zero, for instance if server
                > > connection fails. The access violation is on delete conn; however it is
                > > already deleted by gensock_close() -> global_socket_list.remove().
                > > If I remove this faulty delete conn; from gensock.cpp then all is fine
                > > with working and failing sends and there are no memory leaks though
                > > (checked with http://vld.codeplex.com/).
                > >
                > > Can you please reproduce and fix. Thanks!
                > >
                > > Regards,
                > > Thomas
                > >
                > > P.S. Blat 2.6.2 seemed to be OK here, but I did not debug again.
                > >
                > > --
                > > http://blat.tbeu.de
                > >
                > >
                > > [Non-text portions of this message have been removed]
                > >
                >
              • Chip
                ... What steps did you do that found this issue? Thanks, Chip
                Message 7 of 11 , Mar 11, 2012
                View Source
                • 0 Attachment
                  > This access vialoation is still reproducible with 3.0.1

                  What steps did you do that found this issue?

                  Thanks,
                  Chip
                • thomas_beutlich
                  You can either pull LAN connection / switch off WLAN and try in offline mode or when debugging set in gensock.cpp two breakpoints after retval =
                  Message 8 of 11 , Mar 12, 2012
                  View Source
                  • 0 Attachment
                    You can either pull LAN connection / switch off WLAN and try in offline mode or when debugging set in gensock.cpp two breakpoints after

                    retval = conn->get_connected (hostname, service);

                    and

                    retval = conn->close();

                    and change value of retval for all cases to 4012 to force server connection error. You should also check exceptions. You will then notice the access violation on destruction in connection::~connection (void).

                    Regards,
                    Thomas

                    --- In blat@yahoogroups.com, "Chip" <chip.programmer@...> wrote:
                    >
                    > > This access vialoation is still reproducible with 3.0.1
                    >
                    > What steps did you do that found this issue?
                    >
                    > Thanks,
                    > Chip
                    >
                  • thomas_beutlich
                    Could you reproduce this issue?
                    Message 9 of 11 , Mar 19, 2012
                    View Source
                    • 0 Attachment
                      Could you reproduce this issue?

                      --- In blat@yahoogroups.com, "thomas_beutlich" <yahoo@...> wrote:
                      >
                      > You can either pull LAN connection / switch off WLAN and try in offline mode or when debugging set in gensock.cpp two breakpoints after
                      >
                      > retval = conn->get_connected (hostname, service);
                      >
                      > and
                      >
                      > retval = conn->close();
                      >
                      > and change value of retval for all cases to 4012 to force server connection error. You should also check exceptions. You will then notice the access violation on destruction in connection::~connection (void).
                      >
                      > Regards,
                      > Thomas
                      >
                      > --- In blat@yahoogroups.com, "Chip" <chip.programmer@> wrote:
                      > >
                      > > > This access vialoation is still reproducible with 3.0.1
                      > >
                      > > What steps did you do that found this issue?
                      > >
                      > > Thanks,
                      > > Chip
                      > >
                      >
                    • Chip
                      ... I did not reproduce the issue, but I did review it and looked at the source to follow it through. I made the change you suggested. I also made some other
                      Message 10 of 11 , Mar 19, 2012
                      View Source
                      • 0 Attachment
                        > Could you reproduce this issue?

                        I did not reproduce the issue, but I did review it and looked at the source
                        to follow it through. I made the change you suggested.

                        I also made some other edits to show "*** Warning ***" in output for more
                        server related messages.

                        --
                        Chip
                      Your message has been successfully submitted and would be delivered to recipients shortly.