Re: std.format doesn't want to work

2021-10-17 Thread solidstate1991 via Digitalmars-d-learn

On Sunday, 17 October 2021 at 13:03:46 UTC, jfondren wrote:
then it's likely that some memory corruption prior to format() 
has broken the GC, and format's allocation of a string is 
what's failing. Try sprinkling `@safe` and and see what it 
complains about; try valgrind; try reducing your problem. I 
don't think we can help you more without a way to replicate the 
fault.


I ran Valgrind, and I've noticed some possible leakage in a 
library I've written, but I'll check for it further once I'll 
have a bit more time.


Re: std.format doesn't want to work

2021-10-17 Thread jfondren via Digitalmars-d-learn

On Sunday, 17 October 2021 at 12:53:07 UTC, solidstate1991 wrote:

On Sunday, 17 October 2021 at 05:22:17 UTC, russhy wrote:
On Saturday, 16 October 2021 at 22:47:09 UTC, solidstate1991 
wrote:

When I make this call
```
format(" %3.3f"w, avgFPS);
```
my program immediately crashes with an access violation 
error. The debugger out is different between x86 and x86-64.


I've made all sanity checks, so I need some other suggestions.


what is the type of avgFPS?


I's a double, but I've tried to pass it as real and float too, 
with the same exact error being generated.


then it's likely that some memory corruption prior to format() 
has broken the GC, and format's allocation of a string is what's 
failing. Try sprinkling `@safe` and and see what it complains 
about; try valgrind; try reducing your problem. I don't think we 
can help you more without a way to replicate the fault.


Re: std.format doesn't want to work

2021-10-17 Thread solidstate1991 via Digitalmars-d-learn

On Sunday, 17 October 2021 at 05:22:17 UTC, russhy wrote:
On Saturday, 16 October 2021 at 22:47:09 UTC, solidstate1991 
wrote:

When I make this call
```
format(" %3.3f"w, avgFPS);
```
my program immediately crashes with an access violation error. 
The debugger out is different between x86 and x86-64.


I've made all sanity checks, so I need some other suggestions.


what is the type of avgFPS?


I's a double, but I've tried to pass it as real and float too, 
with the same exact error being generated.


Re: std.format doesn't want to work

2021-10-16 Thread russhy via Digitalmars-d-learn
On Saturday, 16 October 2021 at 22:47:09 UTC, solidstate1991 
wrote:

When I make this call
```
format(" %3.3f"w, avgFPS);
```
my program immediately crashes with an access violation error. 
The debugger out is different between x86 and x86-64.


I've made all sanity checks, so I need some other suggestions.


what is the type of avgFPS?


Re: std.format doesn't want to work

2021-10-16 Thread frame via Digitalmars-d-learn
On Saturday, 16 October 2021 at 22:47:09 UTC, solidstate1991 
wrote:

When I make this call
```
format(" %3.3f"w, avgFPS);
```
my program immediately crashes with an access violation error. 
The debugger out is different between x86 and x86-64.


I've made all sanity checks, so I need some other suggestions.


I think it would be helpful to know what type avgFPS is and what 
you do with the output of format(). Access violation is mostly an 
access to a null pointer.