Bug 1791 - Infinite loop in pv:views:trace::View::calculate_tick_spacing
Summary: Infinite loop in pv:views:trace::View::calculate_tick_spacing
Status: RESOLVED DUPLICATE of bug 1773
Alias: None
Product: PulseView
Classification: Unclassified
Component: Data display (show other bugs)
Version: 0.4.2
Hardware: x86 Linux
: Normal normal
Target Milestone: ---
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-08-17 09:51 CEST by Jan Breuer
Modified: 2022-08-17 09:54 CEST (History)
1 user (show)



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Jan Breuer 2022-08-17 09:51:21 CEST
Pulseview hangs on startup in some strange situations in method pv:views:trace::View::calculate_tick_spacing.

I tried to debug it a little bit and here are my findings:

 - Running pulseview with LANG=C solves the problem for me
 - My regular LANG is cs_CZ.utf8 which triggers the bug but it seems that it is not the only thing.
 - Debugging the application in qt-creator hides the bug but using pure gdb reveals it. Maybe qt-creator is doing something with environment variables.


In the code, there is a loop

do {
...
} while (tick_period_width < label_width);

which never ends.

Difference in executions is for first tick_period=0.01 and scale_=0.001 where equation

tick_period_width = (tick_period / scale_).convert_to<double>();

the result is 10 for LANG=C and 9 for LANG=cs_CZ.utf8. I really don't understand the consequences and how can LANG influence this calculation. So my debugging ends here. The value of label_width is calculated correctly and the same in both cases.


pulseview: 0.4.2
libsigrok: 0.5.2
boost: 1.79.0
GCC: 11.3.0
qt: 5.15.5
Comment 1 Marcus Comstedt 2022-08-17 09:54:46 CEST

*** This bug has been marked as a duplicate of bug 1773 ***