Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Exe wont start (Fiddle::DLError) Windows 11 Notebook #48

Closed
Delikt opened this issue Jan 19, 2022 · 14 comments
Closed

Exe wont start (Fiddle::DLError) Windows 11 Notebook #48

Delikt opened this issue Jan 19, 2022 · 14 comments

Comments

@Delikt
Copy link

Delikt commented Jan 19, 2022

I build an Exe using ocra for my Application

upgraded from Libui 0.0.12 to 0.0.13 (same issue)

I can start my Application without Problems on any Win 10 PC but on a single Windows 11 (upgraded Notebook from 10) i got this Error:

C:/Users/Manuel/AppData/Local/Temp/ocr15B2.tmp/lib/ruby/3.0.0/fiddle.rb:61:in `initialize': No such file or directory (Fiddle::DLError)
        from C:/Users/Manuel/AppData/Local/Temp/ocr15B2.tmp/lib/ruby/3.0.0/fiddle.rb:61:in `new'
        from C:/Users/Manuel/AppData/Local/Temp/ocr15B2.tmp/lib/ruby/3.0.0/fiddle.rb:61:in `dlopen'
        from C:/Users/Manuel/AppData/Local/Temp/ocr15B2.tmp/lib/ruby/3.0.0/fiddle/import.rb:86:in `block in dlload'
        from C:/Users/Manuel/AppData/Local/Temp/ocr15B2.tmp/lib/ruby/3.0.0/fiddle/import.rb:77:in `collect'
        from C:/Users/Manuel/AppData/Local/Temp/ocr15B2.tmp/lib/ruby/3.0.0/fiddle/import.rb:77:in `dlload'
        from C:/Users/Manuel/AppData/Local/Temp/ocr15B2.tmp/lib/ruby/gems/3.0.0/gems/libui-0.0.12/lib/libui/ffi.rb:12:in `<module:FFI>'
        from C:/Users/Manuel/AppData/Local/Temp/ocr15B2.tmp/lib/ruby/gems/3.0.0/gems/libui-0.0.12/lib/libui/ffi.rb:7:in `<module:LibUI>'
        from C:/Users/Manuel/AppData/Local/Temp/ocr15B2.tmp/lib/ruby/gems/3.0.0/gems/libui-0.0.12/lib/libui/ffi.rb:6:in `<top (required)>'
        from C:/Users/Manuel/AppData/Local/Temp/ocr15B2.tmp/lib/ruby/gems/3.0.0/gems/libui-0.0.12/lib/libui.rb:21:in `require_relative'
        from C:/Users/Manuel/AppData/Local/Temp/ocr15B2.tmp/lib/ruby/gems/3.0.0/gems/libui-0.0.12/lib/libui.rb:21:in `<module:LibUI>'
        from C:/Users/Manuel/AppData/Local/Temp/ocr15B2.tmp/lib/ruby/gems/3.0.0/gems/libui-0.0.12/lib/libui.rb:6:in `<top (required)>'
        from <internal:C:/Users/Manuel/AppData/Local/Temp/ocr15B2.tmp/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from <internal:C:/Users/Manuel/AppData/Local/Temp/ocr15B2.tmp/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from C:/Users/Manuel/AppData/Local/Temp/ocr15B2.tmp/lib/ruby/gems/3.0.0/gems/glimmer-dsl-libui-0.2.23/lib/glimmer-dsl-libui.rb:33:in `<top (required)>'
        from <internal:C:/Users/Manuel/AppData/Local/Temp/ocr15B2.tmp/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in `require'
        from <internal:C:/Users/Manuel/AppData/Local/Temp/ocr15B2.tmp/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:160:in `rescue in require'
        from <internal:C:/Users/Manuel/AppData/Local/Temp/ocr15B2.tmp/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:149:in `require'
        from C:/Users/Manuel/AppData/Local/Temp/ocr15B2.tmp/src/lucsi.rb:3:in `<main>'
<internal:C:/Users/Manuel/AppData/Local/Temp/ocr15B2.tmp/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require': cannot load such file -- glimmer-dsl-libui (LoadError)
        from <internal:C:/Users/Manuel/AppData/Local/Temp/ocr15B2.tmp/lib/ruby/3.0.0/rubygems/core_ext/kernel_require.rb>:85:in `require'
        from C:/Users/Manuel/AppData/Local/Temp/ocr15B2.tmp/src/lucsi.rb:3:in `<main>'

I need to say on another Win 11 Notebook (Preinstalled) the Application run also without Problems.

Any Idea what i should do or check? Please tell me whatever further information you need, if you have a idea. Thanks

@kojix2
Copy link
Owner

kojix2 commented Jan 19, 2022

Hi Delikt.
Thanks for the interesting report.

The most common cause of this error is that you are using a 32bit version of Ruby. This can be confirmed by typing 1.size == 8 # true if 64bit ruby in irb.
#15

The second most common cause would be that Windows does not have some dependent library installed. We have not actually observed this situation and it is not completely understood, but it is believed to be the case.
#32

Finally, it is possible that the problem is due to differences in CPU architecture. It has been recently reported that LibUI does not work on Macs with newer CPUs.
#47

Nowadays it is rare to install 32-bit Ruby. If LibUI was running on the same computer before, I don't think the CPU is the cause. So I think it is the second case, but this is not fully understood.

@Delikt
Copy link
Author

Delikt commented Jan 20, 2022

Thank you for your quick support kojix!

i tryed to evaluate the X.bit Version of my Ruby installation and i'm a bit confused cause:
grafik

i have the x64 Version Installed of Ruby but 1.size == 8 => false

in case of the second possible Answere, i think i need to wait the progress of information Gathering

for the third case: The upgraded Notebook (From Win10 to Win11) is an older CPU (6th generation Intel Core i5 - Model Inspiron 5759 from Dell). I tested it on modern PC's with Intel i5 from 8 to 10th Generation without Problems.

@kojix2
Copy link
Owner

kojix2 commented Jan 24, 2022

It's strange that 1.size is not 8. Please tell me the result of 1.size ?

Document-method: Integer#size
Returns the number of bytes in the machine representation of int (machine depende
https://docs.ruby-lang.org/en/3.1/Integer.html#method-i-size

@Delikt
Copy link
Author

Delikt commented Jan 24, 2022

1.size is 4

so its a 32bit irb Console? O.o

@Delikt Delikt closed this as completed Jan 24, 2022
@Delikt Delikt reopened this Jan 24, 2022
@Delikt
Copy link
Author

Delikt commented Jan 24, 2022

Ok, again on another Win10 PC i got the same Error - i tryed to build the exe with ocra incl. the Parameter "--debug-extract" to check if something missing on the PC's where i get the Error but:

grafik

i also saw the two PC's where my App didnt start both are i5 from the 6th Gen. Another 6th Gen. work on the other side... Not sure this can help

@Delikt
Copy link
Author

Delikt commented Jan 24, 2022

I checked the depending dlls for LibUI located in Windows\System32 Folder on the not working Win 11 Notebook, all Dependencies listet below are installed.

List of Dependencies from Issue #32:

$ objdump -p vendor/libui.dll | grep -i dll
vendor/libui.dll:     ファイル形式 pei-x86-64
    DLL
DllCharacteristics    00000160
 vma:            Hint    Time      Forward  DLL       First
    DLL Name: USER32.dll
    DLL Name: KERNEL32.dll
    DLL Name: GDI32.dll
    DLL Name: UxTheme.dll
    DLL Name: d2d1.dll
    DLL Name: DWrite.dll
    DLL Name: ole32.dll
    DLL Name: MSVCP140.dll
    DLL Name: VCRUNTIME140.dll
    DLL Name: api-ms-win-crt-math-l1-1-0.dll
    DLL Name: api-ms-win-crt-runtime-l1-1-0.dll
    40142       63  _seh_filter_dll
    DLL Name: api-ms-win-crt-convert-l1-1-0.dll
    DLL Name: api-ms-win-crt-stdio-l1-1-0.dll
    DLL Name: api-ms-win-crt-string-l1-1-0.dll
    DLL Name: api-ms-win-crt-utility-l1-1-0.dll
    DLL Name: api-ms-win-crt-heap-l1-1-0.dll
名前                 000000000003ca0e libui.dll

@Delikt
Copy link
Author

Delikt commented Jan 24, 2022

i also tryed to install Net Framework 3.5 Sp1 like #32 (comment) wrote as hint on the Win 11 Notebook. But this didnt Changed anything - same Error.

@kojix2
Copy link
Owner

kojix2 commented Jan 24, 2022

Thanks @Delikt

For the first case, I think that the 32bit Ruby installed before is still there and it is running. However, the screenshot does indeed look like a 64-bit version of Ruby. I don't know much about Windows, so there might be a case that 1.size becomes 4 even if you have a 64bit version of Ruby. In that case, please let me know again.

For the Win10 case, could you please check if the official andlabs/libui release works?

Download the following two files from here

  • examples-alpha4.1-windows-amd64-shared.zip
  • libui-alpha4.1-windows-amd64-shared.zip

Unzip the file, copy libui.dll to the example directory,

image

And start controlgallery.exe.

image

If this does not work, it means that Ruby's LibUI also does not work because it calls the same binary file libui.dll in the gem.

@Delikt
Copy link
Author

Delikt commented Jan 25, 2022

i got 2 Errors on the not working Win 11 Notebook:

in short: "Can't execute the Code, MSVCP140.dll and VCRUNTIME140.dll not found

grafik

grafik

On a PC without start Problems, these Example.exe from #48 (comment) works fine

But these .dll's are in the Windows\system32 Folder! Should i include these Files and point to them in another way?
grafik

grafik

@Delikt
Copy link
Author

Delikt commented Jan 25, 2022

On a PC where my Application works are many more MSVCP140.dll's and VCRUNTIME140.dll's in the system32 Subdirectorys:

grafik

grafik

VCRUNTIME140.dll found in:

"C:\Windows\System32\DriverStore\FileRepository\hpcustomcapcomp.inf_amd64_e8b8e47062b80a1f\x64\vcruntime140.dll"
"C:\Windows\System32\DriverStore\FileRepository\hpanalyticscomp.inf_amd64_44633d75967bb427\x64\x64\vcruntime140.dll"
"C:\Windows\System32\DriverStore\FileRepository\hpcustomcapcomp.inf_amd64_e7c70af561d56e55\x64\vcruntime140.dll"
"C:\Windows\System32\DriverStore\FileRepository\hpanalyticscomp.inf_amd64_373bc30bd578f192\x64\x64\vcruntime140.dll"
"C:\Windows\System32\DriverStore\FileRepository\iclsclient.inf_amd64_76523213b78d9046\lib\vcruntime140.dll"
"C:\Windows\System32\vcruntime140.dll"
"C:\Windows\System32\DriverStore\FileRepository\iclsclient.inf_amd64_75ffca5eec865b4b\lib\vcruntime140.dll"

MSVCP140.dll found in:

"C:\Windows\System32\DriverStore\FileRepository\hpcustomcapcomp.inf_amd64_e8b8e47062b80a1f\x64\msvcp140.dll"
"C:\Windows\System32\DriverStore\FileRepository\hpanalyticscomp.inf_amd64_44633d75967bb427\x64\x64\msvcp140.dll"
"C:\Windows\System32\DriverStore\FileRepository\hpcustomcapcomp.inf_amd64_e7c70af561d56e55\x64\msvcp140.dll"
"C:\Windows\System32\DriverStore\FileRepository\iclsclient.inf_amd64_76523213b78d9046\lib\msvcp140.dll"
"C:\Windows\System32\DriverStore\FileRepository\hpanalyticscomp.inf_amd64_373bc30bd578f192\x64\x64\msvcp140.dll"
"C:\Windows\System32\msvcp140.dll"
"C:\Windows\System32\DriverStore\FileRepository\iclsclient.inf_amd64_75ffca5eec865b4b\lib\msvcp140.dll"

Meanwhile i tryed to add "C:\Windows\System32\msvcp140.dll" and "C:\Windows\System32\vcruntime140.dll" manually to compile with ocra. - Without success... (I copy the two dlls to RUBYInstalldir\bin and use the --dll Parameter with ocra)

Also i tryed simple copy and transfer the two dll's to not working PC's C:\Windows\System32\ Folder-> after reboot, it still not working, same Error

@kojix2
Copy link
Owner

kojix2 commented Jan 25, 2022

ping @kou, I'm sorry to bother you, but today is Red Data Tools's Day.

I understand that you are not using Windows, but do you know anything about this kind of problem?
Also, do you have any recommendations on how we can investigate this further?

@kou
Copy link

kou commented Jan 26, 2022

vcruntime140.dll and msvcp140.dll don't exist in c:\Windows\system32 on the problem PC.
(They exist in "sub folders" in c:\Windows\system32.)

Could you try installing "Microsoft Visual C++ 2015 Redistributable Update 3" from https://visualstudio.microsoft.com/vs/older-downloads/ on the problem PC.
(You need to expand "Other Tools, Frameworks, and Redistributables".)

@Delikt
Copy link
Author

Delikt commented Jan 26, 2022

IT WORK!

For the example.exe it was just necessary to copy the missing dll's in the same Folder where the example.exe is located:

grafik

But for my Application this was not the solution - i got the same Error

To install "Microsoft Visual C++ 2015 Redistributable Update 3" was also not the solution but almost.

SOLUTION:
I installed the latestVersion of the MS Redistributable Package (2015-2022)
https://docs.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist?view=msvc-170

https://aka.ms/vs/17/release/vc_redist.x64.exe

and after that my App starting and work!

Thank you very much kojix2 and kou !

@kojix2
Copy link
Owner

kojix2 commented Jan 28, 2022

As always, thank you very much, @kou.

I have heard before that it is difficult for Fiddle to detect a missing DLL.
Even if Fiddle can't raise an exception, it would be nice if Windows could raise some kind of error message!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants