Jump to page: 1 2
Thread overview
Bug in DMD?
Mar 02, 2023
ryuukk_
Mar 02, 2023
ryuukk_
Mar 02, 2023
ryuukk_
Mar 02, 2023
ryuukk_
Mar 02, 2023
H. S. Teoh
Mar 02, 2023
ryuukk_
Mar 03, 2023
Ali Çehreli
Mar 03, 2023
ryuukk_
Mar 03, 2023
Vladimir Panteleev
Mar 03, 2023
ryuukk_
Mar 03, 2023
Vladimir Panteleev
Mar 03, 2023
ryuukk_
Mar 03, 2023
ryuukk_
March 02, 2023

Hello,

I encountered a weird issue, my program segfault when i feed DMD with my files and static libs

It doesn't when i compile with LDC

If i split the compile/link in 2 different steps, then all works correctly

DMD (1step: ⛔): https://gist.github.com/ryuukk/f0ae2ae0c8980219c04d0c6d8678940d

LDC (1step: ✅): https://gist.github.com/ryuukk/4c7706697583431389d5e2074548f7c4

DMD (2step: ✅): https://gist.github.com/ryuukk/a0373339e590ecdae91e3f05b2d81bf4

Looks like DMD is messing things up when mixing code with static libraries?

Toolchains:

  • DMD32 D Compiler v2.102.1
  • LDC - the LLVM D compiler (1.32.0-beta1):
March 02, 2023

It crashes with a weird message, address doesn't match the mangled name:

C:\dev\kdom\projects\dawn\gl\glad\loader.d

inside: module dawn.gl.glad.loader;

screenshot

March 03, 2023
There isn't anything we can do without source.

But here is what I would do in this situation:

1. Look at the assembly at the point of debug break, from here it should give you hints as to why its trying to write to dawn.assets.Resource init array.
2. Dustmite, so we have something we can work with.
March 02, 2023
On Thursday, 2 March 2023 at 21:21:14 UTC, Richard (Rikki) Andrew Cattermole wrote:
> There isn't anything we can do without source.
>
> But here is what I would do in this situation:
>
> 1. Look at the assembly at the point of debug break, from here it should give you hints as to why its trying to write to dawn.assets.Resource init array.
> 2. Dustmite, so we have something we can work with.

I have no idea what does 1. mean, as for 2. do you have a link for a guide how to setup "dustmite"?
March 02, 2023
On Thursday, 2 March 2023 at 21:38:23 UTC, ryuukk_ wrote:
> On Thursday, 2 March 2023 at 21:21:14 UTC, Richard (Rikki) Andrew Cattermole wrote:
>> There isn't anything we can do without source.
>>
>> But here is what I would do in this situation:
>>
>> 1. Look at the assembly at the point of debug break, from here it should give you hints as to why its trying to write to dawn.assets.Resource init array.
>> 2. Dustmite, so we have something we can work with.
>
> I have no idea what does 1. mean, as for 2. do you have a link for a guide how to setup "dustmite"?

Better, can i send you a zip of my project? i'm not sure i'm willing to waste any more time trying to figure out what is wrong

That's is not something i like doing, it should just work, i shouldn't have to debug DMD, that aint my job
March 02, 2023
On Thu, Mar 02, 2023 at 09:55:55PM +0000, ryuukk_ via Digitalmars-d-learn wrote:
> On Thursday, 2 March 2023 at 21:38:23 UTC, ryuukk_ wrote:
> > On Thursday, 2 March 2023 at 21:21:14 UTC, Richard (Rikki) Andrew
> > Cattermole wrote:
[...]
> > > 2. Dustmite, so we have something we can work with.
> > 
> > [...] 2. do you have a link for a guide how to setup "dustmite"?

https://dlang.org/blog/2020/04/13/dustmite-the-general-purpose-data-reduction-tool/

Dustmite automatically reduces your code to a minimal example that still exhibits the same problem, good for bug reports that are easily reproducible.  Also useful if you don't want to publicly share the code for whatever reason, but still want to provide enough information so that the dmd devs can find the problem and fix it.


[...]
> That's is not something i like doing, it should just work, i shouldn't have to debug DMD, that aint my job

Dustmite can run in the background on a temporary copy of your code, you don't have to babysit it and can work on other things while it's doing its thing.


T

-- 
Written on the window of a clothing store: No shirt, no shoes, no service.
March 02, 2023
On Thursday, 2 March 2023 at 22:24:11 UTC, H. S. Teoh wrote:
> On Thu, Mar 02, 2023 at 09:55:55PM +0000, ryuukk_ via Digitalmars-d-learn wrote:
>> On Thursday, 2 March 2023 at 21:38:23 UTC, ryuukk_ wrote:
>> > On Thursday, 2 March 2023 at 21:21:14 UTC, Richard (Rikki) Andrew
>> > Cattermole wrote:
> [...]
>> > > 2. Dustmite, so we have something we can work with.
>> > 
>> > [...] 2. do you have a link for a guide how to setup "dustmite"?
>
> https://dlang.org/blog/2020/04/13/dustmite-the-general-purpose-data-reduction-tool/
>
> Dustmite automatically reduces your code to a minimal example that still exhibits the same problem, good for bug reports that are easily reproducible.  Also useful if you don't want to publicly share the code for whatever reason, but still want to provide enough information so that the dmd devs can find the problem and fix it.
>
>
> [...]
>> That's is not something i like doing, it should just work, i shouldn't have to debug DMD, that aint my job
>
> Dustmite can run in the background on a temporary copy of your code, you don't have to babysit it and can work on other things while it's doing its thing.
>
>
> T

the problem is not that it can run in the background, the problem is figuring out

1. how to install
2. how to setup
3. how to run

i was initially working on my game, i shouldn't have to take a 1 week break to debug dmd
March 02, 2023
On 3/2/23 15:34, ryuukk_ wrote:

> the problem is not that it can run in the background, the problem is
> figuring out
>
> 1. how to install
> 2. how to setup
> 3. how to run

I haven't used it myself but dustmite seems to be integrated into dub. 'dub dustmite <...>'

Ali

March 03, 2023
On 03/03/2023 12:34 PM, ryuukk_ wrote:
> 1. how to install

Already is.

Comes with dmd and ldc.

You can also just do ``$ dub run digger -- args``.

> 2. how to setup > 3. how to run

It is a bit of a pain but the basics is you need some sort of compilation command, list of sources and a test to confirm if it still fails.

https://github.com/CyberShadow/DustMite/wiki#how-to-use-it
March 03, 2023
On 03/03/2023 10:38 AM, ryuukk_ wrote:
> On Thursday, 2 March 2023 at 21:21:14 UTC, Richard (Rikki) Andrew Cattermole wrote:
>> There isn't anything we can do without source.
>>
>> But here is what I would do in this situation:
>>
>> 1. Look at the assembly at the point of debug break, from here it should give you hints as to why its trying to write to dawn.assets.Resource init array.
>> 2. Dustmite, so we have something we can work with.
> 
> I have no idea what does 1. mean, as for 2. do you have a link for a guide how to setup "dustmite"?

When debugging, native debuggers i.e. Visual Studio, will provide you with the disassembly of the function currently being executed. Between this and other entries in the call stack, you can generally figure out what the statement is being executed just by looking at things like call instructions. The symbols there will be accurate.
« First   ‹ Prev
1 2