Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

true visualised as false #27

Closed
2 tasks
1wsx10 opened this issue Sep 22, 2023 · 1 comment
Closed
2 tasks

true visualised as false #27

1wsx10 opened this issue Sep 22, 2023 · 1 comment
Labels
- bug Something isn't working

Comments

@1wsx10
Copy link

1wsx10 commented Sep 22, 2023

What happened?

Actual behaviour:
'ret' variable is displayed as true, but the visualisation is coloured as though it's false
Expected behaviour:

System/app details

WhiteBox version - 0.116.0
WhiteBox commit - f1608e879ad5475d95f44ff2cc4d5cd22477afc8
Assert level - 1
Debug info - false
Kernel - Linux 6.5.3-arch1-1
OS - Arch Linux
Architecture - x86-64
CPU name - 11th Gen Intel(R) Core(TM) i7-11700B @ 3.20GHz
CPU count - 16
CPU MHz -
RAM - 16G

How to reproduce the error

Steps to reproduce:

  1. use the code example
  2. set this as the function caller
int len = 3;

for (int w = 0; w < len; w++)
{
for (int r = 0; r < len; r++)
{
  for (int tail = 0; tail < len; tail++)
     test(len, w, r, tail);
}
}

...

Does the error happen consistently with the above steps?
Always

Minimal reproducible code example:

#include <stdint.h>
#include <stdbool.h>

bool test(int len, int w, int r, int tail)
{
	bool same = w == r;
	bool ret;
	bool tailGtRead = tail > r;
	bool tailLtWrit = tail < w;

	if (w > r)
	{
		ret = tailGtRead && tailLtWrit;
	}
	else
	{
		// r <= w
		ret = tailGtRead || tailLtWrit;
	}

	return ret;
}

Crash/log attachments & additional info

  • crash dump file (much smaller if (g)-zipped)
  • whitebox-log.txt file

Any additional information/comments:

@1wsx10 1wsx10 added the - bug Something isn't working label Sep 22, 2023
@azmr
Copy link
Contributor

azmr commented Sep 22, 2023

Thanks for the report.
I've tried to repro (on Ubuntu 20.04), but I'm not sure if I'm seeing what you are.

I saw a 2 things that might be misinterpreted that I thought I'd clear up just in case:

  1. bar chart rescaled by a large "true" bool value (here 127 - visible from tooltip, but I'll make it visible on the bar as well). This makes true & false look ~the same...
    image
  2. the bar for values that are only ever true/false will be fully "on" as it is scaled to 1/range, i.e. 100% of the bar in this case.
    image

Also, uninitialized values are shown as empty (with desaturated text), which may look "falsy"

Let me know if these do/don't address what you saw, and if not, please could you post a screenshot.

@azmr azmr closed this as completed May 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
- bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants