Bug 135138 - Using CLI assemblies result in Invalid IL code in uno.util.Bootstrap:bootstrap
Summary: Using CLI assemblies result in Invalid IL code in uno.util.Bootstrap:bootstrap
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: sdk (show other bugs)
Version:
(earliest affected)
6.4.5.2 release
Hardware: x86-64 (AMD64) macOS (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2020-07-26 06:23 UTC by Peter Hagen
Modified: 2025-11-27 11:27 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Peter Hagen 2020-07-26 06:23:57 UTC
Description:
When attempting to run a .Net/C# solution on MacOS (with Rider), running with Mono (.Net 4.8), with the cli assemblies, the follow exception occurs:

```
Invalid IL code in uno.util.Bootstrap:bootstrap (): IL_0036: calli     0x11000001
```

As far as I can tell, the cli assemblies are .Net 1.0/1.1, which is quite old. Its unclear to my how these assemblies are created, as a part of .cs files are in the source. I guess the rest is build from C code?

It would be very interesting to migrate the cli code to .NetStandard 2.0, so the code could be used in a more up-to-date environment, like Asp.Net Core for example. 


Steps to Reproduce:
1. Create new CS console or unit test project
2. Add all assemblies to the project
3. Debug a class with "XComponentContext localContext = uno.util.Bootstrap.bootstrap();" in it

Actual Results:
The following exception occurs:

Invalid IL code in uno.util.Bootstrap:bootstrap (): IL_0036: calli     0x11000001


Expected Results:
An XComponentContext object would be returned


Reproducible: Always


User Profile Reset: No



Additional Info:
Create an Uno connection to a headless Libreoffice instance
Comment 1 Xisco Faulí 2021-11-23 10:47:51 UTC
Hello Peter,
Could you please try to reproduce it with the latest version of LibreOffice from https://www.libreoffice.org/download/libreoffice-fresh/ ?
I have set the bug's status to 'NEEDINFO'. Please change it back to 'UNCONFIRMED' if the bug is still present in the latest version.
Comment 2 QA Administrators 2022-05-24 03:34:04 UTC Comment hidden (obsolete)
Comment 3 Peter Hagen 2022-05-25 15:30:13 UTC
I installed the latest SDK in Windows (sorry, I'm using a Mac), and then copied the dll's from the GAC to my Mac. There with Rider I made a little project containing the DLL's and part of the sample code. It builds, but it doesn't run:

/Users/peter/Downloads/LBNet/bin/Debug/net6.0/LBNet
Sample caught exception! System.BadImageFormatException: Could not load file or assembly 'cli_cppuhelper, Version=1.0.23.0, Culture=neutral, PublicKeyToken=ce2cb7e279207b9e'. An attempt was made to load a program with an incorrect format.

File name: 'cli_cppuhelper, Version=1.0.23.0, Culture=neutral, PublicKeyToken=ce2cb7e279207b9e'
   at SpreadsheetDocHelper.connect(String[] args)
   at SpreadsheetDocHelper..ctor(String[] args) in /Users/peter/Downloads/LBNet/Program.cs:line 272
   at GeneralTableSample..ctor(String[] args) in /Users/peter/Downloads/LBNet/Program.cs:line 51
   at GeneralTableSample.Main(String[] args) in /Users/peter/Downloads/LBNet/Program.cs:line 36

Process finished with exit code 0.

Looking at cli_cppuhelper, it references kernel32.dll. I guess there is some pinvoke in that dll? 

Well, at least its not a .netstandard DLL, but .Net 6 can load these on any platform. It would be great if these would be .NetStandard, and preferable available as nuget packages.
Comment 4 Peter Hagen 2022-07-21 07:18:44 UTC
If you can point me where the C# code and/or the project files can be found, I could attempt to assist with this issue
Comment 5 QA Administrators 2025-11-27 11:27:33 UTC
Dear Peter Hagen,

To make sure we're focusing on the bugs that affect our users today, LibreOffice QA is asking bug reporters and confirmers to retest open, confirmed bugs which have not been touched for over a year.

There have been thousands of bug fixes and commits since anyone checked on this bug report. During that time, it's possible that the bug has been fixed, or the details of the problem have changed. We'd really appreciate your help in getting confirmation that the bug is still present.

If you have time, please do the following:

Test to see if the bug is still present with the latest version of LibreOffice from https://www.libreoffice.org/download/

If the bug is present, please leave a comment that includes the information from Help - About LibreOffice.
 
If the bug is NOT present, please set the bug's Status field to RESOLVED-WORKSFORME and leave a comment that includes the information from Help - About LibreOffice.

Please DO NOT

Update the version field
Reply via email (please reply directly on the bug tracker)
Set the bug's Status field to RESOLVED - FIXED (this status has a particular meaning that is not 
appropriate in this case)


If you want to do more to help you can test to see if your issue is a REGRESSION. To do so:
1. Download and install oldest version of LibreOffice (usually 3.3 unless your bug pertains to a feature added after 3.3) from https://downloadarchive.documentfoundation.org/libreoffice/old/

2. Test your bug
3. Leave a comment with your results.
4a. If the bug was present with 3.3 - set version to 'inherited from OOo';
4b. If the bug was not present in 3.3 - add 'regression' to keyword


Feel free to come ask questions or to say hello in our QA chat: https://web.libera.chat/?settings=#libreoffice-qa

Thank you for helping us make LibreOffice even better for everyone!

Warm Regards,
QA Team

MassPing-UntouchedBug