Segmentation fault in Linux
Closed this issue · 15 comments
Hi, I compiled LisaEm 1.2.7-rc3a under Xubuntu 18.04 64bit.
Launching the emulator, I obtain an error: Segmentation fault (core dumped).
Hi Neelix57, thanks for reaching out. To help track this down please reply back with the output of:
- wx-config --cppflags - this should tell me the path and version of wxWidgets.
- do ./build.sh clean build --debug
This will compile in debug mode and launch LisaEm under gdb (which you'll need to have installed). Once in gdb, it will automatically run. Grab the output of the segfault and paste it in here, and then type in bt and hit enter and put that output here as well so I can see where it's crashing.
Also, please note that there is the "unstable" branch in github as well which despite its name has a lot more bug fixes, so it might behave a lot better for you.
Thanks.
Thanks for the response. As you said, I installed LisaEm from the unstable branch.
It launches well, but, as I insert the diskette and power on the Lisa, it display me the error:
Cannot open the file
I tried to load the image in the Windows version, the image is working.
I tried it with debug enabled, here is the log:
debug.txt
That might be related to file permissions on the image, or the enclosing directory. You can try using your file manager to set permissions on it for read/write or something like sudo chmod u+rw filename.dc42
- but if it works on windows there's no reason it shouldn't work on linux.
The segfault message in debug.txt indicates something went wrong with the emulation early on - it seems it's related to the IPCT alocator being called twice, and since originally DEBUG mode wasn't on it wouldn't warn you of this. Not quite sure what caused that to happen. I know the older versions have issues with resetting, I don't recall if I've fixed that before RC3a or just in unstable.
#ifdef DEBUG
if (iipct_mallocs!=0 || ipcts_allocated!=0)
EXIT(409,0,"=== suspect init_ipct_allocator is being called more than once without freeing ===");
#endif
Thanks, let me know if you see anything else that might provide a clue. I'll do another push to unstable once I solve the issues around UniPlus booting. see: https://lisalist2.com/index.php/topic,52.100.html
The floppy images are read/write.
I'm french, so some of my folders have names containing accented characters.
I tried to build LisaEm in a folder without such characters.
Now, LisaEm complains about ipc.
lisa_log.txt
That's possible since the file name is converted from wxString to a standard C string, though I'd expect it to behave the same between windows and linux. Hmmm.
This is usually an indicator that something is bad with the disk image you're booting from - generally caused by non-68000 code. Perhaps you could use a known-good disk image, such as from either archive.org or bitsavers?
src/lisa/cpu_board/rom.c:fixromchk:196:Applied HLE ProFile ROM patch to fe0090 and 00ff0091| 22:53:46.0 0
src/lisa/cpu_board/romless.c:romless_twgread:882:Bootblock checksum:381157b0| 22:53:46.0 0
exitr called from:cpu68k.c:cpu68k_makeipclist:1063cpu68k.c:cpu68k_makeipclist:1063: exit with code :501
cpu68k_makeipclist: But! ipc is null!
src/host/wxui/lisaem_wx.cpp:messagebox:6199:Emulation aborted!:Sorry, the emulation aborted due to a fatal error
cpu68k_makeipclist: But! ipc is null!
Stopped at cpu68k.c:cpu68k_makeipclist:1063 with code :501
LisaEM will now quit.| 22:53:46.0 0
I tried the Lisa Office 1.0 floppy images from bitsavers without success.
Finally, I installed Office 3.1 from my floppy images on LisaEm for windows running under Wine successfully.
I tried to boot the profile on the Linux version. I've got the same error message.
That's correct, LisaEm supports only Lisa Office System 2.0-3.1.
The unstable branch also supports some version of MacWorks such as MacWorks XL 3.0 - but not MacWorks II.
860K Twiggy disk images should work, as should double sided 800K 3.5" floppy disk images, however the kernel in LOS 1.x will not fully boot up.
LOS 1.x, Xenix, are not supported at all. UniPlus is not yet fully supported. These all seem to not work due to profile emulation, but I'm not 100% certain that this is the case. Future releases might get that working.
UniPlus images from pre-install hard drives will be supported (uniplus kernel v1.4) in code I've not yet pushed to unstable, however as sunix (the installer kernel) is v1.1 - fresh installs right now don't yet work and that's what I'm working on fixing.
Further investigating, I notice that, the ROM file I selected, after stitch together, but, the stitch file boot.rom doesn't appear in the settings file. The line "ROMFILE=" appears empty.
I give it manually the boot.ROM path.
When launching a boot disk, it give me the error:
/usr/include/wx-3.0/wx/strvararg.h(456): assert "(argtype & (wxFormatStringSpecifier<T>::value)) == argtype" failed in wxArgNormalizer(): format specifier doesn't match argument type
Here is the log:
error_log3.txt
So, the previous error put me on the way. I compiled LisaEm with wx 3.0. But you recommend wx 3.1.5.
I recompiled LisaEm with wx 3.1.5, and the error is gone. The Lisa boot on the floppies and installs the system.
But, the Lisa doesn't boot on the hard drive from the installer. After reinserting disk 1, it stuck on an empty screen. I must shutdown and restart the emulator to boot from hard drive profile.
However, I notice the emulator is much slower as the windows version.
Another thing is, it boots the floppies only romed.
Booting romless, it runs into the error:
Sorry, the emulation aborted due to a fatal error cpu68k_makeipclist: But! ipc is null! Stopped at cpu68k.c:cpu68k_makeipclist:1063 with code :501 LisaEM will now quit.
Yes, that's why I asked you about the output of wx-config - because wxWidgets that ship by default with your OS will tend to be very old, buggy, or compiled in ways that are incompatible with LisaEm, that's why the readme tells you explicitly to build your own using the scripts directory.
I can't speak for the slowness between windows and linux, my main development environment these days is Linux, it used to be macos. It's possible differences in the OS between windows and linux are the issue, or perhaps you've configured one to use the hq3x renderer and the other to use something like AntiAlias which is much faster.
With RC3A and possibly the current unstable branch there were issues around rebooting that caused the emulator to crash, hang, etc. However shutdown instead of reboot would work. I think I've solved those in the code that I've not yet released, or perhaps in unstable, don't remember.
Booting with the H ROM is ideal, but it should be able to boot LOS without it.
Whenever you see failures around IPCs in cpu68k_makeipclist it means it tried to execute invalid 68000 code, or impossibly long stretches of 00's which is 68000 is an OR opcode. Basically the Generator CPU core will try to break things up into basic blocks and if it sees thousands of opcodes that don't branch in any way, it fails to find a basic block and will throw that error. Normal 68000 will never behave this way.
Almost always (but not always) this indicates a problem the code that's on floppies/hard drive rather than with the emulator. There are some bad LOS disk images out there in the wild on the internet.
ROMless will not work for every operating system because of these will try to call things in the ROM that aren't handled, for example displaying icons, drawing text, etc. Only very basic things such as reading a block from the profile/floppy are handled by ROMless. So that's the bare essentials. For example. Xenix or UniPlus will use the boot rom to provide an interface to the user and will immediately fail in ROMless.
Some very early ROMs such as earlier than "F" will also fail in LisaEm for various reasons, so "H" is recommended. The "3A" ROM meant for MacWorks only should also function though the screen will be incompatible with LOS in that case and only MacWorks will work.
I reinstalled LOS 3.1 on profile under rc3a compiled with wx3.1.4, it runs much faster that unstable. Both tested with antialias.
I will open another issue, about installation.
In your environments, are both unstable and RC3a compiled without debug? (enabling debug will slow LisaEm down quite a bit.)
Thanks
For now, I have debug on both versions. I will try it out without debug.
I confirm, unstable is much slower than rc3a, installed without debug and system wide.
I noticed 7 disk tools are missing in rc3a, will they be included in the final release ?
just pushed to unstable, these and a few other issues should be fixed now.