CharConvertor::convert( char value ) bug

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|

CharConvertor::convert( char value ) bug

Alexey Zubko
QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html
QuickFIX FAQ: http://www.quickfixengine.org/wikifix/index.php?QuickFixFAQ
QuickFIX Support: http://www.quickfixengine.org/services.html

Guys,

I don't want to annoy you, but I think the following bug must be fixed.
I reported about it early and I thought it would be a part of this release.

I think quickfix must be more stable for this cases. At least throw
something like InvalidFieldValue...

Here is the example:

    char                                 its_just_a_bug_or_wrong_input =
'\0';
// oops!
    FIX::OrdStatus                OrdStatus = its_just_a_bug_or_wrong_input;

    FIX::Message                  message;
    message.setField(OrdStatus);
    message.setField(FIX::TransactTime());

// now we send the message:
    std::string        str;
    message.toString(str);    // result: "9=26|39="



--

Regards,
                Alexey Zubko

Infinium Capital Corporation
(416) 360-7000 ext. 305



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Quickfix-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfix-developers
Reply | Threaded
Open this post in threaded view
|

Re: CharConvertor::convert( char value ) bug

Brian Erst
QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html
QuickFIX FAQ: http://www.quickfixengine.org/wikifix/index.php?QuickFixFAQ
QuickFIX Support: http://www.quickfixengine.org/services.html

Quick patch that would fix this problem (QF 1.9.4):

FieldConverters.h:

249 struct CharConvertor
250 {
251    static std::string convert( char value )
252    {
++        if (value)
253         return std::string( 1, value );
++        else
++          return std::string("");
254    }

The problem is that the std::string template either has a "feature" or
a "bug" that doesn't check if the results of a char-based
initialization will cause a weird disconnect between the encapsulated
C-string (c_str) and the length/size member. The size or length
reported from such an initialization will be "1", even though the
size/length of c_str is "0".

Changing the initialization to use an empty string when the char value
is null should fix this problem.

- Brian Erst
Thynk Software, Inc.




--- Alexey Zubko <[hidden email]> wrote:

> QuickFIX Documentation:
> http://www.quickfixengine.org/quickfix/doc/html/index.html
> QuickFIX FAQ:
> http://www.quickfixengine.org/wikifix/index.php?QuickFixFAQ
> QuickFIX Support: http://www.quickfixengine.org/services.html
>
> Guys,
>
> I don't want to annoy you, but I think the following bug must be
> fixed.
> I reported about it early and I thought it would be a part of this
> release.
>
> I think quickfix must be more stable for this cases. At least throw
> something like InvalidFieldValue...
>
> Here is the example:
>
>     char                                
> its_just_a_bug_or_wrong_input =
> '\0';
> // oops!
>     FIX::OrdStatus                OrdStatus =
> its_just_a_bug_or_wrong_input;
>
>     FIX::Message                  message;
>     message.setField(OrdStatus);
>     message.setField(FIX::TransactTime());
>
> // now we send the message:
>     std::string        str;
>     message.toString(str);    // result: "9=26|39="
>
>
>
> --
>
> Regards,
> Alexey Zubko
>
> Infinium Capital Corporation
> (416) 360-7000 ext. 305
>
>
>
> -------------------------------------------------------
> SF.Net email is sponsored by: Discover Easy Linux Migration
> Strategies
> from IBM. Find simple to follow Roadmaps, straightforward articles,
> informative Webcasts and more! Get everything you need to get up to
> speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
> _______________________________________________
> Quickfix-developers mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/quickfix-developers
>



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Quickfix-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfix-developers
Reply | Threaded
Open this post in threaded view
|

Re: CharConvertor::convert( char value ) bug

Alexey Zubko
Brian,

I know what the problem is.

See my posting:
  some changes in C++ version Alexey Zubko [hidden email] 2 2005-06-09 06:06

Is there a reason not to put this patch to the version?

Regards,
		Alexey Zubko

Infinium Capital Corporation
(416) 360-7000 ext. 305


Brian Erst wrote:
Quick patch that would fix this problem (QF 1.9.4):

FieldConverters.h:

249 struct CharConvertor
250 {
251    static std::string convert( char value )
252    {
++        if (value)
253         return std::string( 1, value );
++        else
++          return std::string("");
254    }

The problem is that the std::string template either has a "feature" or
a "bug" that doesn't check if the results of a char-based
initialization will cause a weird disconnect between the encapsulated
C-string (c_str) and the length/size member. The size or length
reported from such an initialization will be "1", even though the
size/length of c_str is "0".

Changing the initialization to use an empty string when the char value
is null should fix this problem.

- Brian Erst
Thynk Software, Inc.




--- Alexey Zubko [hidden email] wrote:

  
QuickFIX Documentation:
http://www.quickfixengine.org/quickfix/doc/html/index.html
QuickFIX FAQ:
http://www.quickfixengine.org/wikifix/index.php?QuickFixFAQ
QuickFIX Support: http://www.quickfixengine.org/services.html

Guys,

I don't want to annoy you, but I think the following bug must be
fixed.
I reported about it early and I thought it would be a part of this
release.

I think quickfix must be more stable for this cases. At least throw 
something like InvalidFieldValue...

Here is the example:

    char                                
its_just_a_bug_or_wrong_input = 
'\0';
// oops!
    FIX::OrdStatus                OrdStatus =
its_just_a_bug_or_wrong_input;

    FIX::Message                  message;
    message.setField(OrdStatus);
    message.setField(FIX::TransactTime());

// now we send the message:
    std::string        str;
    message.toString(str);    // result: "9=26|39="



-- 

Regards,
		Alexey Zubko

Infinium Capital Corporation
(416) 360-7000 ext. 305



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration
Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Quickfix-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfix-developers

    


  
Reply | Threaded
Open this post in threaded view
|

Re: CharConvertor::convert( char value ) bug

Brian Erst
QuickFIX Documentation: http://www.quickfixengine.org/quickfix/doc/html/index.html
QuickFIX FAQ: http://www.quickfixengine.org/wikifix/index.php?QuickFixFAQ
QuickFIX Support: http://www.quickfixengine.org/services.html

Alexey -

As I learned myself and as Oren reiterated this morning in his 1.10.2
announcement, the only way to be sure that something gets fixed is to
enter it into the BugTracker
(http://www.quickfixengine.org/bugtracker/). The mailing list is
getting too busy to use to track these issues.

I took the liberty of entering the CharConverter bug into the Bug
Tracker (bug #84). The other issues you listed in your linked email
should probably be checked against 1.10.2 and, if they still exist,
entered as bugs/feature requests in the Bug Tracker.

- Brian Erst
Thynk Software, Inc.

--- Alexey Zubko <[hidden email]> wrote:

> Brian,
>
> I know what the problem is.
>
> See my posting:
>   some changes in C++ version
>
<http://sourceforge.net/mailarchive/forum.php?thread_id=7465814&forum_id=103>

>
> Alexey Zubko <alexey@in...> 2 2005-06-09 06:06
>
>
> Is there a reason not to put this patch to the version?
>
> Regards,
> Alexey Zubko
>
> Infinium Capital Corporation
> (416) 360-7000 ext. 305
>
>
>
> Brian Erst wrote:
>
> >Quick patch that would fix this problem (QF 1.9.4):
> >
> >FieldConverters.h:
> >
> >249 struct CharConvertor
> >250 {
> >251    static std::string convert( char value )
> >252    {
> >++        if (value)
> >253         return std::string( 1, value );
> >++        else
> >++          return std::string("");
> >254    }
> >
> >The problem is that the std::string template either has a "feature"
> or
> >a "bug" that doesn't check if the results of a char-based
> >initialization will cause a weird disconnect between the
> encapsulated
> >C-string (c_str) and the length/size member. The size or length
> >reported from such an initialization will be "1", even though the
> >size/length of c_str is "0".
> >
> >Changing the initialization to use an empty string when the char
> value
> >is null should fix this problem.
> >
> >- Brian Erst
> >Thynk Software, Inc.
> >
> >
> >
> >
> >--- Alexey Zubko <[hidden email]> wrote:
> >
> >  
> >
> >>QuickFIX Documentation:
> >>http://www.quickfixengine.org/quickfix/doc/html/index.html
> >>QuickFIX FAQ:
> >>http://www.quickfixengine.org/wikifix/index.php?QuickFixFAQ
> >>QuickFIX Support: http://www.quickfixengine.org/services.html
> >>
> >>Guys,
> >>
> >>I don't want to annoy you, but I think the following bug must be
> >>fixed.
> >>I reported about it early and I thought it would be a part of this
> >>release.
> >>
> >>I think quickfix must be more stable for this cases. At least throw
>
> >>something like InvalidFieldValue...
> >>
> >>Here is the example:
> >>
> >>    char                                
> >>its_just_a_bug_or_wrong_input =
> >>'\0';
> >>// oops!
> >>    FIX::OrdStatus                OrdStatus =
> >>its_just_a_bug_or_wrong_input;
> >>
> >>    FIX::Message                  message;
> >>    message.setField(OrdStatus);
> >>    message.setField(FIX::TransactTime());
> >>
> >>// now we send the message:
> >>    std::string        str;
> >>    message.toString(str);    // result: "9=26|39="
> >>
> >>
> >>
> >>--
> >>
> >>Regards,
> >> Alexey Zubko
> >>
> >>Infinium Capital Corporation
> >>(416) 360-7000 ext. 305
> >>
> >>
> >>
> >>-------------------------------------------------------
> >>SF.Net email is sponsored by: Discover Easy Linux Migration
> >>Strategies
> >>from IBM. Find simple to follow Roadmaps, straightforward articles,
> >>informative Webcasts and more! Get everything you need to get up to
> >>speed, fast.
> http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
> >>_______________________________________________
> >>Quickfix-developers mailing list
> >>[hidden email]
> >>https://lists.sourceforge.net/lists/listinfo/quickfix-developers
> >>
> >>    
> >>
> >
> >
> >  
> >
>



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Quickfix-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfix-developers
Reply | Threaded
Open this post in threaded view
|

Re: CharConvertor::convert( char value ) bug

Alexey Zubko
Ok.
Thank you.

I just wanted to hear feedbacks from the developers, because you know, a bug is a very subjective thing.
Usually it's one's misunderstanding, particularly in a such complicate project.


Regards,
		Alexey Zubko

Infinium Capital Corporation
(416) 360-7000 ext. 305


Brian Erst wrote:
Alexey -

As I learned myself and as Oren reiterated this morning in his 1.10.2
announcement, the only way to be sure that something gets fixed is to
enter it into the BugTracker
(http://www.quickfixengine.org/bugtracker/). The mailing list is
getting too busy to use to track these issues.

I took the liberty of entering the CharConverter bug into the Bug
Tracker (bug #84). The other issues you listed in your linked email
should probably be checked against 1.10.2 and, if they still exist,
entered as bugs/feature requests in the Bug Tracker.

- Brian Erst
Thynk Software, Inc.

--- Alexey Zubko [hidden email] wrote:

  
Brian,

I know what the problem is.

See my posting:
  some changes in C++ version 

    
<http://sourceforge.net/mailarchive/forum.php?thread_id=7465814&forum_id=103>
  
	Alexey Zubko [hidden email] 	2 	2005-06-09 06:06


Is there a reason not to put this patch to the version?

Regards,
		Alexey Zubko

Infinium Capital Corporation
(416) 360-7000 ext. 305



Brian Erst wrote:

    
Quick patch that would fix this problem (QF 1.9.4):

FieldConverters.h:

249 struct CharConvertor
250 {
251    static std::string convert( char value )
252    {
++        if (value)
253         return std::string( 1, value );
++        else
++          return std::string("");
254    }

The problem is that the std::string template either has a "feature"
      
or
    
a "bug" that doesn't check if the results of a char-based
initialization will cause a weird disconnect between the
      
encapsulated
    
C-string (c_str) and the length/size member. The size or length
reported from such an initialization will be "1", even though the
size/length of c_str is "0".

Changing the initialization to use an empty string when the char
      
value
    
is null should fix this problem.

- Brian Erst
Thynk Software, Inc.




--- Alexey Zubko [hidden email] wrote:

 

      
QuickFIX Documentation:
http://www.quickfixengine.org/quickfix/doc/html/index.html
QuickFIX FAQ:
http://www.quickfixengine.org/wikifix/index.php?QuickFixFAQ
QuickFIX Support: http://www.quickfixengine.org/services.html

Guys,

I don't want to annoy you, but I think the following bug must be
fixed.
I reported about it early and I thought it would be a part of this
release.

I think quickfix must be more stable for this cases. At least throw
        
something like InvalidFieldValue...

Here is the example:

   char                                
its_just_a_bug_or_wrong_input = 
'\0';
// oops!
   FIX::OrdStatus                OrdStatus =
its_just_a_bug_or_wrong_input;

   FIX::Message                  message;
   message.setField(OrdStatus);
   message.setField(FIX::TransactTime());

// now we send the message:
   std::string        str;
   message.toString(str);    // result: "9=26|39="



-- 

Regards,
		Alexey Zubko

Infinium Capital Corporation
(416) 360-7000 ext. 305



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration
Strategies
        
>from IBM. Find simple to follow Roadmaps, straightforward articles,
      
informative Webcasts and more! Get everything you need to get up to
speed, fast.
        
http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
    
_______________________________________________
Quickfix-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfix-developers

   

        
 

      


  


	
	
	
	
Reply | Threaded
Open this post in threaded view
|

Re: CharConvertor::convert( char value ) bug

Oren Miller
In reply to this post by Alexey Zubko
It just got missed.  If you want to be sure a patch makes it in, best to report it to the bugtracker (http://www.quickfixengine.org/bugtracker).  You can see with all the volume on a day like today things can get lost in the shuffle if you just rely reporting to the mailing list.
 
--oren
----- Original Message -----
Sent: Tuesday, July 05, 2005 2:23 PM
Subject: Re: [Quickfix-developers] CharConvertor::convert( char value ) bug

Brian,

I know what the problem is.

See my posting:
  some changes in C++ version Alexey Zubko [hidden email] 2 2005-06-09 06:06

Is there a reason not to put this patch to the version?

Regards,
		Alexey Zubko

Infinium Capital Corporation
(416) 360-7000 ext. 305


Brian Erst wrote:
Quick patch that would fix this problem (QF 1.9.4):

FieldConverters.h:

249 struct CharConvertor
250 {
251    static std::string convert( char value )
252    {
++        if (value)
253         return std::string( 1, value );
++        else
++          return std::string("");
254    }

The problem is that the std::string template either has a "feature" or
a "bug" that doesn't check if the results of a char-based
initialization will cause a weird disconnect between the encapsulated
C-string (c_str) and the length/size member. The size or length
reported from such an initialization will be "1", even though the
size/length of c_str is "0".

Changing the initialization to use an empty string when the char value
is null should fix this problem.

- Brian Erst
Thynk Software, Inc.




--- Alexey Zubko [hidden email] wrote:

  
QuickFIX Documentation:
http://www.quickfixengine.org/quickfix/doc/html/index.html
QuickFIX FAQ:
http://www.quickfixengine.org/wikifix/index.php?QuickFixFAQ
QuickFIX Support: http://www.quickfixengine.org/services.html

Guys,

I don't want to annoy you, but I think the following bug must be
fixed.
I reported about it early and I thought it would be a part of this
release.

I think quickfix must be more stable for this cases. At least throw 
something like InvalidFieldValue...

Here is the example:

    char                                
its_just_a_bug_or_wrong_input = 
'\0';
// oops!
    FIX::OrdStatus                OrdStatus =
its_just_a_bug_or_wrong_input;

    FIX::Message                  message;
    message.setField(OrdStatus);
    message.setField(FIX::TransactTime());

// now we send the message:
    std::string        str;
    message.toString(str);    // result: "9=26|39="



-- 

Regards,
		Alexey Zubko

Infinium Capital Corporation
(416) 360-7000 ext. 305



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration
Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Quickfix-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfix-developers

    


  
Reply | Threaded
Open this post in threaded view
|

Re: CharConvertor::convert( char value ) bug

Alexey Zubko

I added a bug #85 -> missing milliseconds.


Regards,
		Alexey Zubko

Infinium Capital Corporation
(416) 360-7000 ext. 305


Oren Miller wrote:
It just got missed.  If you want to be sure a patch makes it in, best to report it to the bugtracker (<a class="moz-txt-link-freetext" href="http://">http://www.quickfixengine.org/bugtracker).  You can see with all the volume on a day like today things can get lost in the shuffle if you just rely reporting to the mailing list.
 
--oren
----- Original Message -----
Sent: Tuesday, July 05, 2005 2:23 PM
Subject: Re: [Quickfix-developers] CharConvertor::convert( char value ) bug

Brian,

I know what the problem is.

See my posting:
  some changes in C++ version Alexey Zubko [hidden email] 2 2005-06-09 06:06

Is there a reason not to put this patch to the version?

Regards,
		Alexey Zubko

Infinium Capital Corporation
(416) 360-7000 ext. 305
    


Brian Erst wrote:
Quick patch that would fix this problem (QF 1.9.4):

FieldConverters.h:

249 struct CharConvertor
250 {
251    static std::string convert( char value )
252    {
++        if (value)
253         return std::string( 1, value );
++        else
++          return std::string("");
254    }

The problem is that the std::string template either has a "feature" or
a "bug" that doesn't check if the results of a char-based
initialization will cause a weird disconnect between the encapsulated
C-string (c_str) and the length/size member. The size or length
reported from such an initialization will be "1", even though the
size/length of c_str is "0".

Changing the initialization to use an empty string when the char value
is null should fix this problem.

- Brian Erst
Thynk Software, Inc.




--- Alexey Zubko [hidden email] wrote:

  
QuickFIX Documentation:
http://www.quickfixengine.org/quickfix/doc/html/index.html
QuickFIX FAQ:
http://www.quickfixengine.org/wikifix/index.php?QuickFixFAQ
QuickFIX Support: http://www.quickfixengine.org/services.html

Guys,

I don't want to annoy you, but I think the following bug must be
fixed.
I reported about it early and I thought it would be a part of this
release.

I think quickfix must be more stable for this cases. At least throw 
something like InvalidFieldValue...

Here is the example:

    char                                
its_just_a_bug_or_wrong_input = 
'\0';
// oops!
    FIX::OrdStatus                OrdStatus =
its_just_a_bug_or_wrong_input;

    FIX::Message                  message;
    message.setField(OrdStatus);
    message.setField(FIX::TransactTime());

// now we send the message:
    std::string        str;
    message.toString(str);    // result: "9=26|39="



-- 

Regards,
		Alexey Zubko

Infinium Capital Corporation
(416) 360-7000 ext. 305



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration
Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Quickfix-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/quickfix-developers