Opened 12 years ago

Closed 12 years ago

Last modified 12 years ago

#2046 closed Bug (fixed)

JSON_parse.c doesn't parse floating-point numbers correctly in some locales

Reported by: simonbcn Owned by: charles
Priority: Normal Milestone: 1.61
Component: libtransmission Version: 1.60
Severity: Normal Keywords:
Cc:

Description

When I see the torrent list in QTransmission (connected to transmission-daemon in remote machine) doesn't inform the percentage nor progress bar.
The percentage is 0 ever The percentage is always 0 and the progress bar is always empty, until the torrent is completed, then it shows 100% and progress bar full.

Attachments (6)

Pantallazo.png (104.5 KB) - added by simonbcn 12 years ago.
Pantallazo-Torrent Properties.png (36.4 KB) - added by simonbcn 12 years ago.
Screenshot incomplete torrent
Pantallazo-Torrent Properties-1.png (35.3 KB) - added by simonbcn 12 years ago.
Screenshot complete torrent
2046-debug-1.diff (835 bytes) - added by charles 12 years ago.
debug.log (122.5 KB) - added by simonbcn 12 years ago.
Output QTransmission
json-parser.diff (1.2 KB) - added by charles 12 years ago.
possible fix to a locale bug when parsing floating-point numbers in the JSON parser

Download all attachments as: .zip

Change History (20)

comment:1 Changed 12 years ago by charles

are you connected to a 1.60 daemon?

comment:2 Changed 12 years ago by charles

  • Resolution set to invalid
  • Status changed from new to closed
10:43 <@charles_> could another Qt client user take a look at #2046?
10:45 < kjg> !ticket 2046
10:45 <@Stickshift> kjg: http://www.transmissionbt.com/trac/ticket/2046
10:47 < kjg> works for me. Using certain qt styles, the inner progress bar disappears when the widget is disabled, but i don't think that's what he is talking about.

Also, as screenshot of it working when connected to a 1.60 daemon:

http://www.transmissionbt.com/images/screenshots/transmission-1.60-qt-beta.png

comment:3 Changed 12 years ago by simonbcn

  • Resolution invalid deleted
  • Status changed from closed to reopened
$ transmission-daemon -V
Transmission 1.60 (8339)

I attach a screenshot

comment:4 Changed 12 years ago by charles

Could you please attach a screenshot of the "Activity" tab from the properties dialogs of

  • one of the torrents showing 100% and
  • one of the torrents showing 0% that isn't really at 0%

Thanks...

Changed 12 years ago by simonbcn

Changed 12 years ago by simonbcn

Screenshot incomplete torrent

Changed 12 years ago by simonbcn

Screenshot complete torrent

comment:5 Changed 12 years ago by simonbcn

I have uploaded one screenshot of updated torrent list http://trac.transmissionbt.com/attachment/ticket/2046/Pantallazo.png
The torrent strikethrough with red bar corresponds to incomplete torrent: http://trac.transmissionbt.com/attachment/ticket/2046/Pantallazo-Torrent%20Properties.png
The torrent strikethrough with blue bar corresponds to complete torrent: http://trac.transmissionbt.com/attachment/ticket/2046/Pantallazo-Torrent%20Properties-1.png

If you need something more, here I am.
Greetings.

comment:6 Changed 12 years ago by simonbcn

Other bug:
It does not update the ratio either.
The torrent strikethrough with blue bar, it has uploaded 1'9GB but its ratio is 0.00.

comment:7 Changed 12 years ago by charles

Thanks for the fast update.

The progressbar's percentage should be coming directly from the "percentDone" field from the server.

Let's try this. Could you apply the following test patch, which will dump out to the terminal some of the raw field values that are being used to set the main window's gui.

If you could attach a few hundred lines of that output to this ticket, that might be helpful.

The dump will give the torrent name, percentDone, sizeWhenDone, and leftUntilDone fields. The name field is only there to make it easier for you to match the text up with the gui, but I don't need/want to know the names of the torrents.

Thanks!

Changed 12 years ago by charles

Changed 12 years ago by simonbcn

Output QTransmission

comment:8 Changed 12 years ago by charles

Interesting. In *every case* the percentDone is either 1 or 0. I wonder why?

comment:9 Changed 12 years ago by charles

simonbcn: what environment settings are you using for your locale? I'm wondering if there's an error parsing the floating-point number.

Are you in a locale that uses a period for a decimal point, or something else such as a comma?

comment:10 Changed 12 years ago by charles

If it's a locale problem, I think I've found the bug in the third-party JSON parser we use. Could you please apply the following patch and see if it fixes things?

Changed 12 years ago by charles

possible fix to a locale bug when parsing floating-point numbers in the JSON parser

comment:11 Changed 12 years ago by simonbcn

Thank you. Bug solved.

comment:12 Changed 12 years ago by charles

  • Milestone changed from None Set to 1.61
  • Resolution set to fixed
  • Status changed from reopened to closed

Committed in r8372 for 1.61.

I also reported the bug upstream to JSON_parser.c's author, Jean Gressmann

comment:13 Changed 12 years ago by charles

  • Component changed from Qt Client to libtransmission

comment:14 Changed 12 years ago by charles

  • Summary changed from Progress bar and Percentage to JSON_parse.c doesn't parse floating-point numbers correctly in some locales
Note: See TracTickets for help on using tickets.