Jump to page: 1 24  
Page
Thread overview
call traceback is indecipherable garbage
Jan 26, 2022
forkit
Jan 26, 2022
rikki cattermole
Jan 26, 2022
forkit
Jan 26, 2022
forkit
Jan 26, 2022
forkit
Jan 26, 2022
forkit
Jan 26, 2022
H. S. Teoh
Jan 26, 2022
forkit
Jan 26, 2022
H. S. Teoh
Jan 26, 2022
forkit
Jan 26, 2022
frame
Jan 26, 2022
WebFreak001
Jan 26, 2022
Dennis
Jan 26, 2022
forkit
Jan 26, 2022
zjh
Jan 26, 2022
forkit
Jan 26, 2022
rikki cattermole
Jan 26, 2022
H. S. Teoh
Jan 26, 2022
forkit
Jan 31, 2022
forkit
Jan 31, 2022
max haughton
Feb 04, 2022
kinke
Feb 04, 2022
forkit
Feb 04, 2022
forkit
Feb 04, 2022
forkit
Feb 04, 2022
H. S. Teoh
Jan 31, 2022
FeepingCreature
Jan 31, 2022
forkit
Jan 31, 2022
FeepingCreature
Jan 31, 2022
forkit
Feb 01, 2022
Siarhei Siamashka
Feb 01, 2022
bauss
Jan 27, 2022
deadalnix
January 26, 2022
has anyone ever considered getting rid of the indecipherable garbage after ----
(or having some compile time option to not output it?)

I don't want to see it.

I sure don't want my end-users to see it either.


/ --

module test;
import std;
void main()
{
    File f = File("nosuchfile");
}

// --

Exit code is: 1

std.exception.ErrnoException@std\stdio.d(545): Cannot open file `nosuchfile' in mode `rb' (No such file or directory)
----------------
0x000000013FB5F836
0x000000013FB53423
0x000000013FB51269
0x000000013FB51057
0x000000013FB5ECB3
0x000000013FB5EB2F
0x000000013FB5EC1B
0x000000013FB5EB2F
0x000000013FB5EA56
0x000000013FB53171
0x000000013FB51094
0x000000013FBD2F68
0x0000000076F9556D in BaseThreadInitThunk
0x00000000771F372D in RtlUserThreadStart

January 26, 2022
On 26/01/2022 3:20 PM, forkit wrote:
> std.exception.ErrnoException@std\stdio.d(545): Cannot open file `nosuchfile' in mode `rb' (No such file or directory)
> ----------------
> 0x000000013FB5F836
> 0x000000013FB53423
> 0x000000013FB51269
> 0x000000013FB51057
> 0x000000013FB5ECB3
> 0x000000013FB5EB2F
> 0x000000013FB5EC1B
> 0x000000013FB5EB2F
> 0x000000013FB5EA56
> 0x000000013FB53171
> 0x000000013FB51094
> 0x000000013FBD2F68
> 0x0000000076F9556D in BaseThreadInitThunk
> 0x00000000771F372D in RtlUserThreadStart

That's your call stack (addresses).

It doesn't have the function name/module because you haven't compiled it in.

If you don't want it, catch any exceptions that can be thrown.
January 26, 2022
On Wednesday, 26 January 2022 at 02:22:53 UTC, rikki cattermole wrote:
>
> That's your call stack (addresses).
>
> It doesn't have the function name/module because you haven't compiled it in.
>
> If you don't want it, catch any exceptions that can be thrown.

I'd rather have more options available to me:

e.g:

dmd -tracebackPrint=no myfile.d

January 25, 2022

On 1/25/22 9:27 PM, forkit wrote:

>

On Wednesday, 26 January 2022 at 02:22:53 UTC, rikki cattermole wrote:

>

That's your call stack (addresses).

It doesn't have the function name/module because you haven't compiled it in.

If you don't want it, catch any exceptions that can be thrown.

I'd rather have more options available to me:

e.g:

dmd -tracebackPrint=no myfile.d

Catching an exception and handling it directly is exactly how you do this. Dmd can't have all the options to write code for you.

-Steve

January 26, 2022
On Wednesday, 26 January 2022 at 02:22:53 UTC, rikki cattermole wrote:
>
> That's your call stack (addresses).
>
> It doesn't have the function name/module because you haven't compiled it in.
>
> If you don't want it, catch any exceptions that can be thrown.

Why could argue, that it's already been caught ;-)
January 26, 2022
On Wednesday, 26 January 2022 at 02:31:25 UTC, Steven Schveighoffer wrote:
>
> Catching an exception and handling it directly is exactly how you do this. Dmd can't have all the options to write code for you.
>
> -Steve

of course opening a non-existent file was an arbitrary example (and should be ignored).

The garbage being output is really the focus of my question.

At the very least, it should be removed in -release I think.

I'd be interested in knowing how many (and who) actually make use of the output under the ------ part.
January 25, 2022

On 1/25/22 9:40 PM, forkit wrote:

>

On Wednesday, 26 January 2022 at 02:31:25 UTC, Steven Schveighoffer wrote:

>

Catching an exception and handling it directly is exactly how you do this. Dmd can't have all the options to write code for you.

of course opening a non-existent file was an arbitrary example (and should be ignored).

The garbage being output is really the focus of my question.

At the very least, it should be removed in -release I think.

I'd be interested in knowing how many (and who) actually make use of the output under the ------ part.

If you compile with debug symbols, you get an actual stack trace. (even in -release mode)

Now, with proper spelunking tools, I'm sure you could figure out all the information from those addresses, but the runtime is printing everything it can about the stack trace, which isn't much.

-Steve

January 26, 2022
On Wednesday, 26 January 2022 at 02:27:52 UTC, forkit wrote:
>
> I'd rather have more options available to me:
>
> e.g:
>
> dmd -tracebackPrint=no myfile.d

or better yet, just make an addition to the already existing -debug=(option)

dmd -debug=stracktrace myfile.d

after all, a dump of stack trace is for 'debugging', and not something that one should see in -release.

How hard would that be I wonder?

btw. I just noticed a big difference in what ldc2 dumps, compared to what dmd dumps??

January 25, 2022
On Wed, Jan 26, 2022 at 02:20:17AM +0000, forkit via Digitalmars-d wrote: [...]
> std.exception.ErrnoException@std\stdio.d(545): Cannot open file `nosuchfile'
> in mode `rb' (No such file or directory)
> ----------------
> 0x000000013FB5F836
> 0x000000013FB53423
> 0x000000013FB51269
> 0x000000013FB51057
> 0x000000013FB5ECB3
> 0x000000013FB5EB2F
> 0x000000013FB5EC1B
> 0x000000013FB5EB2F
> 0x000000013FB5EA56
> 0x000000013FB53171
> 0x000000013FB51094
> 0x000000013FBD2F68
> 0x0000000076F9556D in BaseThreadInitThunk
> 0x00000000771F372D in RtlUserThreadStart

Did you compile with debugging symbols, i.e., with -g?

For example, given this code:

	void can() { throw new Exception("buahaha"); }
	void if_you() { can(); }
	void catch_me() { if_you(); }
	void can_you() { catch_me(); }
	void main() {
		can_you();
	}

Running with `dmd -run test.d` produces:

	object.Exception@/tmp/test.d(1): buahaha
	----------------
	??:? void test.can() [0x55c95255673b]
	??:? void test.if_you() [0x55c952556748]
	??:? void test.catch_me() [0x55c952556754]
	??:? void test.can_you() [0x55c952556760]
	??:? _Dmain [0x55c95255676c]

Not bad, but not very helpful. If there are some inner functions you might not get the function names either.

Running with `dmd -g -run test.d` produces:

	object.Exception@/tmp/test.d(1): buahaha
	----------------
	/tmp/test.d:1 void test.can() [0x55cff3e3773b]
	/tmp/test.d:2 void test.if_you() [0x55cff3e37748]
	/tmp/test.d:3 void test.catch_me() [0x55cff3e37754]
	/tmp/test.d:4 void test.can_you() [0x55cff3e37760]
	/tmp/test.d:6 _Dmain [0x55cff3e3776c]

Voila! Line numbers and source filenames!


T

-- 
Gone Chopin. Bach in a minuet.
January 25, 2022

On 1/25/22 9:20 PM, forkit wrote:

>

has anyone ever considered getting rid of the indecipherable garbage after ----
(or having some compile time option to not output it?)

I don't want to see it.

I sure don't want my end-users to see it either.

/ --

module test;
import std;
void main()
{
    File f = File("nosuchfile");
}

// --

Exit code is: 1

std.exception.ErrnoException@std\stdio.d(545): Cannot open file nosuchfile' in mode rb' (No such file or directory)

0x000000013FB5F836
0x000000013FB53423
0x000000013FB51269
0x000000013FB51057
0x000000013FB5ECB3
0x000000013FB5EB2F
0x000000013FB5EC1B
0x000000013FB5EB2F
0x000000013FB5EA56
0x000000013FB53171
0x000000013FB51094
0x000000013FBD2F68
0x0000000076F9556D in BaseThreadInitThunk
0x00000000771F372D in RtlUserThreadStart

Regardless of the "correct" way to deal with this, I agree with you that printing code addresses is not helpful. I'm assuming this is Windows? Is there nothing better that can be done?

-Steve

« First   ‹ Prev
1 2 3 4