Re: DOSEMU fails on start with SIGSEGV...

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




30.07.2023 17:41, Zeni Junker пишет:
I'm running Gentoo ( if that matters)
I've tried with version 1.4.0 and latest from git repo and the result is the same.
Also, it fails the same way whether I start it as a root or ordinary user ( I've added lines for both in dosemu.usrs file: "username/root c_all" ).

So I've compiled it with "debug" option tried to debug it with gdb.

Well, this has lead me through the initialization.

Thing is in main() (in emu.c - line 394) low_mem_init getc called and it fails.

Peeking within it shows that low_mem_init ( init.c) calls alloc_mapping ( line  261), which fails.

Peek into alloc_mapping ( file mapping.c) fails in line 419,, when it tries to copy pointer to allocated area to lowmem_base, which is 0 at that point:
line 419: " *(char **)(&lowmem_base) = addr; "

Since low memory has never been allocated at that point, this causes SIGSEGV.

At some point I thought this might be due to some kernel protection etc. Setting in/proc/sys/vm/mmap_min_addr was 65536, so I've reset it to 0 and retried, with the same result.

Then I've noticed that lowmem_base gets declared as "char * const lowmem_base" in mapping.c and nothing ever sets it, so it is always 0.
Just to doublecheck, I've inspected /proc/proc_id/maps of debugged process and indeed there was nothing mapped at address 0 - all I've seen are high address map areas that one usually gets from mmap
in the range 0x7Fxxxxxxxx for various libs etc and 4 mappings of dosemu.bin, also at high adresses.
But nothing low, so naturally any acess outside of mapped areas SIGSEGVs.

So, my question is, am I missing something ?
Some googling, as usual.
It would give you this dosemu2 ebuild:

https://gpo.zugaina.org/app-emulation/dosemu2/RDep

Or an 1.4.0.8 update for dosemu1.
Good that you've found your own solution
and got a 20-years-old software working,
but you certainly could do it otherwise.




[Index of Archives]     [Linux Console]     [Linux Audio]     [Linux for Hams]     [Kernel Newbies]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite Camping]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Samba]     [Linux Media]     [Fedora Users]

  Powered by Linux