[haiku-bugs] Re: [Haiku] #6417: __printf_fphex crashes in haiku

  • From: "zooey" <trac@xxxxxxxxxxxx>
  • Date: Mon, 02 Aug 2010 21:11:24 -0000

#6417: __printf_fphex crashes in haiku
--------------------------------+-------------------------------------------
  Reporter:  MrSunshine         |         Owner:  zooey         
      Type:  bug                |        Status:  closed        
  Priority:  normal             |     Milestone:  R1            
 Component:  System/libroot.so  |       Version:  R1/Development
Resolution:  invalid            |      Keywords:                
Blocked By:                     |   Has a Patch:  0             
  Platform:  All                |      Blocking:                
--------------------------------+-------------------------------------------

Comment (by zooey):

 Replying to [comment:4 bonefish]:
 > The first format specification is `%x`, which expects a signed or
 unsigned int, but the respective argument is `0.2f`, which is a float. The
 float gets converted to double when passed via varargs, so this has indeed
 a good chance to crash on any system where `sizeof(int) !=
 sizeof(double)`, since part of the double argument will be interpreted as
 a string pointer.

 I told him that in IRC, yesterday - the only reason I kept this open is
 that he mentioned the crash would be in !__printf_fphex(), which indicated
 a problem during the formatting of the hex number. Since that should be
 the last thing to actually work fine, it got me curious. But I have been
 unable to reproduce crashes in !__printf_fphex(), it's either vfprintf()
 or strlen() crashing, both of which would be explainable.

 So there's really nothing special to learn from this.

-- 
Ticket URL: <http://dev.haiku-os.org/ticket/6417#comment:5>
Haiku <http://dev.haiku-os.org>
Haiku - the operating system.

Other related posts: