DLL crashes with PB 6.11
DLL crashes with PB 6.11
Hello,
a DLL that is created and compiled with PureBasic 6.11 crashes when it is loaded into another program (e.g. with OpenLibrary in PureBasic). This problem applies to the 32bit native compiler only (64bit is completely ok, 32bit with C-backend is ok, too). It doesn't matter which version the main program is compiled with, it depends on the version the DLL was built with.
This was not the case with exactly the same code and PureBasic 6.01 (I didn't use and therefore haven't tested the versions inbetween).
Could somebody please look into this problem when there is time available for it?
Thank you very much, Jens-Arne
a DLL that is created and compiled with PureBasic 6.11 crashes when it is loaded into another program (e.g. with OpenLibrary in PureBasic). This problem applies to the 32bit native compiler only (64bit is completely ok, 32bit with C-backend is ok, too). It doesn't matter which version the main program is compiled with, it depends on the version the DLL was built with.
This was not the case with exactly the same code and PureBasic 6.01 (I didn't use and therefore haven't tested the versions inbetween).
Could somebody please look into this problem when there is time available for it?
Thank you very much, Jens-Arne
Last edited by Jens-Arne on Sun Aug 04, 2024 4:16 pm, edited 1 time in total.
Re: DLL crashes with PB 6.11
Just tested this on Windows 11 24H2 LTSC, and can confirm the behavior with PB 6.11 (32-bit), ASM compiler.
My test DLL was:
My test DLL was:
Code: Select all
ProcedureDLL Test()
ProcedureReturn 1
EndProcedure
Re: DLL crashes with PB 6.11
I tried but I can't reproduce the issue here (Windows 10), can anyone else confirm with x86-asm compiler ?
DLL code:
Main code:
DLL code:
Code: Select all
ProcedureDLL Test()
ProcedureReturn 25
EndProcedure
Code: Select all
OpenLibrary(0, "test2.dll")
Debug CallFunction(0, "Test")
Re: DLL crashes with PB 6.11
Hi,
I tested the code with PB 6.04 LTE (x86) on windows 11 (home).
Debug Output is 25.
So works here as expected.
I tested the code with PB 6.04 LTE (x86) on windows 11 (home).
Debug Output is 25.
So works here as expected.
Just because it worked doesn't mean it works.
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
PureBasic 6.04 (x86) and <latest stable version and current alpha/beta> (x64) on Windows 11 Home. Now started with Linux (VM: Ubuntu 22.04).
Re: DLL crashes with PB 6.11
The crash should be with 6.11 

Re: DLL crashes with PB 6.11
Work here with Windows 10 Pro
PB v6.11, v6.12b2, x86 and x64
Did you also compile the DLL with the x86 version?
PB v6.11, v6.12b2, x86 and x64
Did you also compile the DLL with the x86 version?
Code: Select all
CompilerIf #PB_Compiler_ExecutableFormat = #PB_Compiler_DLL
ProcedureDLL Test()
ProcedureReturn 25
EndProcedure
CompilerElse
Debug "Main"
If OpenLibrary(0, "TestDLL.dll")
r1 = CallFunction(0, "Test")
Debug "DLL Result = " + r1
CloseLibrary(0)
Else
Debug "Error open librariy"
EndIf
CompilerEndIf
My Projects ThreadToGUI / OOP-BaseClass / EventDesigner V3
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
PB v3.30 / v5.75 - OS Mac Mini OSX 10.xx - VM Window Pro / Linux Ubuntu
Downloads on my Webspace / OneDrive
Re: DLL crashes with PB 6.11
Work here with Windows 11 Professionnel version 23H2
PB 6.12b2, x86
PB 6.12b2, x86
A+
Denis
Denis
Re: DLL crashes with PB 6.11
Now this is really strange. I can't reproduce the error anymore (Windows 11). I did a Win11 update recently. Maybe it was down to some obscure error in Win11.
@Quin: How is the situation with your machine now?
@Quin: How is the situation with your machine now?
Last edited by Jens-Arne on Sat Aug 17, 2024 10:37 pm, edited 1 time in total.
Re: DLL crashes with PB 6.11
I ended up unexpectedly needing to get a new laptop, so I unfortunately don't have the exact machine I used to test. However, it seems to work here on this new laptop, PB 6.11 LTS (x86) and 6.12 B2 (x86).Jens-Arne wrote: Fri Aug 16, 2024 11:15 am Now this is really strage. I can't reproduce the error anymore (Windows 11). I did a Win11 update recently. Maybe it was down to some obscure error in Win11.
@Quin: How is the situation with your machine now?
Re: DLL crashes with PB 6.11
Even if it wasn't crashing, I changed the linker to use lld-link, so feel free to test if everything is still OK (dll size should be smaller).
Re: [Done] DLL crashes with PB 6.11
Sorry, this topic isn't done yet. I suggest to remove the [Done] tag.
New Windows 11 update, same old problem in a new fashion.
32bit-DLLs that are compiled with the assembler compiler don't load anymore. This time there's no crash, but the DLL simply won't load, the PB-Identifier returned using #pb_any will be 0.
Please use any simple DLL for testing such as the one Quin postet at the top of the thread.
This time PB V6.01 is affected as well. Very strange, I hope it won't be too much of an effort to dig into this.
x32 with C-backend is still ok, x64 is ok altogether.
Best regards, Jens-Arne
New Windows 11 update, same old problem in a new fashion.
32bit-DLLs that are compiled with the assembler compiler don't load anymore. This time there's no crash, but the DLL simply won't load, the PB-Identifier returned using #pb_any will be 0.
Please use any simple DLL for testing such as the one Quin postet at the top of the thread.
This time PB V6.01 is affected as well. Very strange, I hope it won't be too much of an effort to dig into this.
x32 with C-backend is still ok, x64 is ok altogether.
Best regards, Jens-Arne
Re: DLL crashes with PB 6.11
Ok, now it works once more. So I won't post this problem again until it shows up consistently, what hopefully will never happen.
Re: DLL crashes with PB 6.11
Moved to Windows forums so we can keep the topic alive