January 30, 2021
On Friday, 29 January 2021 at 15:34:49 UTC, H. S. Teoh wrote:
> On Fri, Jan 29, 2021 at 12:45:02PM +0000, Imperatorn via Digitalmars-d-learn wrote:
>> On Wednesday, 27 January 2021 at 15:25:17 UTC, H. S. Teoh wrote:
>> > On Wed, Jan 27, 2021 at 02:39:08PM +0000, Adam D. Ruppe via Digitalmars-d-learn wrote:
>> > > [...]
>> > 
>> > I'm surprised this stuff hasn't been fixed yet, considering Walter (mostly?) works on Windows. Has he never run into these issues before?
> [...]
>> Anyone knows what it would take to fix it?
>
> Somebody who (1) knows enough of compiler internals to be able to fix
> this, (2) is intimately familiar with how Windows dlls work, (3) is
> desperate enough to do the work himself instead of waiting for someone
> else to do it, and (4) is stubborn enough to push it through in spite of
> any resistance.
>
>
> T

Who would that special someone be? 🤔
January 30, 2021
On Friday, 29 January 2021 at 01:23:20 UTC, Siemargl wrote:
> On Friday, 29 January 2021 at 00:45:12 UTC, Siemargl wrote:
>
>>> Then i modify program, just removing DLL, copying TestFun() in main module and it runs.
>>> Same compiler -m64 target.
>>
>> Ups. Sorry, I just forget copy test_dll.dll inside VM :-)
>>
>> So, program runs in Win7, but hangs after printing i:64511
>
> I downgrade DMD to 2.090.1 + MSVC2013 libs and problem disappears.
>
> But 2.092 + MSVC2013 libs also hangs. Not every time, but
.
Thank you, Siemargl! It's just the same behaviour that I got.
The same number 64511. If you change double[int] to double[],
the number would be around ~520.000, if int[] then ~1.000.000.
I make conclusion that there is something concerning memory limit of 4 Mb.
January 30, 2021
On Saturday, 30 January 2021 at 19:52:09 UTC, Vitalii wrote:
> On Friday, 29 January 2021 at 01:23:20 UTC, Siemargl wrote:
>> On Friday, 29 January 2021 at 00:45:12 UTC, Siemargl wrote:
>>
>>>> Then i modify program, just removing DLL, copying TestFun() in main module and it runs.
>>>> Same compiler -m64 target.
>>>
>>> Ups. Sorry, I just forget copy test_dll.dll inside VM :-)
>>>
>>> So, program runs in Win7, but hangs after printing i:64511
>>
>> I downgrade DMD to 2.090.1 + MSVC2013 libs and problem disappears.
>>
>> But 2.092 + MSVC2013 libs also hangs. Not every time, but
> .
> Thank you, Siemargl! It's just the same behaviour that I got.
> The same number 64511. If you change double[int] to double[],
> the number would be around ~520.000, if int[] then ~1.000.000.
> I make conclusion that there is something concerning memory limit of 4 Mb.

No, this is a deadlock in memory manager.

To find roots of problem, needed a debug version of druntime, but i were unsuccesfull to compile it.
February 06, 2021
On Saturday, 30 January 2021 at 20:32:36 UTC, Siemargl wrote:
> No, this is a deadlock in memory manager.
>
> To find roots of problem, needed a debug version of druntime, but i were unsuccesfull to compile it.

I make debug vesion of druntime and catch nicer stacktrace. Maybe this can help somebody knowing GC internals


ntdll!ZwWaitForSingleObject+0xa
ntdll!RtlDeNormalizeProcessParams+0x5a8
ntdll!RtlDeNormalizeProcessParams+0x4a4
ntdll!RtlInitializeCriticalSectionEx+0x3b9
KERNELBASE!HeapDestroy+0x3a
KERNELBASE!GetModuleHandleExW+0x39
test_dll!D4core6thread8osthread23ll_startDLLUnloadThreadFNbNiZb+0x86
test_dll!D4core6thread8osthread20createLowLevelThreadFNbNiDFNbZvkDFNbZvZk+0x153
test_dll!D2gc4impl12conservativeQw3Gcx16startScanThreadsMFNbZv+0xc5
test_dll!D2gc4impl12conservativeQw3Gcx11fullcollectMFNbbZm+0x12f
test_dll!D2gc4impl12conservativeQw3Gcx10smallAllocMFNbmKmkxC8TypeInfoZPv+0x135
test_dll!D2gc4impl12conservativeQw14ConservativeGC__T9runLockedS_DQCeQCeQCcQCnQBs12mallocNoSyncMFNbmkKmxC8TypeInfoZPvS_DQEgQEgQEeQEp10mallocTimelS_DQFiQFiQFgQFr10numMallocslTmTkTmTxQCzZQFcMFNbKmKkKmKxQDsZQDl+0xa1
test_dll!D2gc4impl12conservativeQw14ConservativeGC6mallocMFNbmkxC8TypeInfoZPv+0x4b
test_dll!gc_malloc+0x2d
test_dll!aaGetX+0x2ca
test_dll!aaGetY+0x39
test_dll!test_dll.TestFun+0x93
test_dll_exe!D main+0x111
test_dll_exe!D2rt6dmain212_d_run_main2UAAamPUQgZiZ6runAllMFZ9__lambda1MFZv+0x33
test_dll_exe!D2rt6dmain212_d_run_main2UAAamPUQgZiZ7tryExecMFMDFZvZv+0x3c

February 06, 2021
On Saturday, 6 February 2021 at 10:44:08 UTC, Siemargl wrote:
> On Saturday, 30 January 2021 at 20:32:36 UTC, Siemargl wrote:
>> No, this is a deadlock in memory manager.
>>
>> To find roots of problem, needed a debug version of druntime, but i were unsuccesfull to compile it.
>
> I make debug vesion of druntime and catch nicer stacktrace. Maybe this can help somebody knowing GC internals
....

So it seems, that disabling parallel GC, solves problem.

I add in BOTH dll and main module and cant reproduce freeze anymore

extern(C) __gshared string[] rt_options = [ "gcopt=parallel:0" ];
February 13, 2021
On Saturday, 6 February 2021 at 15:21:17 UTC, Siemargl wrote:
>
> extern(C) __gshared string[] rt_options = [ "gcopt=parallel:0" ];

LDC 1.24 is also affected and rt_options helps
1 2 3 4
Next ›   Last »