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

Add Linux support via Wine #42

Closed
phoe opened this issue Dec 30, 2018 · 34 comments
Closed

Add Linux support via Wine #42

phoe opened this issue Dec 30, 2018 · 34 comments

Comments

@phoe
Copy link

phoe commented Dec 30, 2018

Corman Lisp is currently not executable via Wine; for some reaso, it complains that CormanLisp.exe is a DOS application.

$ wine --version
wine-3.13 (Staging)
$ wine CormanLisp.exe 
000b:fixme:winediag:start_process Wine Staging 3.13 is a testing version containing experimental patches.
000b:fixme:winediag:start_process Please mention your exact version when filing bug reports on winehq.org.
winevdm: C:\Program Files\Corman Lisp\CormanLisp.exe is a DOS application, you need to install DOSBox.
@arbv
Copy link
Member

arbv commented Dec 30, 2018

I may check it but do not hold your breath right now. I believe that Wine is the thing which needs fixing.
Corman Lisp runs on every Windows version starting from Windows XP SP3.

Nevertheless, Linux support would be good.

Can you test it on a stable version of Wine?

@phoe
Copy link
Author

phoe commented Dec 30, 2018

I do not have a stable Wine version on this machine and I have a poor Internet connection at the moment, so downloading a stable version isn't possible for me at the moment.

@phoe
Copy link
Author

phoe commented Dec 30, 2018

Just to double-check - could you see if the files I have extracted from the MSI archive are correct? The license files seem to have random null bytes scattered across them, which makes me think there is some corruption going on.

$ md5sum CormanLisp.exe clbootapp.exe clboot.exe clconsoleapp.exe clconsole.exe 
a3cdf99e1ba99acb8a9661299cc4bcca  CormanLisp.exe
14a3a36ab3bdf6b3546feb4451c8236e  clbootapp.exe
9847fb76470d9c59011568b55d933a47  clboot.exe
3746318cadeae7fd2f91e9281466b6d1  clconsoleapp.exe
e406b7b0f049772d0e4b72994f61729f  clconsole.exe

corman.zip

@arbv
Copy link
Member

arbv commented Dec 30, 2018

@phoe

Yes, it is broken. Can you test the attached version? It is the Corman Lisp 3.1 unpacked.

@phoe
Copy link
Author

phoe commented Dec 30, 2018

I do not see any attachment.

@arbv
Copy link
Member

arbv commented Dec 30, 2018

@phoe

Oops! Github does not want to attach the archive.

I have uploaded the archive to a site which I run from home.

deleted URL

@arbv
Copy link
Member

arbv commented Dec 30, 2018

@phoe

It seems that an archive with valid executable files makes Github unhappy (and for a reason).

@phoe
Copy link
Author

phoe commented Dec 30, 2018

The Corman CL IDE launches, but I am promptly met with a segfault.

wine: Unhandled page fault on read access to 0x00000020 at address 0x413c6e (thread 0009),

clconsole.exe launches in console mode and I am able to define a function and run it.

@phoe
Copy link
Author

phoe commented Dec 30, 2018

The issue happens after I type (+ 2 into the buffer.

Attaching the Wine backtrace. It seems to contain symbols from the binary.

backtrace.txt

@arbv
Copy link
Member

arbv commented Dec 30, 2018

@phoe

Thank you.

I might look at it later. If it is a low hanging fruit then I might try to fix it. But please keep in mind that Corman Lisp relies on intricate details about Windows functioning which Wine may have not implemented.

@phoe
Copy link
Author

phoe commented Dec 30, 2018

Another issue: if I want for a while (two or three seconds), the IDE tells me that a dump file was generated due to a stack overflow. Attaching it here.

CormanLisp_Dump.log.zip


No problem - I'm a Linux user and my main interest in Corman Common Lisp is running it via Wine.

Now that I think of it, if what you say is true, then Corman Common Lisp could be useful for Wine people as an application pushing the usage of Windows details to the extreme - and therefore, a useful testing artifact.

@arbv
Copy link
Member

arbv commented Dec 30, 2018

@phoe

I am not sure about the extreme but it still might be interesting for them. It might be the case that there is a bug in Corman Lisp which is just easier to reproduce under Wine.

@arbv
Copy link
Member

arbv commented Dec 30, 2018

@phoe

If you are at it, may I ask you to abuse clconsole.exe? Is it stable enough for you?

BTW, try to disable colorisation in the IDE settings. Does it make IDE more stable?

Right now it looks like hell (e.g. FFI issue).

@phoe
Copy link
Author

phoe commented Dec 30, 2018

I will abuse clconsole in a moment.

I cannot get to the settings menu - as soon as I mouseover the menu region, the application generates crash dumps.

@arbv
Copy link
Member

arbv commented Dec 30, 2018

@phoe

In particular, try to crash it using (gc) call.

@phoe
Copy link
Author

phoe commented Dec 30, 2018

I just lost a game of Othello against Corman Common Lisp. :(

zrzut ekranu z 2018-12-30 19-40-46

(loop repeat 1000 do (gc)) takes a while, then returns. It does not seem to crash.

@phoe
Copy link
Author

phoe commented Dec 30, 2018

Seems like the REPL itself works fine. It's the IDE that crashes for me.

@arbv
Copy link
Member

arbv commented Dec 30, 2018

@phoe
I feel your pain. I haven't won Othello even once :'-(.

On the bright side - the fact that it didn't crash is a good sign.

May I ask you to run examples\gui\shapes.lisp and examples\minesweepers.lisp for a while? They use FFI more intensively.

@phoe
Copy link
Author

phoe commented Dec 30, 2018

zrzut ekranu z 2018-12-30 23-33-08

zrzut ekranu z 2018-12-30 23-35-07

I guess that is good. Both seem to be working, though shapes.lisp should have a seizure warning.

@arbv
Copy link
Member

arbv commented Dec 30, 2018

@phoe

Thank you for your investigation! It turned out to be very interesting. So far it seems that the Lisp kernel works well, but the IDE needs some fixes. It increases the chances for Corman Lisp to be Wine compatible at some point.

@arbv
Copy link
Member

arbv commented Dec 30, 2018

@phoe

Happy New Year, by the way!

@phoe
Copy link
Author

phoe commented Dec 30, 2018

@arbv Corman Lisp is already Wine compatible, it seems; it's the IDE that doesn't work (yet). Given that a huge chunk of Lisp programmers use slime/swank, this might not be a big loss.

Is CormanCL compatible with swank?

Happy New Year to you too!

@arbv
Copy link
Member

arbv commented Dec 30, 2018

@phoe

May I ask you to run minesweepers for the longer period of time (a dozen of generations will do)?

@arbv
Copy link
Member

arbv commented Dec 30, 2018

@phoe

It used to be SLIME compatible, but currently the support for Corman Lisp in SWANK is broken. The code is still there though. I haven't had time to investigate it further.

@phoe
Copy link
Author

phoe commented Dec 30, 2018

zrzut ekranu z 2018-12-31 00-25-35 - 3

@arbv
Copy link
Member

arbv commented Dec 30, 2018

@phoe
Thank you!

This is very good. It is a proof that Corman Lisp kernel works properly under Wine.

I would be very appreciated if you have repeated the experiment with Hardware Assisted GC enabled ((ENABLE-HARDWARE-GC)).

@phoe
Copy link
Author

phoe commented Dec 30, 2018

zrzut ekranu z 2018-12-31 00-47-55

@phoe
Copy link
Author

phoe commented Dec 30, 2018

I'm curious - how does a hardware-assisted GC work in CormanCL's case?

@arbv
Copy link
Member

arbv commented Dec 31, 2018

@phoe
Thank you for your help! It is good news.

I am very appreciated.

As about Hardware Assisted GC, it uses Structured Exceptions Handling (the closest analogue in Unix is asynchronous signals) to help to track what objects in the old generations has been changed to point to the objects in the newer one.

I am not sure, but Clozure CL keeps track of every call to SETF (and friends) to do a similar thing. I remember reading something like this in the documentation.

Sorry, I lack time right now to give you more details. If you are still curious, feel free to contact me later.

I should say that I might be not the best person to ask about GC functioning. Please, Roger (@rgcorman), correct me if I am wrong.

@arbv
Copy link
Member

arbv commented Dec 31, 2018

I forgot to mention that the structured exceptions, in this case, are basically generated by the virtual memory support hardware, thus the name - Hardware Assisted GC.

@ninejaguar
Copy link

ninejaguar commented Jan 1, 2019

@phoe

The Corman CL IDE launches, but I am promptly met with a segfault.

wine: Unhandled page fault on read access to 0x00000020 at address 0x413c6e (thread 0009),

clconsole.exe launches in console mode and I am able to define a function and run it.

I don't know if this would help troubleshoot, but I ran across an old WineHQ link that mentions a workaround for one of the problems in running Corman Common Lisp. They say...

What works

Installation

Program does not freeze if you install "winetricks riched20" 

What does not

Program (main window is not usable)

Workarounds

What was not tested

n/a

Hardware tested

Graphics:

GPU:
Driver: 

Additional Comments

clean prefix used "winetricks riched20"

https://appdb.winehq.org/objectManager.php?sClass=application&iId=4751

@phoe
Copy link
Author

phoe commented Jan 1, 2019

Aaaah, the good old riched20 override! That's correct - the IDE works correctly after setting it.

zrzut ekranu z 2019-01-01 08-57-48

@ninejaguar
Copy link

@phoe

Aaaah, the good old riched20 override! That's correct - the IDE works correctly after setting it.

That's good news!

Is that a permanent fix? Perhaps, you could update that old WineHQ entry after some testing and increase the Corman Lisp "Version" number from 3.0? The old entry stated that the Program's "main window is not usable". But, your screenshot shows use!

@phoe
Copy link
Author

phoe commented Jan 1, 2019

Is that a permanent fix?

The riched20 override is a common one - many applications require it to work properly under Wine.

Perhaps, you could update that old WineHQ entry after some testing and increase the Corman Lisp "Version" number from 3.0?

I will need to create a WineHQ account for that, but sure, that is doable.

I think this issue is closeable now. I have opened #47 to take care of WineHQ support page.

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

No branches or pull requests

3 participants