Opened 4 years ago
Closed 3 years ago
#6242 closed defect (fixed)
Modelica External C dependencies are not found on Windows
Reported by: | Niklas Worschech | Owned by: | Adrian Pop |
---|---|---|---|
Priority: | blocker | Milestone: | 1.19.0 |
Component: | Code Generation | Version: | v1.17.0-dev |
Keywords: | Modelica External C | Cc: | Simon.Leutz@…, Sven.Baetzing@…, fixed-term.Jonas.Plewinski@…, adeas31@… |
Description
For a Modelica External C model that is connected to a Windows C- dll, the simulation in OMEdit aborts with the error:
Process crashed Process crashed Simulation process failed. Exited with code -1073741515.
If you copy all dependencies (dll's and possibly other dependent objects like a database) into the corresponding working directory of OMEdit for the model, the simulation starts correctly.
Change History (13)
comment:1 by , 4 years ago
Cc: | added |
---|
follow-up: 4 comment:2 by , 4 years ago
It turns out -1073741515 = 309 - 230. Could it be that we are not using the right printf string because of some 32/64-bit int/long int crap?
The error codes are hex but printed as decimal :). This specific error is 0xC0000135 in hex. You can see the error codes here:
https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/596a1078-e883-4972-9bbc-49e60bebca55
This one is STATUS_DLL_NOT_FOUND
. We should have an accompanying error message with it.
As for the actual problem itself, I guess you had already discussed it with Adrian. If not I can take a look.
comment:3 by , 4 years ago
Yes, that is the error code for missing DLLs.
We need to add the LIBS directories to the PATH variable when we run the executables so that DLLs in the library resources can be found.
comment:4 by , 4 years ago
Replying to mahge930:
It turns out -1073741515 = 309 - 230. Could it be that we are not using the right printf string because of some 32/64-bit int/long int crap?
The error codes are hex but printed as decimal :). This specific error is 0xC0000135 in hex.
Aha. Could we print them as hex?
You can see the error codes here:
https://docs.microsoft.com/en-us/openspecs/windows_protocols/ms-erref/596a1078-e883-4972-9bbc-49e60bebca55
This one is
STATUS_DLL_NOT_FOUND
. We should have an accompanying error message with it.
I see, I had no idea these were Microsoft (actually NT) error codes, I thought they were OMC errors. So, you are indeed part of some arcane cabal. Now I am too :)
If possible, I'd recommend to print the error as hex and add some link or reference to that page.
follow-up: 6 comment:5 by , 4 years ago
Arcane cable :) Nop. All I knew was that it is a hex code. From then on it's google who did the job.
I don't think omc issues any special error codes ( apart from exit(1) ). I am also not sure where this exact printing is coming from. I will check and get back to you.
It would be nice if the ticket had a MWE. It will save some time. Otherwise we will figure it out eventually.
comment:6 by , 4 years ago
Replying to mahge930:
Arcane cable :) Nop. All I knew was that it is a hex code. From then on it's google who did the job.
Secret societies are no longer what they use to be. You can become a member just by googling stuff :)
I don't think omc issues any special error codes ( apart from exit(1) ). I am also not sure where this exact printing is coming from. I will check and get back to you.
If it is the OS, then never mind, blame Bill Gates for that.
It would be nice if the ticket had a MWE. It will save some time. Otherwise we will figure it out eventually.
I guess reproducing this thing is a non-trivial task, and may be difficult to reproduce on a different machine, depending on what's installed on it.
comment:7 by , 4 years ago
Milestone: | 1.16.1 → 1.17.0 |
---|
We couldn't fix this in the bugfix releases. I'm retargeting to 1.17.0
comment:8 by , 4 years ago
Milestone: | 1.17.0 → 1.18.0 |
---|
Retargeted to 1.18.0 because of 1.17.0 timed release.
comment:9 by , 4 years ago
Milestone: | 1.18.0 → 1.17.1 |
---|---|
Priority: | high → blocker |
comment:10 by , 4 years ago
Milestone: | 1.17.1 → 1.17.0 |
---|---|
Owner: | changed from | to
Priority: | blocker → high |
Status: | new → accepted |
comment:11 by , 4 years ago
Priority: | high → blocker |
---|
comment:12 by , 4 years ago
Milestone: | 1.17.0 → 1.17.1 |
---|
comment:13 by , 3 years ago
Milestone: | 1.17.1 → 1.19.0 |
---|---|
Resolution: | → fixed |
Status: | accepted → closed |
Fixed by mahge:
https://github.com/OpenModelica/OpenModelica/issues/6242
@adrpo, @mahge930, incidentally "Exited code -1073741515" makes absolutely no sense, and is kind of irritating. It looks like it wants to convey some kind of information, which is only accessible to the members of some arcane cabal that understands negative error codes with 10 digits. Modelica is arcane enough, we don't really need that :)
It turns out -1073741515 = 309 - 230. Could it be that we are not using the right
printf
string because of some 32/64-bit int/long int crap?Also, it would be nice if we had a list of runtime exit codes somewhere, do we? If we do, I'd suggest to put it in the user's guide and add a URL link to that in the error message. Otherwise we should rather not give that message at all.
What do you think?