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

Programs using DPMI segfault when using musl libc #537

Closed
newbluemoon opened this Issue Nov 19, 2017 · 172 comments

Comments

Projects
None yet
4 participants
@newbluemoon
Contributor

newbluemoon commented Nov 19, 2017

Log of dosemu -D9+M:

CONF: config variable parser_version_3 set
CONF: config variable c_system set
CONF: Parsing built-in dosemu.conf file.
CONF: config variable version_3_style_used set
CONF: Parsing built-in global.conf file.
CONF: config variable version_3_style_used unset
CONF: config variable version_3_style_used set
CONF: opened include file /etc/dosemu/dosemu.conf
CONF: closed include file /etc/dosemu/dosemu.conf
CONF: mapping driver = 'auto'
debug flags: -a+cw
CONF: Disabling use of pentium timer
CONF: dosbanner on
CONF: timer freq=18, update=54925
CONF: CPU set to 586
CONF: JIT CPUEMU set to 0 for 586
CONF: CPU VM set to -1
CONF: 8192k bytes EMS memory
CONF: EMS-frame = 0xe000
CONF: DPMI-Server on (0x20000)
CONF: DPMI linear reserve base addr = 0xffffffff
CONF: DPMI linear reserve size = 0x8000
CONF: PM DOS API Translator on
CONF: No DJGPP NULL deref checks: on
CONF: 8192k bytes XMS memory
CONF: dosemu not running on console
CONF: time mode = 'bios'
SER: directory /var/lock namestub LCK.. binary No
MOUSE: /dev/input/mice, type 7 using internaldriver: yes, emulate3buttons: no baudrate: 0
CONF: Keyboard-layout keyb-user
CONF: **** Warning: floppy /dev/fd0 not accessible, disabled
CONF: fastfloppy = 1
CONF: IPX support off
CONF(LPT0) f: (null)   c: lpr -l  t: 20  port: 0
CONF(LPT1) f: (null)   c: lpr -P cups-pdf  t: 20  port: 0
CONF: not allowing speaker port access
CONF: Packet Driver enabled.
CONF: disk type 'Directory' drive C:
CONF: disk type 'Directory' drive D:
CONF: disk type 'Directory' drive E:
CONF: cdrom MSCD0001 on /dev/cdrom
CONF: config variable c_system unset
debug flags: 9+M
Linux kernel 4.9.63; CPU speed is 2200000000 Hz
CPU-EMU speed is 2200 MHz
CONF: not running on console
CONF: mostly running as USER: uid=1000 (cached 1000) gid=100 (cached 100)
CONF: priv operations unavailable
DBG_FD already set
DOSEMU-2.0pre7.1 is coming up on Linux version 4.9.63_1 #1 SMP PREEMPT Sat Nov 18 19:58:45 UTC 2017 x86_64
Compiled with gcc version 7.2.0 64bit
CFLAGS: -Wall -Wstrict-prototypes -Wmissing-declarations -Wnested-externs -fms-extensions -pthread -imacros config.h -Wno-unused-result -fpie -fplan9-extensions -Wno-maybe-uninitialized -ggdb3 -D_FORTIFY_SOURCE=2 -mtune=generic -O2 -pipe
CONF: reserving 640Kb at 0x00000 for 'd' (Base DOS memory (first 640K))
CONF: reserving 48Kb at 0xF4000 for 'r' (Dosemu reserved area)
KVM: error opening /dev/kvm: Permission denied
KVM not available: Permission denied
using CPU emulation for vm86()
initial register values: fs: 0x0000  gs: 0x0000 eflags: 0x0246
initial segment bases: fs: 0x7f194aa4ab88  gs: 0
VID: initializing SDL plugin
CONF: reserving 128Kb at 0xA0000 for 'v' (Video memory)
Conventional memory mapped from 0x7f193dfa7000 to 0x4139d000
DPMI memory mapped to 0x414ad000 (reserve) and to 0x434ad000 (main)
CONF: reserving 8256Kb at 0x100000 for 'x' (Extended memory (HMA+XMS))
VID: initializing video sdl
VID: SDL plugin initialization completed
Registering HWRAM, type=e base=0x4b6a3000 size=0x400000
CONF: reserving 4096Kb at 0x4B6A3000 for 'e' (VGAEMU LFB)
CONF: reserving 12Kb at 0xC0000 for 'V' (VGAEMU Video BIOS)
SERIAL $Id$
ERROR: SDL sound init failed: ALSA: Couldn't open audio device: No such file or directory
fluidsynth: cannot load soundfont share/soundfonts/default.sf2
ERROR: MUNT: Can't find /root/.dosemu/roms/MT32_CONTROL.ROM
ERROR: alsa_midi (ALSA lib): seq_hw.c:466:(snd_seq_hw_open) : Permission denied open /dev/snd/seq failed
DPMI: mem init, mpool is 136273920 bytes at 0x434ad000
DPMI: dpmi_free_memory available 0x8000000
DPMI: Allocate 1 descriptors started at 0x008f
DPMI: Allocate 1 descriptors started at 0x0097
EMU86: modify_ldt 11 16 [00000011 02110000 00000156 00000004]
EMU86: LDT entry 0x11 type C16: b=02110000 l=156 fl=00fa
DPMI: SetSelector: 0x008f base=0x2110000 limit=0x156 big=0 type=2 np=0
EMU86: modify_ldt 11 16 [00000012 02110000 00000156 00000005]
EMU86: LDT entry 0x12 type C32: b=02110000 l=156 fl=40fa
DPMI: SetSelector: 0x0097 base=0x2110000 limit=0x156 big=0 type=2 np=0
CONF: detected layout is "de-latin1"
CONF: detected alternate layout: (null)
TIME: using 9154 usec for updating ALRM timer
======================= ENTER CPU-EMU ===============

CONF: freeing region for 'E' (EMS page frame)
CONF: freeing region for 'U' ((null))
CONF: reserving 16Kb at 0xE0000 for 'E' (EMS page frame)
CONF: reserving 16Kb at 0xE4000 for 'E' (EMS page frame)
CONF: reserving 16Kb at 0xE8000 for 'E' (EMS page frame)
CONF: reserving 16Kb at 0xEC000 for 'E' (EMS page frame)
CONF: reserving 116Kb at 0xC3000 for 'U' (Upper Memory Block (UMB, XMS 3.0))
CONF: reserving 16Kb at 0xF0000 for 'U' (Upper Memory Block (UMB, XMS 3.0))
Request for DPMI entry
DPMI entry returned, needs 0xe6 lowmem paragraphs (3680)
DPMI: initializing
DPMI: Allocate 1 descriptors started at 0x009f
EMU86: modify_ldt 11 16 [00000013 00000000 00000000 00000001]
EMU86: LDT entry 0x13 type D32: b=00000000 l=0 fl=40f2
DPMI: SetSelector: 0x009f base=0x0 limit=0x0 big=0 type=0 np=0
EMU86: modify_ldt 11 16 [00000013 02121000 0000efff 00000001]
EMU86: LDT entry 0x13 type D32: b=02121000 l=efff fl=40f2
DPMI: SetSelector: 0x009f base=0x2121000 limit=0xefff big=0 type=0 np=0
Going protected with fingers crossed
32bit=1, CS=076d SS=02b3 DS=076d ip=6e8a sp=1470
OPS  : c2 17 b8 01 00 9a 00 48 00 f8 -> 72 81 fc 36 c7 06 c2 0a fc 71 
STACK: 8d 10 27 75 6d 07 8a 6e 6d 07 -> f1 72 10 08 00 00 00 00 00 00 

DPMI: Allocate 1 descriptors started at 0x00a7
EMU86: modify_ldt 11 16 [00000014 00000000 00000000 00000001]
EMU86: LDT entry 0x14 type D32: b=00000000 l=0 fl=40f2
DPMI: SetSelector: 0x00a7 base=0x0 limit=0x0 big=0 type=0 np=0
EMU86: modify_ldt 11 16 [00000014 000076d0 0000ffff 00000004]
EMU86: LDT entry 0x14 type C16: b=000076d0 l=ffff fl=00fa
DPMI: SetSelector: 0x00a7 base=0x76d0 limit=0xffff big=0 type=2 np=0
DPMI: convert seg 0x2b3 to desc
DPMI: SEG at base=0x2b30 not found, allocate a new one
DPMI: Allocate 1 descriptors started at 0x00af
EMU86: modify_ldt 11 16 [00000015 00000000 00000000 00000001]
EMU86: LDT entry 0x15 type D32: b=00000000 l=0 fl=40f2
DPMI: SetSelector: 0x00af base=0x0 limit=0x0 big=0 type=0 np=0
EMU86: modify_ldt 11 16 [00000015 00002b30 0000ffff 00000000]
EMU86: LDT entry 0x15 type D16: b=00002b30 l=ffff fl=00f2
DPMI: SetSelector: 0x00af base=0x2b30 limit=0xffff big=0 type=0 np=0
DPMI: convert seg 0x76d to desc
DPMI: SEG at base=0x76d0 not found, allocate a new one
DPMI: Allocate 1 descriptors started at 0x00b7
EMU86: modify_ldt 11 16 [00000016 00000000 00000000 00000001]
EMU86: LDT entry 0x16 type D32: b=00000000 l=0 fl=40f2
DPMI: SetSelector: 0x00b7 base=0x0 limit=0x0 big=0 type=0 np=0
EMU86: modify_ldt 11 16 [00000016 000076d0 0000ffff 00000000]
EMU86: LDT entry 0x16 type D16: b=000076d0 l=ffff fl=00f2
DPMI: SetSelector: 0x00b7 base=0x76d0 limit=0xffff big=0 type=0 np=0
DPMI: Allocate 1 descriptors started at 0x00bf
EMU86: modify_ldt 11 16 [00000017 00000000 00000000 00000001]
EMU86: LDT entry 0x17 type D32: b=00000000 l=0 fl=40f2
DPMI: SetSelector: 0x00bf base=0x0 limit=0x0 big=0 type=0 np=0
DPMI: SetSegmentBaseAddress[0x0017;0x00bf] 0x00002a30
EMU86: modify_ldt 11 16 [00000017 00002a30 00000000 00000001]
EMU86: LDT entry 0x17 type D32: b=00002a30 l=0 fl=40f2
DPMI: SetSegmentLimit[0x0017;0x00bf] 0x000000ff
EMU86: modify_ldt 11 16 [00000017 00002a30 000000ff 00000001]
EMU86: LDT entry 0x17 type D32: b=00002a30 l=ff fl=40f2
Entry 0x0011: Base 02110000, Limit 00156, Type 2 (desc 0x8f)
              Present, 16, byte limit, 
              0200fa11 00000156 [FR nonconf code]
       cache: 0200fa11 00000156
         seg: Base 02110000, Limit 00156, Type 2, Big 0
Entry 0x0012: Base 02110000, Limit 00156, Type 2 (desc 0x97)
              Present, 32, byte limit, 
              0240fa11 00000156 [FR nonconf code]
       cache: 0240fa11 00000156
         seg: Base 02110000, Limit 00156, Type 2, Big 0
Entry 0x0013: Base 02121000, Limit 0efff, Type 2 (desc 0x9f)
              Present, 32, byte limit, 
              0240f212 1000efff [RW data/upstack]
       cache: 0240f212 1000efff
         seg: Base 02121000, Limit 0efff, Type 0, Big 0
Entry 0x0014: Base 000076d0, Limit 0ffff, Type 2 (desc 0xa7)
              Present, 16, byte limit, 
              0000fa00 76d0ffff [FR nonconf code]
       cache: 0000fa00 76d0ffff
         seg: Base 000076d0, Limit 0ffff, Type 2, Big 0
Entry 0x0015: Base 00002b30, Limit 0ffff, Type 2 (desc 0xaf)
              Present, 16, byte limit, 
              0000f200 2b30ffff [RW data/upstack]
       cache: 0000f200 2b30ffff
         seg: Base 00002b30, Limit 0ffff, Type 0, Big 0
Entry 0x0016: Base 000076d0, Limit 0ffff, Type 2 (desc 0xb7)
              Present, 16, byte limit, 
              0000f200 76d0ffff [RW data/upstack]
       cache: 0000f200 76d0ffff
         seg: Base 000076d0, Limit 0ffff, Type 0, Big 0
Entry 0x0017: Base 00002a30, Limit 000ff, Type 2 (desc 0xbf)
              Present, 32, byte limit, 
              0040f200 2a3000ff [RW data/upstack]
       cache: 0040f200 2a3000ff
         seg: Base 00002a30, Limit 000ff, Type 0, Big 0
dpmi_sel()=97 CS=a7 DS=b7 SS=af ES=bf
DPMI: convert seg 0x291 to desc
DPMI: SEG at base=0x2910 not found, allocate a new one
DPMI: Allocate 1 descriptors started at 0x00c7
EMU86: modify_ldt 11 16 [00000018 00000000 00000000 00000001]
EMU86: LDT entry 0x18 type D32: b=00000000 l=0 fl=40f2
DPMI: SetSelector: 0x00c7 base=0x0 limit=0x0 big=0 type=0 np=0
EMU86: modify_ldt 11 16 [00000018 00002910 0000ffff 00000000]
EMU86: LDT entry 0x18 type D16: b=00002910 l=ffff fl=00f2
DPMI: SetSelector: 0x00c7 base=0x2910 limit=0xffff big=0 type=0 np=0
DPMI: env segment 0x291 converted to descriptor 0xc7
DPMI: Allocate 1 descriptors started at 0x00cf
EMU86: modify_ldt 11 16 [00000019 00000000 00000000 00000001]
EMU86: LDT entry 0x19 type D32: b=00000000 l=0 fl=40f2
DPMI: SetSelector: 0x00cf base=0x0 limit=0x0 big=0 type=0 np=0
DPMI: SetSegmentBaseAddress[0x0019;0x00cf] 0x02130000
EMU86: modify_ldt 11 16 [00000019 02130000 00000000 00000001]
EMU86: LDT entry 0x19 type D32: b=02130000 l=0 fl=40f2
DPMI: SetSegmentLimit[0x0019;0x00cf] 0x00000031
EMU86: modify_ldt 11 16 [00000019 02130000 00000031 00000001]
EMU86: LDT entry 0x19 type D32: b=02130000 l=31 fl=40f2
DPMI: Allocate 1 descriptors started at 0x00d7
EMU86: modify_ldt 11 16 [0000001a 00000000 00000000 00000001]
EMU86: LDT entry 0x1a type D32: b=00000000 l=0 fl=40f2
DPMI: SetSelector: 0x00d7 base=0x0 limit=0x0 big=0 type=0 np=0
DPMI: Allocate realmode callback for 0x97:0x000134 use #0 callback address, 0xfc00:0x20a
DPMI: Allocate 1 descriptors started at 0x00df
EMU86: modify_ldt 11 16 [0000001b 00000000 00000000 00000001]
EMU86: LDT entry 0x1b type D32: b=00000000 l=0 fl=40f2
DPMI: SetSelector: 0x00df base=0x0 limit=0x0 big=0 type=0 np=0
DPMI: Allocate realmode callback for 0x97:0x000137 use #1 callback address, 0xfc00:0x20b
DPMI: Allocate 1 descriptors started at 0x00e7
EMU86: modify_ldt 11 16 [0000001c 00000000 00000000 00000001]
EMU86: LDT entry 0x1c type D32: b=00000000 l=0 fl=40f2
DPMI: SetSelector: 0x00e7 base=0x0 limit=0x0 big=0 type=0 np=0
DPMI: Allocate realmode callback for 0x97:0x00013a use #2 callback address, 0xfc00:0x20c
DPMI: Allocate 1 descriptors started at 0x00ef
EMU86: modify_ldt 11 16 [0000001d 00000000 00000000 00000001]
EMU86: LDT entry 0x1d type D32: b=00000000 l=0 fl=40f2
DPMI: SetSelector: 0x00ef base=0x0 limit=0x0 big=0 type=0 np=0
DPMI: SetSegmentLimit[0x001d;0x00ef] 0x00004fff
EMU86: modify_ldt 11 16 [0000001d 00000000 00004fff 00000001]
EMU86: LDT entry 0x1d type D32: b=00000000 l=4fff fl=40f2
DPMI: SetSegmentBaseAddress[0x001d;0x00ef] 0x02111000
EMU86: modify_ldt 11 16 [0000001d 02111000 00004fff 00000001]
EMU86: LDT entry 0x1d type D32: b=02111000 l=4fff fl=40f2
DPMI: Allocate 1 descriptors started at 0x00f7
EMU86: modify_ldt 11 16 [0000001e 00000000 00000000 00000001]
EMU86: LDT entry 0x1e type D32: b=00000000 l=0 fl=40f2
DPMI: SetSelector: 0x00f7 base=0x0 limit=0x0 big=0 type=0 np=0
EMU86: modify_ldt 11 16 [0000001e 02111000 00004fff 00000001]
EMU86: LDT entry 0x1e type D32: b=02111000 l=4fff fl=40f2
DPMI: SetSelector: 0x00f7 base=0x2111000 limit=0x4fff big=0 type=0 np=0
DPMI: SetDescriptorAccessRights[0x001e;0x00f7] 0x00f0
EMU86: modify_ldt 11 16 [0000001e 02111000 00004fff 00000008]
EMU86: LDT entry 0x1e type D16: b=02111000 l=4fff fl=00f0
DPMI: SetSegmentLimit[0x001e;0x00f7] 0x0000ffff
EMU86: modify_ldt 11 16 [0000001e 02111000 0000ffff 00000008]
EMU86: LDT entry 0x1e type D16: b=02111000 l=ffff fl=00f0
MSDOS: init 1, ldt_alias=0xef winos2_alias=0xf7
DPMI: cs=0xa7, ss=0xaf, ds=0xb7, es=0xbf, fs=0, gs=0 ip=0x6e8a

stsp added a commit that referenced this issue Nov 19, 2017

signal: propagate signal num to exit() properly [#537]
And print in by dosemu wrapper script.
@stsp

This comment has been minimized.

Show comment
Hide comment
@stsp

stsp Nov 19, 2017

Owner

Could you please fix your /etc/asound.conf
or .asoundrc so that alsa not to flood the log
with error messages?
Please add the -D9+S log to see if dosemu
calls alsa only once, or maybe it is a bug in
dosemu and it calls alsa repeatedly, ignoring
the failures.

The log ends at the very first switch to DPMI
code, which is a bit strange. No debug code
was triggered at all, crash not logged.
See dmesg, maybe kernel decided to kill
the process for some reason.
Also I have pushed the patch that will print
if dosemu was terminated by signal.

Owner

stsp commented Nov 19, 2017

Could you please fix your /etc/asound.conf
or .asoundrc so that alsa not to flood the log
with error messages?
Please add the -D9+S log to see if dosemu
calls alsa only once, or maybe it is a bug in
dosemu and it calls alsa repeatedly, ignoring
the failures.

The log ends at the very first switch to DPMI
code, which is a bit strange. No debug code
was triggered at all, crash not logged.
See dmesg, maybe kernel decided to kill
the process for some reason.
Also I have pushed the patch that will print
if dosemu was terminated by signal.

@newbluemoon

This comment has been minimized.

Show comment
Hide comment
@newbluemoon

newbluemoon Nov 19, 2017

Contributor

I changed the log in the first post (running dosemu with your latest modifications). The alsa error shows up when I run dosemu as root. Now it’s as normal user. There is no output in dmesg in respect to the crash.

Log of dosemu -D9+S:

[Edit: removed the wrong log]

Contributor

newbluemoon commented Nov 19, 2017

I changed the log in the first post (running dosemu with your latest modifications). The alsa error shows up when I run dosemu as root. Now it’s as normal user. There is no output in dmesg in respect to the crash.

Log of dosemu -D9+S:

[Edit: removed the wrong log]

@stsp

This comment has been minimized.

Show comment
Hide comment
@stsp

stsp Nov 19, 2017

Owner

-D9+S is only to look for alsa problem,
and now you didn't log alsa errors, so this
log is useless.

My modifications will (or will not) print the
signal number to terminal, not to the log.

Owner

stsp commented Nov 19, 2017

-D9+S is only to look for alsa problem,
and now you didn't log alsa errors, so this
log is useless.

My modifications will (or will not) print the
signal number to terminal, not to the log.

@newbluemoon

This comment has been minimized.

Show comment
Hide comment
@newbluemoon

newbluemoon Nov 19, 2017

Contributor

Sorry! Dosemu exited with signal 11.

-D9+S:

CONF: config variable parser_version_3 set
CONF: config variable c_system set
CONF: Parsing built-in dosemu.conf file.
CONF: config variable version_3_style_used set
CONF: Parsing built-in global.conf file.
CONF: config variable version_3_style_used unset
CONF: config variable version_3_style_used set
CONF: opened include file /etc/dosemu/dosemu.conf
CONF: closed include file /etc/dosemu/dosemu.conf
CONF: mapping driver = 'auto'
debug flags: -a+cw
CONF: Disabling use of pentium timer
CONF: dosbanner on
CONF: timer freq=18, update=54925
CONF: CPU set to 586
CONF: JIT CPUEMU set to 0 for 586
CONF: CPU VM set to -1
CONF: 8192k bytes EMS memory
CONF: EMS-frame = 0xe000
CONF: DPMI-Server on (0x20000)
CONF: DPMI linear reserve base addr = 0xffffffff
CONF: DPMI linear reserve size = 0x8000
CONF: PM DOS API Translator on
CONF: No DJGPP NULL deref checks: on
CONF: 8192k bytes XMS memory
CONF: dosemu not running on console
CONF: time mode = 'bios'
SER: directory /var/lock namestub LCK.. binary No
MOUSE: /dev/input/mice, type 7 using internaldriver: yes, emulate3buttons: no baudrate: 0
CONF: Keyboard-layout keyb-user
CONF: **** Warning: floppy /dev/fd0 not accessible, disabled
CONF: fastfloppy = 1
CONF: IPX support off
CONF(LPT0) f: (null)   c: lpr -l  t: 20  port: 0
CONF(LPT1) f: (null)   c: lpr -P cups-pdf  t: 20  port: 0
CONF: not allowing speaker port access
CONF: Packet Driver enabled.
CONF: disk type 'Directory' drive C:
CONF: disk type 'Directory' drive D:
CONF: disk type 'Directory' drive E:
CONF: cdrom MSCD0001 on /dev/cdrom
CONF: config variable c_system unset
debug flags: 9+S
Linux kernel 4.9.63; CPU speed is 800000000 Hz
CPU-EMU speed is 800 MHz
CONF: not running on console
CONF: running exclusively as ROOT: uid=0 (cached 0) gid=0 (cached 0)
CONF: priv operations unavailable
DBG_FD already set
DOSEMU-2.0pre7.1 is coming up on Linux version 4.9.63_1 #1 SMP PREEMPT Sat Nov 18 19:58:45 UTC 2017 x86_64
Compiled with gcc version 7.2.0 64bit
CFLAGS: -Wall -Wstrict-prototypes -Wmissing-declarations -Wnested-externs -fms-extensions -pthread -imacros config.h -Wno-unused-result -fpie -fplan9-extensions -Wno-maybe-uninitialized -ggdb3 -D_FORTIFY_SOURCE=2 -mtune=generic -O2 -pipe
CONF: reserving 640Kb at 0x00000 for 'd' (Base DOS memory (first 640K))
CONF: reserving 48Kb at 0xF4000 for 'r' (Dosemu reserved area)
initial register values: fs: 0x0000  gs: 0x0000 eflags: 0x0246
initial segment bases: fs: 0x7f307e5c4b88  gs: 0
PCM: registering player: Sound Output: SDL device
VID: initializing SDL plugin
CONF: reserving 128Kb at 0xA0000 for 'v' (Video memory)
Conventional memory mapped from 0x7f30729a0000 to 0x40905000
DPMI memory mapped to 0x40a15000 (reserve) and to 0x42a15000 (main)
Using V86 mode inside KVM
CONF: reserving 8256Kb at 0x100000 for 'x' (Extended memory (HMA+XMS))
VID: initializing video sdl
VID: SDL plugin initialization completed
Registering HWRAM, type=e base=0x4ac0b000 size=0x400000
CONF: reserving 4096Kb at 0x4AC0B000 for 'e' (VGAEMU LFB)
CONF: reserving 12Kb at 0xC0000 for 'V' (VGAEMU Video BIOS)
SERIAL $Id$
PCM: registering player: SB REC
PCM: init
PCM: registering player: Sound Output: libao
PCM: registering player: Sound Output: libao wav writer
PCM: registering recorder: Sounds input: alsa
no PCM effect processors initialized
Initializing SDL sound output
PCM: Initializing selected plugin: Sound Output: SDL device: OK
PCM: Initializing pass-through plugin: SB REC: OK
PCM: Stream 0 allocated for "MIC INPUT"
PCM: Initializing plugin: Sounds input: alsa (w=0): OK
PCM: Stream 1 allocated for "SB DAC"
PCM: setting flag 1 for stream 1 (SB DAC)
PCM: Stream 2 allocated for "SB DMA"
PCM: setting flag 4 for stream 2 (SB DMA)
PCM: Bypassing plugin: MIDI Output: TiMidity++ plugin: (2 < 3)
fluidsynth: cannot load soundfont share/soundfonts/default.sf2
PCM: Initializing plugin: MIDI Output: FluidSynth device (w=3): Failed
PCM: Initializing plugin: MIDI Output: TiMidity++ plugin (w=2): Failed
PCM: Bypassing plugin: MIDI Output: OSS sequencer: (0 < 1)
alsa_midi: unable to open default for writing: Not a tty
PCM: Initializing plugin: MIDI Output: ALSA device (w=1): Failed
oss_midi: unable to open /dev/sequencer for writing: No such file or directory
PCM: Initializing plugin: MIDI Output: OSS sequencer (w=0): Failed
PCM: Bypassing plugin: MIDI Output: ALSA virtual device (for MT32): (0 < 3)
ERROR: MUNT: Can't find /root/.dosemu/roms/MT32_CONTROL.ROM
PCM: Initializing plugin: MIDI Output: munt device (w=3): Failed
PCM: Initializing plugin: MIDI Output: ALSA virtual device (for MT32) (w=0): OK
MIDI Input: named pipe: unable to open /root/.dosemu/run/dosemu-midi_in for reading: No such file or directory
PCM: Initializing plugin: MIDI Input: named pipe (w=0): Failed
SB: SB Initialisation
SB: Mixer init
SB: OPL3 Initialization
PCM: Stream 3 allocated for "Adlib"
MPU401: MPU-401 Initialisation
SB: mpu401 irq set to 5
SB: same irq for DSP and MPU401
MPU401: MPU-401 Initialisation - Base 0x330 
SB: Initialisation - Base 0x220
DPMI: mem init, mpool is 136273920 bytes at 0x42a15000
CONF: detected layout is "de-latin1"
CONF: detected alternate layout: (null)
TIME: using 9154 usec for updating ALRM timer
SB: Resetting SB DSP
CONF: freeing region for 'E' (EMS page frame)
CONF: freeing region for 'U' ((null))
CONF: reserving 16Kb at 0xE0000 for 'E' (EMS page frame)
CONF: reserving 16Kb at 0xE4000 for 'E' (EMS page frame)
CONF: reserving 16Kb at 0xE8000 for 'E' (EMS page frame)
CONF: reserving 16Kb at 0xEC000 for 'E' (EMS page frame)
CONF: reserving 116Kb at 0xC3000 for 'U' (Upper Memory Block (UMB, XMS 3.0))
CONF: reserving 16Kb at 0xF0000 for 'U' (Upper Memory Block (UMB, XMS 3.0))
alsa_midi (ALSA lib): confmisc.c:767:(parse_card) cannot find card '$CARD'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_card_driver returned error: No such device
alsa_midi (ALSA lib): confmisc.c:392:(snd_func_concat) error evaluating strings
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_concat returned error: No such device
alsa_midi (ALSA lib): confmisc.c:1246:(snd_func_refer) error evaluating name
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such device
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such device
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=SB,DEV=0
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=SB
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter DEV
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter DEV
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HDA-Intel.pcm.front.1:CARD=SB'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such file or directory
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=SB,DEV=0
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=SB
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=SB,DEV=0
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=SB
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=SB,DEV=0
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=SB
alsa_midi (ALSA lib): confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HDA-Intel.pcm.surround51.1:CARD=SB'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such file or directory
alsa_midi (ALSA lib): confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HDA-Intel.pcm.surround40.1:CARD=SB'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such file or directory
alsa_midi (ALSA lib): confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HDA-Intel.pcm.surround51.1:CARD=SB'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such file or directory
alsa_midi (ALSA lib): confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HDA-Intel.pcm.surround51.1:CARD=SB'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such file or directory
alsa_midi (ALSA lib): confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HDA-Intel.pcm.surround51.1:CARD=SB'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such file or directory
alsa_midi (ALSA lib): confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HDA-Intel.pcm.surround71.1:CARD=SB'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such file or directory
alsa_midi (ALSA lib): confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HDA-Intel.pcm.iec958.1:CARD=SB,AES0=4,AES1=130,AES2=0,AES3=2'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter CARD
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter CARD
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter CARD
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter CARD
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter CARD
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter CARD
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter CARD
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter CARD
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=SB,DEV=0
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=SB
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=HDMI,DEV=0
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=HDMI
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter DEV
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter DEV
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HDA-Intel.pcm.front.1:CARD=HDMI'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such file or directory
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=HDMI,DEV=0
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=HDMI
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=HDMI,DEV=0
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=HDMI
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=HDMI,DEV=0
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=HDMI
alsa_midi (ALSA lib): confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HDA-Intel.pcm.surround51.1:CARD=HDMI'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such file or directory
alsa_midi (ALSA lib): confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HDA-Intel.pcm.surround40.1:CARD=HDMI'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such file or directory
alsa_midi (ALSA lib): confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HDA-Intel.pcm.surround51.1:CARD=HDMI'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such file or directory
alsa_midi (ALSA lib): confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HDA-Intel.pcm.surround51.1:CARD=HDMI'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such file or directory
alsa_midi (ALSA lib): confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HDA-Intel.pcm.surround51.1:CARD=HDMI'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such file or directory
alsa_midi (ALSA lib): confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HDA-Intel.pcm.surround71.1:CARD=HDMI'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such file or directory
alsa_midi (ALSA lib): confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HDA-Intel.pcm.iec958.1:CARD=HDMI,AES0=4,AES1=130,AES2=0,AES3=2'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such file or directory
alsa_midi (ALSA lib): confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HDA-Intel.pcm.hdmi.8:CARD=HDMI,AES0=4,AES1=130,AES2=0,AES3=2'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter CARD
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter CARD
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter CARD
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter CARD
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter CARD
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter CARD
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter CARD
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter CARD
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=HDMI,DEV=0
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=HDMI
Contributor

newbluemoon commented Nov 19, 2017

Sorry! Dosemu exited with signal 11.

-D9+S:

CONF: config variable parser_version_3 set
CONF: config variable c_system set
CONF: Parsing built-in dosemu.conf file.
CONF: config variable version_3_style_used set
CONF: Parsing built-in global.conf file.
CONF: config variable version_3_style_used unset
CONF: config variable version_3_style_used set
CONF: opened include file /etc/dosemu/dosemu.conf
CONF: closed include file /etc/dosemu/dosemu.conf
CONF: mapping driver = 'auto'
debug flags: -a+cw
CONF: Disabling use of pentium timer
CONF: dosbanner on
CONF: timer freq=18, update=54925
CONF: CPU set to 586
CONF: JIT CPUEMU set to 0 for 586
CONF: CPU VM set to -1
CONF: 8192k bytes EMS memory
CONF: EMS-frame = 0xe000
CONF: DPMI-Server on (0x20000)
CONF: DPMI linear reserve base addr = 0xffffffff
CONF: DPMI linear reserve size = 0x8000
CONF: PM DOS API Translator on
CONF: No DJGPP NULL deref checks: on
CONF: 8192k bytes XMS memory
CONF: dosemu not running on console
CONF: time mode = 'bios'
SER: directory /var/lock namestub LCK.. binary No
MOUSE: /dev/input/mice, type 7 using internaldriver: yes, emulate3buttons: no baudrate: 0
CONF: Keyboard-layout keyb-user
CONF: **** Warning: floppy /dev/fd0 not accessible, disabled
CONF: fastfloppy = 1
CONF: IPX support off
CONF(LPT0) f: (null)   c: lpr -l  t: 20  port: 0
CONF(LPT1) f: (null)   c: lpr -P cups-pdf  t: 20  port: 0
CONF: not allowing speaker port access
CONF: Packet Driver enabled.
CONF: disk type 'Directory' drive C:
CONF: disk type 'Directory' drive D:
CONF: disk type 'Directory' drive E:
CONF: cdrom MSCD0001 on /dev/cdrom
CONF: config variable c_system unset
debug flags: 9+S
Linux kernel 4.9.63; CPU speed is 800000000 Hz
CPU-EMU speed is 800 MHz
CONF: not running on console
CONF: running exclusively as ROOT: uid=0 (cached 0) gid=0 (cached 0)
CONF: priv operations unavailable
DBG_FD already set
DOSEMU-2.0pre7.1 is coming up on Linux version 4.9.63_1 #1 SMP PREEMPT Sat Nov 18 19:58:45 UTC 2017 x86_64
Compiled with gcc version 7.2.0 64bit
CFLAGS: -Wall -Wstrict-prototypes -Wmissing-declarations -Wnested-externs -fms-extensions -pthread -imacros config.h -Wno-unused-result -fpie -fplan9-extensions -Wno-maybe-uninitialized -ggdb3 -D_FORTIFY_SOURCE=2 -mtune=generic -O2 -pipe
CONF: reserving 640Kb at 0x00000 for 'd' (Base DOS memory (first 640K))
CONF: reserving 48Kb at 0xF4000 for 'r' (Dosemu reserved area)
initial register values: fs: 0x0000  gs: 0x0000 eflags: 0x0246
initial segment bases: fs: 0x7f307e5c4b88  gs: 0
PCM: registering player: Sound Output: SDL device
VID: initializing SDL plugin
CONF: reserving 128Kb at 0xA0000 for 'v' (Video memory)
Conventional memory mapped from 0x7f30729a0000 to 0x40905000
DPMI memory mapped to 0x40a15000 (reserve) and to 0x42a15000 (main)
Using V86 mode inside KVM
CONF: reserving 8256Kb at 0x100000 for 'x' (Extended memory (HMA+XMS))
VID: initializing video sdl
VID: SDL plugin initialization completed
Registering HWRAM, type=e base=0x4ac0b000 size=0x400000
CONF: reserving 4096Kb at 0x4AC0B000 for 'e' (VGAEMU LFB)
CONF: reserving 12Kb at 0xC0000 for 'V' (VGAEMU Video BIOS)
SERIAL $Id$
PCM: registering player: SB REC
PCM: init
PCM: registering player: Sound Output: libao
PCM: registering player: Sound Output: libao wav writer
PCM: registering recorder: Sounds input: alsa
no PCM effect processors initialized
Initializing SDL sound output
PCM: Initializing selected plugin: Sound Output: SDL device: OK
PCM: Initializing pass-through plugin: SB REC: OK
PCM: Stream 0 allocated for "MIC INPUT"
PCM: Initializing plugin: Sounds input: alsa (w=0): OK
PCM: Stream 1 allocated for "SB DAC"
PCM: setting flag 1 for stream 1 (SB DAC)
PCM: Stream 2 allocated for "SB DMA"
PCM: setting flag 4 for stream 2 (SB DMA)
PCM: Bypassing plugin: MIDI Output: TiMidity++ plugin: (2 < 3)
fluidsynth: cannot load soundfont share/soundfonts/default.sf2
PCM: Initializing plugin: MIDI Output: FluidSynth device (w=3): Failed
PCM: Initializing plugin: MIDI Output: TiMidity++ plugin (w=2): Failed
PCM: Bypassing plugin: MIDI Output: OSS sequencer: (0 < 1)
alsa_midi: unable to open default for writing: Not a tty
PCM: Initializing plugin: MIDI Output: ALSA device (w=1): Failed
oss_midi: unable to open /dev/sequencer for writing: No such file or directory
PCM: Initializing plugin: MIDI Output: OSS sequencer (w=0): Failed
PCM: Bypassing plugin: MIDI Output: ALSA virtual device (for MT32): (0 < 3)
ERROR: MUNT: Can't find /root/.dosemu/roms/MT32_CONTROL.ROM
PCM: Initializing plugin: MIDI Output: munt device (w=3): Failed
PCM: Initializing plugin: MIDI Output: ALSA virtual device (for MT32) (w=0): OK
MIDI Input: named pipe: unable to open /root/.dosemu/run/dosemu-midi_in for reading: No such file or directory
PCM: Initializing plugin: MIDI Input: named pipe (w=0): Failed
SB: SB Initialisation
SB: Mixer init
SB: OPL3 Initialization
PCM: Stream 3 allocated for "Adlib"
MPU401: MPU-401 Initialisation
SB: mpu401 irq set to 5
SB: same irq for DSP and MPU401
MPU401: MPU-401 Initialisation - Base 0x330 
SB: Initialisation - Base 0x220
DPMI: mem init, mpool is 136273920 bytes at 0x42a15000
CONF: detected layout is "de-latin1"
CONF: detected alternate layout: (null)
TIME: using 9154 usec for updating ALRM timer
SB: Resetting SB DSP
CONF: freeing region for 'E' (EMS page frame)
CONF: freeing region for 'U' ((null))
CONF: reserving 16Kb at 0xE0000 for 'E' (EMS page frame)
CONF: reserving 16Kb at 0xE4000 for 'E' (EMS page frame)
CONF: reserving 16Kb at 0xE8000 for 'E' (EMS page frame)
CONF: reserving 16Kb at 0xEC000 for 'E' (EMS page frame)
CONF: reserving 116Kb at 0xC3000 for 'U' (Upper Memory Block (UMB, XMS 3.0))
CONF: reserving 16Kb at 0xF0000 for 'U' (Upper Memory Block (UMB, XMS 3.0))
alsa_midi (ALSA lib): confmisc.c:767:(parse_card) cannot find card '$CARD'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_card_driver returned error: No such device
alsa_midi (ALSA lib): confmisc.c:392:(snd_func_concat) error evaluating strings
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_concat returned error: No such device
alsa_midi (ALSA lib): confmisc.c:1246:(snd_func_refer) error evaluating name
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such device
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such device
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=SB,DEV=0
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=SB
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter DEV
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter DEV
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HDA-Intel.pcm.front.1:CARD=SB'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such file or directory
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=SB,DEV=0
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=SB
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=SB,DEV=0
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=SB
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=SB,DEV=0
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=SB
alsa_midi (ALSA lib): confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HDA-Intel.pcm.surround51.1:CARD=SB'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such file or directory
alsa_midi (ALSA lib): confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HDA-Intel.pcm.surround40.1:CARD=SB'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such file or directory
alsa_midi (ALSA lib): confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HDA-Intel.pcm.surround51.1:CARD=SB'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such file or directory
alsa_midi (ALSA lib): confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HDA-Intel.pcm.surround51.1:CARD=SB'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such file or directory
alsa_midi (ALSA lib): confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HDA-Intel.pcm.surround51.1:CARD=SB'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such file or directory
alsa_midi (ALSA lib): confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HDA-Intel.pcm.surround71.1:CARD=SB'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such file or directory
alsa_midi (ALSA lib): confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HDA-Intel.pcm.iec958.1:CARD=SB,AES0=4,AES1=130,AES2=0,AES3=2'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter CARD
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter CARD
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter CARD
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter CARD
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter CARD
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter CARD
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter CARD
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter CARD
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=SB,DEV=0
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=SB
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=HDMI,DEV=0
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=HDMI
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter DEV
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter DEV
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HDA-Intel.pcm.front.1:CARD=HDMI'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such file or directory
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=HDMI,DEV=0
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=HDMI
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=HDMI,DEV=0
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=HDMI
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=HDMI,DEV=0
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=HDMI
alsa_midi (ALSA lib): confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HDA-Intel.pcm.surround51.1:CARD=HDMI'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such file or directory
alsa_midi (ALSA lib): confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HDA-Intel.pcm.surround40.1:CARD=HDMI'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such file or directory
alsa_midi (ALSA lib): confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HDA-Intel.pcm.surround51.1:CARD=HDMI'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such file or directory
alsa_midi (ALSA lib): confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HDA-Intel.pcm.surround51.1:CARD=HDMI'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such file or directory
alsa_midi (ALSA lib): confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HDA-Intel.pcm.surround51.1:CARD=HDMI'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such file or directory
alsa_midi (ALSA lib): confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HDA-Intel.pcm.surround71.1:CARD=HDMI'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such file or directory
alsa_midi (ALSA lib): confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HDA-Intel.pcm.iec958.1:CARD=HDMI,AES0=4,AES1=130,AES2=0,AES3=2'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such file or directory
alsa_midi (ALSA lib): confmisc.c:1281:(snd_func_refer) Unable to find definition 'cards.HDA-Intel.pcm.hdmi.8:CARD=HDMI,AES0=4,AES1=130,AES2=0,AES3=2'
alsa_midi (ALSA lib): conf.c:4554:(_snd_config_evaluate) function snd_func_refer returned error: No such file or directory
alsa_midi (ALSA lib): conf.c:5033:(snd_config_expand) Evaluate error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter CARD
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter CARD
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter CARD
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter CARD
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter CARD
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter CARD
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter CARD
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:4884:(parse_args) Unknown parameter CARD
alsa_midi (ALSA lib): conf.c:5017:(snd_config_expand) Parse arguments error: No such file or directory
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=HDMI,DEV=0
alsa_midi (ALSA lib): conf.c:5000:(snd_config_expand) Unknown parameters CARD=HDMI
@newbluemoon

This comment has been minimized.

Show comment
Hide comment
@newbluemoon

newbluemoon Nov 19, 2017

Contributor

I don’t know if it’s of relevance, but I just noticed there is a timidity plugin. Timidity is broken on musl and instantly crashes. But then real mode programs would be affected, too, weren’t they?

Contributor

newbluemoon commented Nov 19, 2017

I don’t know if it’s of relevance, but I just noticed there is a timidity plugin. Timidity is broken on musl and instantly crashes. But then real mode programs would be affected, too, weren’t they?

@stsp

This comment has been minimized.

Show comment
Hide comment
@stsp

stsp Nov 19, 2017

Owner

Timidity plugin launches timidity in a separate
process. If it crashes, dosemu survives.
Plus dosemu2 prefers fluidsynth over timidity
(unfortunately fluidsynth is very dosemu-unfriendly
these days, so I ripped its sources and compile
them with dosemu... there seems to be a
fluidsynth fork started that accepted some of my
patches).

Owner

stsp commented Nov 19, 2017

Timidity plugin launches timidity in a separate
process. If it crashes, dosemu survives.
Plus dosemu2 prefers fluidsynth over timidity
(unfortunately fluidsynth is very dosemu-unfriendly
these days, so I ripped its sources and compile
them with dosemu... there seems to be a
fluidsynth fork started that accepted some of my
patches).

@stsp

This comment has been minimized.

Show comment
Hide comment
@stsp

stsp Nov 19, 2017

Owner
PCM: Bypassing plugin: MIDI Output: TiMidity++ plugin: (2 < 3)
fluidsynth: cannot load soundfont share/soundfonts/default.sf2
PCM: Initializing plugin: MIDI Output: FluidSynth device (w=3): Failed
PCM: Initializing plugin: MIDI Output: TiMidity++ plugin (w=2): Failed

Actually dosemu was not able to init any midi plugin.

Owner

stsp commented Nov 19, 2017

PCM: Bypassing plugin: MIDI Output: TiMidity++ plugin: (2 < 3)
fluidsynth: cannot load soundfont share/soundfonts/default.sf2
PCM: Initializing plugin: MIDI Output: FluidSynth device (w=3): Failed
PCM: Initializing plugin: MIDI Output: TiMidity++ plugin (w=2): Failed

Actually dosemu was not able to init any midi plugin.

@stsp

This comment has been minimized.

Show comment
Hide comment
@stsp

stsp Nov 19, 2017

Owner
alsa_midi: unable to open default for writing: Not a tty
PCM: Initializing plugin: MIDI Output: ALSA device (w=1): Failed
oss_midi: unable to open /dev/sequencer for writing: No such file or directory
PCM: Initializing plugin: MIDI Output: OSS sequencer (w=0): Failed
Owner

stsp commented Nov 19, 2017

alsa_midi: unable to open default for writing: Not a tty
PCM: Initializing plugin: MIDI Output: ALSA device (w=1): Failed
oss_midi: unable to open /dev/sequencer for writing: No such file or directory
PCM: Initializing plugin: MIDI Output: OSS sequencer (w=0): Failed
@newbluemoon

This comment has been minimized.

Show comment
Hide comment
@newbluemoon

newbluemoon Nov 19, 2017

Contributor

fluidsynth: cannot load soundfont share/soundfonts/default.sf2

Actually, I did try to put a default.sf2 in /usr/share/soundfonts, with no difference.

Contributor

newbluemoon commented Nov 19, 2017

fluidsynth: cannot load soundfont share/soundfonts/default.sf2

Actually, I did try to put a default.sf2 in /usr/share/soundfonts, with no difference.

@stsp

This comment has been minimized.

Show comment
Hide comment
@stsp

stsp Nov 19, 2017

Owner

Try playing some midi file with fluidsynth.
Does it work?

Owner

stsp commented Nov 19, 2017

Try playing some midi file with fluidsynth.
Does it work?

@newbluemoon

This comment has been minimized.

Show comment
Hide comment
@newbluemoon

newbluemoon Nov 19, 2017

Contributor

Works:

fluidsynth -a alsa -m alsa_seq -l -i /usr/share/soundfonts/default.sf2 test.midi

Doesn’t work:

fluidsynth -a alsa -m alsa_seq -l test.midi
fluidsynth: error: Unable to open file "share/soundfonts/default.sf2"

I think this might be a bug in the distro’s package.

Contributor

newbluemoon commented Nov 19, 2017

Works:

fluidsynth -a alsa -m alsa_seq -l -i /usr/share/soundfonts/default.sf2 test.midi

Doesn’t work:

fluidsynth -a alsa -m alsa_seq -l test.midi
fluidsynth: error: Unable to open file "share/soundfonts/default.sf2"

I think this might be a bug in the distro’s package.

@stsp

This comment has been minimized.

Show comment
Hide comment
@stsp

stsp Nov 19, 2017

Owner

You don't need alsa_seq.
Please try file output, then see if the
resulting file is good.

Owner

stsp commented Nov 19, 2017

You don't need alsa_seq.
Please try file output, then see if the
resulting file is good.

@stsp

This comment has been minimized.

Show comment
Hide comment
@stsp

stsp Nov 19, 2017

Owner

I think this log is confusing:
alsa_midi installs the logger for alsa,
but it is SDL that tries to open the
alsa device, spamming our log.
Try the same log with dosemu -X

Owner

stsp commented Nov 19, 2017

I think this log is confusing:
alsa_midi installs the logger for alsa,
but it is SDL that tries to open the
alsa device, spamming our log.
Try the same log with dosemu -X

@newbluemoon

This comment has been minimized.

Show comment
Hide comment
@newbluemoon

newbluemoon Nov 19, 2017

Contributor

File output works. Sound is fine.
I was also able to fix fluidsynth’s default soundfont path.
Log follows shortly ...

Contributor

newbluemoon commented Nov 19, 2017

File output works. Sound is fine.
I was also able to fix fluidsynth’s default soundfont path.
Log follows shortly ...

@stsp

This comment has been minimized.

Show comment
Hide comment
@stsp

stsp Nov 19, 2017

Owner

Sorry! Dosemu exited with signal 11.

So maybe musl resets the dosemu's SIGSEGV
handler.

Owner

stsp commented Nov 19, 2017

Sorry! Dosemu exited with signal 11.

So maybe musl resets the dosemu's SIGSEGV
handler.

@newbluemoon

This comment has been minimized.

Show comment
Hide comment
@newbluemoon

newbluemoon Nov 19, 2017

Contributor

-X -D9+S:

CONF: config variable parser_version_3 set
CONF: config variable c_system set
CONF: Parsing built-in dosemu.conf file.
CONF: config variable version_3_style_used set
CONF: Parsing built-in global.conf file.
CONF: config variable version_3_style_used unset
CONF: config variable version_3_style_used set
CONF: opened include file /etc/dosemu/dosemu.conf
CONF: closed include file /etc/dosemu/dosemu.conf
CONF: mapping driver = 'auto'
debug flags: -a+cw
CONF: Disabling use of pentium timer
CONF: dosbanner on
CONF: timer freq=18, update=54925
CONF: CPU set to 586
CONF: JIT CPUEMU set to 0 for 586
CONF: CPU VM set to -1
CONF: 8192k bytes EMS memory
CONF: EMS-frame = 0xe000
CONF: DPMI-Server on (0x20000)
CONF: DPMI linear reserve base addr = 0xffffffff
CONF: DPMI linear reserve size = 0x8000
CONF: PM DOS API Translator on
CONF: No DJGPP NULL deref checks: on
CONF: 8192k bytes XMS memory
CONF: dosemu not running on console
CONF: time mode = 'bios'
SER: directory /var/lock namestub LCK.. binary No
MOUSE: /dev/input/mice, type 7 using internaldriver: yes, emulate3buttons: no baudrate: 0
CONF: Keyboard-layout keyb-user
CONF: **** Warning: floppy /dev/fd0 not accessible, disabled
CONF: fastfloppy = 1
CONF: IPX support off
CONF(LPT0) f: (null)   c: lpr -l  t: 20  port: 0
CONF(LPT1) f: (null)   c: lpr -P cups-pdf  t: 20  port: 0
CONF: not allowing speaker port access
CONF: Packet Driver enabled.
CONF: disk type 'Directory' drive C:
CONF: disk type 'Directory' drive D:
CONF: disk type 'Directory' drive E:
CONF: cdrom MSCD0001 on /dev/cdrom
CONF: config variable c_system unset
debug flags: 9+S
Linux kernel 4.9.63; CPU speed is 2200000000 Hz
CPU-EMU speed is 2200 MHz
CONF: not running on console
CONF: running exclusively as ROOT: uid=0 (cached 0) gid=0 (cached 0)
CONF: priv operations unavailable
DBG_FD already set
DOSEMU-2.0pre7.1 is coming up on Linux version 4.9.63_1 #1 SMP PREEMPT Sat Nov 18 19:58:45 UTC 2017 x86_64
Compiled with gcc version 7.2.0 64bit
CFLAGS: -Wall -Wstrict-prototypes -Wmissing-declarations -Wnested-externs -fms-extensions -pthread -imacros config.h -Wno-unused-result -fpie -fplan9-extensions -Wno-maybe-uninitialized -ggdb3 -D_FORTIFY_SOURCE=2 -mtune=generic -O2 -pipe
CONF: reserving 640Kb at 0x00000 for 'd' (Base DOS memory (first 640K))
CONF: reserving 48Kb at 0xF4000 for 'r' (Dosemu reserved area)
initial register values: fs: 0x0000  gs: 0x0000 eflags: 0x0246
initial segment bases: fs: 0x7f00c748bb88  gs: 0
CONF: reserving 128Kb at 0xA0000 for 'v' (Video memory)
Conventional memory mapped from 0x7f00c7375000 to 0x41330000
DPMI memory mapped to 0x41440000 (reserve) and to 0x43440000 (main)
Using V86 mode inside KVM
CONF: reserving 8256Kb at 0x100000 for 'x' (Extended memory (HMA+XMS))
VID: initializing video X
X: X_init
Registering HWRAM, type=e base=0x4b636000 size=0x400000
CONF: reserving 4096Kb at 0x4B636000 for 'e' (VGAEMU LFB)
CONF: reserving 12Kb at 0xC0000 for 'V' (VGAEMU Video BIOS)
SERIAL $Id$
PCM: registering player: SB REC
PCM: init
PCM: registering player: Sound Output: libao
PCM: registering player: Sound Output: libao wav writer
PCM: registering recorder: Sounds input: alsa
no PCM effect processors initialized
PCM: Initializing selected plugin: Sound Output: libao: OK
PCM: Initializing pass-through plugin: SB REC: OK
PCM: Stream 0 allocated for "MIC INPUT"
PCM: Initializing plugin: Sounds input: alsa (w=0): OK
PCM: Stream 1 allocated for "SB DAC"
PCM: setting flag 1 for stream 1 (SB DAC)
PCM: Stream 2 allocated for "SB DMA"
PCM: setting flag 4 for stream 2 (SB DMA)
PCM: Bypassing plugin: MIDI Output: TiMidity++ plugin: (2 < 3)
fluidsynth: loaded soundfont /usr/share/soundfonts/default.sf2 ID=1
PCM: Stream 3 allocated for "MIDI"
PCM: Initializing plugin: MIDI Output: FluidSynth device (w=3): OK
PCM: Bypassing plugin: MIDI Output: ALSA virtual device (for MT32): (0 < 3)
ERROR: MUNT: Can't find /root/.dosemu/roms/MT32_CONTROL.ROM
PCM: Initializing plugin: MIDI Output: munt device (w=3): Failed
PCM: Initializing plugin: MIDI Output: ALSA virtual device (for MT32) (w=0): OK
MIDI Input: named pipe: unable to open /root/.dosemu/run/dosemu-midi_in for reading: No such file or directory
PCM: Initializing plugin: MIDI Input: named pipe (w=0): Failed
SB: SB Initialisation
SB: Mixer init
SB: OPL3 Initialization
PCM: Stream 4 allocated for "Adlib"
MPU401: MPU-401 Initialisation
SB: mpu401 irq set to 5
SB: same irq for DSP and MPU401
MPU401: MPU-401 Initialisation - Base 0x330 
SB: Initialisation - Base 0x220
DPMI: mem init, mpool is 136273920 bytes at 0x43440000
CONF: detected layout is "de-latin1"
CONF: detected alternate layout: (null)
TIME: using 9154 usec for updating ALRM timer
SB: Resetting SB DSP
CONF: freeing region for 'E' (EMS page frame)
CONF: freeing region for 'U' ((null))
CONF: reserving 16Kb at 0xE0000 for 'E' (EMS page frame)
CONF: reserving 16Kb at 0xE4000 for 'E' (EMS page frame)
CONF: reserving 16Kb at 0xE8000 for 'E' (EMS page frame)
CONF: reserving 16Kb at 0xEC000 for 'E' (EMS page frame)
CONF: reserving 116Kb at 0xC3000 for 'U' (Upper Memory Block (UMB, XMS 3.0))
CONF: reserving 16Kb at 0xF0000 for 'U' (Upper Memory Block (UMB, XMS 3.0))

Contributor

newbluemoon commented Nov 19, 2017

-X -D9+S:

CONF: config variable parser_version_3 set
CONF: config variable c_system set
CONF: Parsing built-in dosemu.conf file.
CONF: config variable version_3_style_used set
CONF: Parsing built-in global.conf file.
CONF: config variable version_3_style_used unset
CONF: config variable version_3_style_used set
CONF: opened include file /etc/dosemu/dosemu.conf
CONF: closed include file /etc/dosemu/dosemu.conf
CONF: mapping driver = 'auto'
debug flags: -a+cw
CONF: Disabling use of pentium timer
CONF: dosbanner on
CONF: timer freq=18, update=54925
CONF: CPU set to 586
CONF: JIT CPUEMU set to 0 for 586
CONF: CPU VM set to -1
CONF: 8192k bytes EMS memory
CONF: EMS-frame = 0xe000
CONF: DPMI-Server on (0x20000)
CONF: DPMI linear reserve base addr = 0xffffffff
CONF: DPMI linear reserve size = 0x8000
CONF: PM DOS API Translator on
CONF: No DJGPP NULL deref checks: on
CONF: 8192k bytes XMS memory
CONF: dosemu not running on console
CONF: time mode = 'bios'
SER: directory /var/lock namestub LCK.. binary No
MOUSE: /dev/input/mice, type 7 using internaldriver: yes, emulate3buttons: no baudrate: 0
CONF: Keyboard-layout keyb-user
CONF: **** Warning: floppy /dev/fd0 not accessible, disabled
CONF: fastfloppy = 1
CONF: IPX support off
CONF(LPT0) f: (null)   c: lpr -l  t: 20  port: 0
CONF(LPT1) f: (null)   c: lpr -P cups-pdf  t: 20  port: 0
CONF: not allowing speaker port access
CONF: Packet Driver enabled.
CONF: disk type 'Directory' drive C:
CONF: disk type 'Directory' drive D:
CONF: disk type 'Directory' drive E:
CONF: cdrom MSCD0001 on /dev/cdrom
CONF: config variable c_system unset
debug flags: 9+S
Linux kernel 4.9.63; CPU speed is 2200000000 Hz
CPU-EMU speed is 2200 MHz
CONF: not running on console
CONF: running exclusively as ROOT: uid=0 (cached 0) gid=0 (cached 0)
CONF: priv operations unavailable
DBG_FD already set
DOSEMU-2.0pre7.1 is coming up on Linux version 4.9.63_1 #1 SMP PREEMPT Sat Nov 18 19:58:45 UTC 2017 x86_64
Compiled with gcc version 7.2.0 64bit
CFLAGS: -Wall -Wstrict-prototypes -Wmissing-declarations -Wnested-externs -fms-extensions -pthread -imacros config.h -Wno-unused-result -fpie -fplan9-extensions -Wno-maybe-uninitialized -ggdb3 -D_FORTIFY_SOURCE=2 -mtune=generic -O2 -pipe
CONF: reserving 640Kb at 0x00000 for 'd' (Base DOS memory (first 640K))
CONF: reserving 48Kb at 0xF4000 for 'r' (Dosemu reserved area)
initial register values: fs: 0x0000  gs: 0x0000 eflags: 0x0246
initial segment bases: fs: 0x7f00c748bb88  gs: 0
CONF: reserving 128Kb at 0xA0000 for 'v' (Video memory)
Conventional memory mapped from 0x7f00c7375000 to 0x41330000
DPMI memory mapped to 0x41440000 (reserve) and to 0x43440000 (main)
Using V86 mode inside KVM
CONF: reserving 8256Kb at 0x100000 for 'x' (Extended memory (HMA+XMS))
VID: initializing video X
X: X_init
Registering HWRAM, type=e base=0x4b636000 size=0x400000
CONF: reserving 4096Kb at 0x4B636000 for 'e' (VGAEMU LFB)
CONF: reserving 12Kb at 0xC0000 for 'V' (VGAEMU Video BIOS)
SERIAL $Id$
PCM: registering player: SB REC
PCM: init
PCM: registering player: Sound Output: libao
PCM: registering player: Sound Output: libao wav writer
PCM: registering recorder: Sounds input: alsa
no PCM effect processors initialized
PCM: Initializing selected plugin: Sound Output: libao: OK
PCM: Initializing pass-through plugin: SB REC: OK
PCM: Stream 0 allocated for "MIC INPUT"
PCM: Initializing plugin: Sounds input: alsa (w=0): OK
PCM: Stream 1 allocated for "SB DAC"
PCM: setting flag 1 for stream 1 (SB DAC)
PCM: Stream 2 allocated for "SB DMA"
PCM: setting flag 4 for stream 2 (SB DMA)
PCM: Bypassing plugin: MIDI Output: TiMidity++ plugin: (2 < 3)
fluidsynth: loaded soundfont /usr/share/soundfonts/default.sf2 ID=1
PCM: Stream 3 allocated for "MIDI"
PCM: Initializing plugin: MIDI Output: FluidSynth device (w=3): OK
PCM: Bypassing plugin: MIDI Output: ALSA virtual device (for MT32): (0 < 3)
ERROR: MUNT: Can't find /root/.dosemu/roms/MT32_CONTROL.ROM
PCM: Initializing plugin: MIDI Output: munt device (w=3): Failed
PCM: Initializing plugin: MIDI Output: ALSA virtual device (for MT32) (w=0): OK
MIDI Input: named pipe: unable to open /root/.dosemu/run/dosemu-midi_in for reading: No such file or directory
PCM: Initializing plugin: MIDI Input: named pipe (w=0): Failed
SB: SB Initialisation
SB: Mixer init
SB: OPL3 Initialization
PCM: Stream 4 allocated for "Adlib"
MPU401: MPU-401 Initialisation
SB: mpu401 irq set to 5
SB: same irq for DSP and MPU401
MPU401: MPU-401 Initialisation - Base 0x330 
SB: Initialisation - Base 0x220
DPMI: mem init, mpool is 136273920 bytes at 0x43440000
CONF: detected layout is "de-latin1"
CONF: detected alternate layout: (null)
TIME: using 9154 usec for updating ALRM timer
SB: Resetting SB DSP
CONF: freeing region for 'E' (EMS page frame)
CONF: freeing region for 'U' ((null))
CONF: reserving 16Kb at 0xE0000 for 'E' (EMS page frame)
CONF: reserving 16Kb at 0xE4000 for 'E' (EMS page frame)
CONF: reserving 16Kb at 0xE8000 for 'E' (EMS page frame)
CONF: reserving 16Kb at 0xEC000 for 'E' (EMS page frame)
CONF: reserving 116Kb at 0xC3000 for 'U' (Upper Memory Block (UMB, XMS 3.0))
CONF: reserving 16Kb at 0xF0000 for 'U' (Upper Memory Block (UMB, XMS 3.0))

@stsp

This comment has been minimized.

Show comment
Hide comment
@stsp

stsp Nov 19, 2017

Owner

The log should now be fixed.

Owner

stsp commented Nov 19, 2017

The log should now be fixed.

@stsp

This comment has been minimized.

Show comment
Hide comment
@stsp

stsp Nov 19, 2017

Owner

Please try $_cpu_vm = "emulated" in dosemu.conf.
I suspect it doesn't work with musl too?

Owner

stsp commented Nov 19, 2017

Please try $_cpu_vm = "emulated" in dosemu.conf.
I suspect it doesn't work with musl too?

@newbluemoon

This comment has been minimized.

Show comment
Hide comment
@newbluemoon

newbluemoon Nov 19, 2017

Contributor

$_cpu_vm = "emulated" doesn’t work.

Contributor

newbluemoon commented Nov 19, 2017

$_cpu_vm = "emulated" doesn’t work.

@stsp

This comment has been minimized.

Show comment
Hide comment
@stsp

stsp Nov 19, 2017

Owner

And with glibc?

Owner

stsp commented Nov 19, 2017

And with glibc?

@newbluemoon

This comment has been minimized.

Show comment
Hide comment
@newbluemoon

newbluemoon Nov 19, 2017

Contributor

Doesn’t work with glibc either. After hitting return the cursor keeps blinking, nothing happens.

Contributor

newbluemoon commented Nov 19, 2017

Doesn’t work with glibc either. After hitting return the cursor keeps blinking, nothing happens.

@stsp

This comment has been minimized.

Show comment
Hide comment
@stsp

stsp Nov 19, 2017

Owner

Try $_cpu_emu = "vm86sim"

Owner

stsp commented Nov 19, 2017

Try $_cpu_emu = "vm86sim"

@newbluemoon

This comment has been minimized.

Show comment
Hide comment
@newbluemoon

newbluemoon Nov 19, 2017

Contributor

Ah, sorry. $_cpu_vm = emulated does work with glibc and default $_cpu_emu. Had the latter still on fullsim from when experimenting, vm86sim works, too.

On musl $_cpu_emu = "vm86sim" with $_cpu_vm = "emulated" doesn’t work (signal 11).

Contributor

newbluemoon commented Nov 19, 2017

Ah, sorry. $_cpu_vm = emulated does work with glibc and default $_cpu_emu. Had the latter still on fullsim from when experimenting, vm86sim works, too.

On musl $_cpu_emu = "vm86sim" with $_cpu_vm = "emulated" doesn’t work (signal 11).

@stsp

This comment has been minimized.

Show comment
Hide comment
@stsp

stsp Nov 19, 2017

Owner

Ah, sorry. $_cpu_vm = emulated does work with glibc and default $_cpu_emu.
Had the latter still on fullsim from when experimenting, vm86sim works, too.

Much better but still not perfect.
"fullsim" and "vm86sim" do not differ
unless you try DPMI app. They otherwise
should work similar.

On musl $_cpu_emu = "vm86sim" with $_cpu_vm = "emulated" doesn’t work (signal 11).

So $_cpu_vm = "emulated" doesn't work on
musl with any $_cpu_vm including default one?

Owner

stsp commented Nov 19, 2017

Ah, sorry. $_cpu_vm = emulated does work with glibc and default $_cpu_emu.
Had the latter still on fullsim from when experimenting, vm86sim works, too.

Much better but still not perfect.
"fullsim" and "vm86sim" do not differ
unless you try DPMI app. They otherwise
should work similar.

On musl $_cpu_emu = "vm86sim" with $_cpu_vm = "emulated" doesn’t work (signal 11).

So $_cpu_vm = "emulated" doesn't work on
musl with any $_cpu_vm including default one?

@newbluemoon

This comment has been minimized.

Show comment
Hide comment
@newbluemoon

newbluemoon Nov 19, 2017

Contributor

Ok, I think I should have been more precise: with not working I meant DPMI is not working.

Contributor

newbluemoon commented Nov 19, 2017

Ok, I think I should have been more precise: with not working I meant DPMI is not working.

@stsp

This comment has been minimized.

Show comment
Hide comment
@stsp

stsp Nov 19, 2017

Owner

I was asking in general: does $_cpu_vm = "emulated"
work at all with musl?

Owner

stsp commented Nov 19, 2017

I was asking in general: does $_cpu_vm = "emulated"
work at all with musl?

@newbluemoon

This comment has been minimized.

Show comment
Hide comment
@newbluemoon

newbluemoon Nov 19, 2017

Contributor

Yes, it does. Until a protected mode program is started. Everything else seems to work fine.

Contributor

newbluemoon commented Nov 19, 2017

Yes, it does. Until a protected mode program is started. Everything else seems to work fine.

@stsp

This comment has been minimized.

Show comment
Hide comment
@stsp

stsp Nov 19, 2017

Owner

Even with $_cpu_emu commented out (which means "vm86")?

Owner

stsp commented Nov 19, 2017

Even with $_cpu_emu commented out (which means "vm86")?

@newbluemoon

This comment has been minimized.

Show comment
Hide comment
@newbluemoon

newbluemoon Dec 21, 2017

Contributor

Yes, I do :) I have:

$ git log
commit f68fe0adc07963254f4eafc3994cde15f0832ddb (HEAD -> musl, upstream/musl)
Author: Stas Sergeev <stsp@users.sourceforge.net>
Date:   Tue Nov 21 17:41:29 2017 +0300

    musl workaround 4 [#537]

commit b1f1beb92544699f0757364b652995024cd207e1
Author: Stas Sergeev <stsp@users.sourceforge.net>
Date:   Tue Nov 21 17:17:38 2017 +0300

    musl workaround 3 [#537]

commit b781b8908941b22cd6034e544b77b0cf6e51358a
Author: Stas Sergeev <stsp@users.sourceforge.net>
Date:   Tue Nov 21 13:55:43 2017 +0300

    signal: musl work-around 2 [#537]

commit b932c2688c38900b1574a96c1f2446567a0fdcfd
Author: Stas Sergeev <stsp@users.sourceforge.net>
Date:   Tue Nov 21 13:47:08 2017 +0300

    signal: musl sigaltstack() work-around 1 [#537]

commit a77aa74d609c9d4d39641b511774063782e76a09
Author: Stas Sergeev <stsp@users.sourceforge.net>
Date:   Tue Nov 21 01:52:41 2017 +0300

    signal: dont reset gs/fs bases if the reg is non-zero [#537]

...
Contributor

newbluemoon commented Dec 21, 2017

Yes, I do :) I have:

$ git log
commit f68fe0adc07963254f4eafc3994cde15f0832ddb (HEAD -> musl, upstream/musl)
Author: Stas Sergeev <stsp@users.sourceforge.net>
Date:   Tue Nov 21 17:41:29 2017 +0300

    musl workaround 4 [#537]

commit b1f1beb92544699f0757364b652995024cd207e1
Author: Stas Sergeev <stsp@users.sourceforge.net>
Date:   Tue Nov 21 17:17:38 2017 +0300

    musl workaround 3 [#537]

commit b781b8908941b22cd6034e544b77b0cf6e51358a
Author: Stas Sergeev <stsp@users.sourceforge.net>
Date:   Tue Nov 21 13:55:43 2017 +0300

    signal: musl work-around 2 [#537]

commit b932c2688c38900b1574a96c1f2446567a0fdcfd
Author: Stas Sergeev <stsp@users.sourceforge.net>
Date:   Tue Nov 21 13:47:08 2017 +0300

    signal: musl sigaltstack() work-around 1 [#537]

commit a77aa74d609c9d4d39641b511774063782e76a09
Author: Stas Sergeev <stsp@users.sourceforge.net>
Date:   Tue Nov 21 01:52:41 2017 +0300

    signal: dont reset gs/fs bases if the reg is non-zero [#537]

...
@newbluemoon

This comment has been minimized.

Show comment
Hide comment
@newbluemoon

newbluemoon Dec 21, 2017

Contributor

Just pushed it to my fork of dosemu2.

Contributor

newbluemoon commented Dec 21, 2017

Just pushed it to my fork of dosemu2.

@stsp

This comment has been minimized.

Show comment
Hide comment
@stsp

stsp Dec 21, 2017

Owner

Great!
You only need newbluemoon@b932c26

Owner

stsp commented Dec 21, 2017

Great!
You only need newbluemoon@b932c26

@newbluemoon

This comment has been minimized.

Show comment
Hide comment
@newbluemoon

newbluemoon Dec 21, 2017

Contributor

Ok. But I’ll probably won’t be able to test it before tomorrow.

Contributor

newbluemoon commented Dec 21, 2017

Ok. But I’ll probably won’t be able to test it before tomorrow.

@amluto

This comment has been minimized.

Show comment
Hide comment
@amluto

amluto Dec 21, 2017

I think that calling into libc at all with overridden FS/GS is asking for trouble.
Why don't you just inline the SYSCALL instruction?

Because this is non-portable, and I do not
call to libc - I call a syscall. glibc provides
an asm syscall wrapper, so that works as
expected. Maybe it can also be provided
with vdso on some systems. Plus, not all
CPUs support SYSCALL.

syscall() is non-portable.

On x86_64, the SYSCALL instruction is guaranteed to work on Linux. On x86_32, int80 is guaranteed to work. That's the ABI. The vDSO is optional, and you could use that, too, but it's very awkward due to a lack of available registers. Inlining a system call using SYSCALL or int80 is completely supported on Linux.

Overall, I simply
don't understand why should I deal with all
this mess - its clearly a kernel bug, why are
you asking the programmers to do a
difficult, non-portable workarounds? It would
be much better to provide them with the
environment where they can write portable
and simple code, w/o checking cpuid for
syscall support, OS type, etc etc.

I'm confused as to what you mean. modify_ldt() is extremely non-portable. The whole way that TLS works is quite non-portable. I doubt that the details of signal handling are particularly portable.

and it needs to be very clear what the semantics are with and without FSGSBASE.

I think we discussed that, but I don't remember
an outcome. IIRC Linus supported an opinion
that in case of fsgsbase, you only need to
restore the base itself and reset selector to 0.

Presumably we'd save and restore the base and selector and always let the base take precedence over the descriptor table's idea of what the base is.

The multithreaded semantics need to be clear, too.

What problems are there with threads?
I think each thread may have different tls,
and you should restore the one that belongs
to the thread taking a signal.

Taking as step back, there seem to be two issues here.

  1. When a signal is delivered, x86_32 saves fs and gs in the signal frame. When the signal handler returnns, x86_32 restores fs and gs from their saved values. x86_64 does not do this. I don't think we can change this on x86_64 by default, but I see no reason we couldn't make it an optional feature via a signal handler flag or an ss_flags value, perhaps.

  2. If you're running some foreign binary (e.g. a DOS program) that loads its own values into fs and/or gs, and a signal is delivered, the normal TLS segments are not reloaded by the kernel when the signal is delivered. This seems to be the case on x86_32 and x86_64. I see no way to make signal handling reliable in this context without explicit code in the signal handler to restore the segment registers. On x86_32, it's easier, since you can probably arrange for fs and gs to be constant. On x86_64, there's no way around knowing the required base address.

If you want to fix #2, it would need a sigaltstack()-like mechanism. As it stands, the kernel has no idea what the TLS base is for a given thread. Sure, it (probably) got set using arch_prctl() once, but there is no reason for the kernel to remember that value after user code overrides the selector, and, on FSGSBASE kernels (whenever those show up), arch_prctl() won't even be necessary. So there would need to be a way to tell the kernel what FSBASE and GSBASE to load when delivering a signal, and that would need to depend on the thread.

amluto commented Dec 21, 2017

I think that calling into libc at all with overridden FS/GS is asking for trouble.
Why don't you just inline the SYSCALL instruction?

Because this is non-portable, and I do not
call to libc - I call a syscall. glibc provides
an asm syscall wrapper, so that works as
expected. Maybe it can also be provided
with vdso on some systems. Plus, not all
CPUs support SYSCALL.

syscall() is non-portable.

On x86_64, the SYSCALL instruction is guaranteed to work on Linux. On x86_32, int80 is guaranteed to work. That's the ABI. The vDSO is optional, and you could use that, too, but it's very awkward due to a lack of available registers. Inlining a system call using SYSCALL or int80 is completely supported on Linux.

Overall, I simply
don't understand why should I deal with all
this mess - its clearly a kernel bug, why are
you asking the programmers to do a
difficult, non-portable workarounds? It would
be much better to provide them with the
environment where they can write portable
and simple code, w/o checking cpuid for
syscall support, OS type, etc etc.

I'm confused as to what you mean. modify_ldt() is extremely non-portable. The whole way that TLS works is quite non-portable. I doubt that the details of signal handling are particularly portable.

and it needs to be very clear what the semantics are with and without FSGSBASE.

I think we discussed that, but I don't remember
an outcome. IIRC Linus supported an opinion
that in case of fsgsbase, you only need to
restore the base itself and reset selector to 0.

Presumably we'd save and restore the base and selector and always let the base take precedence over the descriptor table's idea of what the base is.

The multithreaded semantics need to be clear, too.

What problems are there with threads?
I think each thread may have different tls,
and you should restore the one that belongs
to the thread taking a signal.

Taking as step back, there seem to be two issues here.

  1. When a signal is delivered, x86_32 saves fs and gs in the signal frame. When the signal handler returnns, x86_32 restores fs and gs from their saved values. x86_64 does not do this. I don't think we can change this on x86_64 by default, but I see no reason we couldn't make it an optional feature via a signal handler flag or an ss_flags value, perhaps.

  2. If you're running some foreign binary (e.g. a DOS program) that loads its own values into fs and/or gs, and a signal is delivered, the normal TLS segments are not reloaded by the kernel when the signal is delivered. This seems to be the case on x86_32 and x86_64. I see no way to make signal handling reliable in this context without explicit code in the signal handler to restore the segment registers. On x86_32, it's easier, since you can probably arrange for fs and gs to be constant. On x86_64, there's no way around knowing the required base address.

If you want to fix #2, it would need a sigaltstack()-like mechanism. As it stands, the kernel has no idea what the TLS base is for a given thread. Sure, it (probably) got set using arch_prctl() once, but there is no reason for the kernel to remember that value after user code overrides the selector, and, on FSGSBASE kernels (whenever those show up), arch_prctl() won't even be necessary. So there would need to be a way to tell the kernel what FSBASE and GSBASE to load when delivering a signal, and that would need to depend on the thread.

@stsp

This comment has been minimized.

Show comment
Hide comment
@stsp

stsp Dec 22, 2017

Owner

On x86_64, the SYSCALL instruction is guaranteed to work on Linux.

Ok. In this case perhaps it would be enough
if I codify arch_prctl() into a manual syscall.
Minimal efforts and will likely work in practice,
even though you'll say its wrong to even use
a Cish sighandler at all. gcc already did us a
favour and allowed to disable the stack-protector
instrumentation on a per-function basis, so the
handler itself is fine. But its quite bad that all
these years I have to ask different projects to
please do me a favour just because kernel
people don't . :)

Presumably we'd save and restore the base and selector
and always let the base take precedence over the descriptor table's idea of what the base is.

For context switch or for sigcontext?
I think my code can break, as currently it saves a
"snapshot" of fs/gs and its bases, and restores base
in a sighandler only if the selector was zero. Allowing
non-zero for both, will likely add some problems for
those who restore things by hands.

When a signal is delivered, x86_32 saves fs and gs in the signal frame.

I am sure you can do the same on x86_64 too.
Restoring may be a problem, but saving should
be safe?

When the signal handler returnns, x86_32 restores fs and
gs from their saved values. x86_64 does not do this. I don't
think we can change this on x86_64 by default

But I think this can be considered as a possibility.
Do you know any software besides dosemu/wine
that would care at all? And dosemu stores these
values into sigcontext and restores by hands from
that very same sigcontext. If you add an unconditional
restoring, dosemu should survive. I remember this
didn't work quite right with SS as dosemu was
putting SS into a different location. This was an
unfortunate oversight. With fs/gs we can avoid
this as dosemu1/2 puts them into the right place
of the sigcontext.

If you want to fix 2

Given the simplicity of 1, I'd say I want to fix both. :)

If you want to fix #2, it would need a sigaltstack()-like mechanism.
As it stands, the kernel has no idea what the TLS base is for a given thread.

Yes, I see. Perhaps sigaction() can get a new
flag which will make him to remember the TLS base
of the caller? No, as it is not guaranteed that the
caller thread will be receiving the signal...
Abuse set_thread_area() somehow? Also no...
Have you considered some suitable API for this?
Looks like adding a new command to arch_prctl()
is an only solution?

Owner

stsp commented Dec 22, 2017

On x86_64, the SYSCALL instruction is guaranteed to work on Linux.

Ok. In this case perhaps it would be enough
if I codify arch_prctl() into a manual syscall.
Minimal efforts and will likely work in practice,
even though you'll say its wrong to even use
a Cish sighandler at all. gcc already did us a
favour and allowed to disable the stack-protector
instrumentation on a per-function basis, so the
handler itself is fine. But its quite bad that all
these years I have to ask different projects to
please do me a favour just because kernel
people don't . :)

Presumably we'd save and restore the base and selector
and always let the base take precedence over the descriptor table's idea of what the base is.

For context switch or for sigcontext?
I think my code can break, as currently it saves a
"snapshot" of fs/gs and its bases, and restores base
in a sighandler only if the selector was zero. Allowing
non-zero for both, will likely add some problems for
those who restore things by hands.

When a signal is delivered, x86_32 saves fs and gs in the signal frame.

I am sure you can do the same on x86_64 too.
Restoring may be a problem, but saving should
be safe?

When the signal handler returnns, x86_32 restores fs and
gs from their saved values. x86_64 does not do this. I don't
think we can change this on x86_64 by default

But I think this can be considered as a possibility.
Do you know any software besides dosemu/wine
that would care at all? And dosemu stores these
values into sigcontext and restores by hands from
that very same sigcontext. If you add an unconditional
restoring, dosemu should survive. I remember this
didn't work quite right with SS as dosemu was
putting SS into a different location. This was an
unfortunate oversight. With fs/gs we can avoid
this as dosemu1/2 puts them into the right place
of the sigcontext.

If you want to fix 2

Given the simplicity of 1, I'd say I want to fix both. :)

If you want to fix #2, it would need a sigaltstack()-like mechanism.
As it stands, the kernel has no idea what the TLS base is for a given thread.

Yes, I see. Perhaps sigaction() can get a new
flag which will make him to remember the TLS base
of the caller? No, as it is not guaranteed that the
caller thread will be receiving the signal...
Abuse set_thread_area() somehow? Also no...
Have you considered some suitable API for this?
Looks like adding a new command to arch_prctl()
is an only solution?

@stsp

This comment has been minimized.

Show comment
Hide comment
@stsp

stsp Dec 22, 2017

Owner

As it stands, the kernel has no idea what the TLS base is for a given thread.

Ok, so in this case it is indeed a missing feature
but not a bug.
Given that gcc already solved the biggest part
of the problem by allowing to disable stack
protector selectively, it may be the right time
to try some very minimalistic work-around like
codifying only arch_prctl() in asm...

Owner

stsp commented Dec 22, 2017

As it stands, the kernel has no idea what the TLS base is for a given thread.

Ok, so in this case it is indeed a missing feature
but not a bug.
Given that gcc already solved the biggest part
of the problem by allowing to disable stack
protector selectively, it may be the right time
to try some very minimalistic work-around like
codifying only arch_prctl() in asm...

@newbluemoon

This comment has been minimized.

Show comment
Hide comment
@newbluemoon

newbluemoon Dec 22, 2017

Contributor

I compiled dosemu2 as described above plus the musl sigaltstack() work-around 1. But neither with nor without --enable-system-wa protected mode programs worked.

Contributor

newbluemoon commented Dec 22, 2017

I compiled dosemu2 as described above plus the musl sigaltstack() work-around 1. But neither with nor without --enable-system-wa protected mode programs worked.

@stsp

This comment has been minimized.

Show comment
Hide comment
@stsp

stsp Dec 22, 2017

Owner

And what happens?

Owner

stsp commented Dec 22, 2017

And what happens?

@newbluemoon

This comment has been minimized.

Show comment
Hide comment
@newbluemoon

newbluemoon Dec 22, 2017

Contributor

It just terminates with signal 11.

Contributor

newbluemoon commented Dec 22, 2017

It just terminates with signal 11.

@stsp

This comment has been minimized.

Show comment
Hide comment
@stsp

stsp Dec 22, 2017

Owner

But if you apply the stack-protector patch
to musl, then it works?

Owner

stsp commented Dec 22, 2017

But if you apply the stack-protector patch
to musl, then it works?

@stsp

This comment has been minimized.

Show comment
Hide comment
@stsp

stsp Dec 22, 2017

Owner

Yes, I mislead you: stack-protector patch
is still needed.

Owner

stsp commented Dec 22, 2017

Yes, I mislead you: stack-protector patch
is still needed.

@newbluemoon

This comment has been minimized.

Show comment
Hide comment
@newbluemoon

newbluemoon Dec 22, 2017

Contributor

Ok, I’ll test. Just a moment...

Contributor

newbluemoon commented Dec 22, 2017

Ok, I’ll test. Just a moment...

@newbluemoon

This comment has been minimized.

Show comment
Hide comment
@newbluemoon

newbluemoon Dec 22, 2017

Contributor

Yes, with the stack-protector patch it works both with and without --enable-system-wa. :)

Contributor

newbluemoon commented Dec 22, 2017

Yes, with the stack-protector patch it works both with and without --enable-system-wa. :)

@stsp

This comment has been minimized.

Show comment
Hide comment
@stsp

stsp Dec 22, 2017

Owner

Great, so in this case you can try
to submit another patch.
If they inhibit the extensions, they
should not provide the flags, to not
confuse the detections.

Owner

stsp commented Dec 22, 2017

Great, so in this case you can try
to submit another patch.
If they inhibit the extensions, they
should not provide the flags, to not
confuse the detections.

@newbluemoon

This comment has been minimized.

Show comment
Hide comment
@newbluemoon

newbluemoon Dec 22, 2017

Contributor

I will definitely try that. :)

Contributor

newbluemoon commented Dec 22, 2017

I will definitely try that. :)

@stsp

This comment has been minimized.

Show comment
Hide comment
@stsp

stsp Dec 22, 2017

Owner

Of course you probably noticed that
dosemu you built, has that work-around
enabled, that did some problems for you
with sound in duke3d. So this patch is
worse than the previous one, but is better
than nothing.

Owner

stsp commented Dec 22, 2017

Of course you probably noticed that
dosemu you built, has that work-around
enabled, that did some problems for you
with sound in duke3d. So this patch is
worse than the previous one, but is better
than nothing.

@newbluemoon

This comment has been minimized.

Show comment
Hide comment
@newbluemoon

newbluemoon Dec 22, 2017

Contributor

Actually, the sound is quite ok now. Just tested it a bit and can’t make out a problem anymore.

Contributor

newbluemoon commented Dec 22, 2017

Actually, the sound is quite ok now. Just tested it a bit and can’t make out a problem anymore.

@stsp

This comment has been minimized.

Show comment
Hide comment
@stsp

stsp Dec 22, 2017

Owner

Have you somehow merged the musl
workaround with current devel and then
also fixed an _fpstate problem?
Because otherwise I don't understand
how have you got the sound fixes that
I did later.

Owner

stsp commented Dec 22, 2017

Have you somehow merged the musl
workaround with current devel and then
also fixed an _fpstate problem?
Because otherwise I don't understand
how have you got the sound fixes that
I did later.

@newbluemoon

This comment has been minimized.

Show comment
Hide comment
@newbluemoon

newbluemoon Dec 22, 2017

Contributor

Sorry for the confusion, I used b9b1c2f and applied the musl patch no. 1.

Contributor

newbluemoon commented Dec 22, 2017

Sorry for the confusion, I used b9b1c2f and applied the musl patch no. 1.

@stsp

This comment has been minimized.

Show comment
Hide comment
@stsp

stsp Dec 22, 2017

Owner

Yes, in this case you won't notice the
sound differences any more.
You can try a77aa74 instead.

Owner

stsp commented Dec 22, 2017

Yes, in this case you won't notice the
sound differences any more.
You can try a77aa74 instead.

@newbluemoon

This comment has been minimized.

Show comment
Hide comment
@newbluemoon

newbluemoon Dec 22, 2017

Contributor

Just tried a77aa74, but honestly, I can’t hear a difference. ;) (Edit: also in comparison to the glibc version)
However, there are lots of messages that don’t appear in b9b1c2f anymore:

ALSA lib pcm.c:8323:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:8323:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:8323:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:8323:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:8323:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:8323:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:8323:(snd_pcm_recover) underrun occurred
ERROR: PCM: "sdl" too large delay, start=158059424.077088 min=158064587.000000 d=5162.922912
Contributor

newbluemoon commented Dec 22, 2017

Just tried a77aa74, but honestly, I can’t hear a difference. ;) (Edit: also in comparison to the glibc version)
However, there are lots of messages that don’t appear in b9b1c2f anymore:

ALSA lib pcm.c:8323:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:8323:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:8323:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:8323:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:8323:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:8323:(snd_pcm_recover) underrun occurred
ALSA lib pcm.c:8323:(snd_pcm_recover) underrun occurred
ERROR: PCM: "sdl" too large delay, start=158059424.077088 min=158064587.000000 d=5162.922912
@newbluemoon

This comment has been minimized.

Show comment
Hide comment
@newbluemoon

newbluemoon Feb 8, 2018

Contributor

Thought this might be of interest: http://www.openwall.com/lists/musl/2018/02/07/1
There has been some work done to fix the problems you discovered in signal.h and sigaltstack.c. :)

Contributor

newbluemoon commented Feb 8, 2018

Thought this might be of interest: http://www.openwall.com/lists/musl/2018/02/07/1
There has been some work done to fix the problems you discovered in signal.h and sigaltstack.c. :)

@stsp

This comment has been minimized.

Show comment
Hide comment
@stsp

stsp Feb 8, 2018

Owner

Yes, much better now! Thanks.
Did you ask them about the
removal of SS_AUTODISARM, or
have they done so on their own?
So now we can stop bypassing
their sigaltstack() wrapper and
things will work, albeit slower because
of the disabled sigaltstack() extension.
So right now I don't see the need to
change the current status-quo.
The fact that they raised this issue
to posix, means that maybe one day
we'll be able to revert all the musl-related
hacks, but not yet.

Owner

stsp commented Feb 8, 2018

Yes, much better now! Thanks.
Did you ask them about the
removal of SS_AUTODISARM, or
have they done so on their own?
So now we can stop bypassing
their sigaltstack() wrapper and
things will work, albeit slower because
of the disabled sigaltstack() extension.
So right now I don't see the need to
change the current status-quo.
The fact that they raised this issue
to posix, means that maybe one day
we'll be able to revert all the musl-related
hacks, but not yet.

@stsp

This comment has been minimized.

Show comment
Hide comment
@stsp

stsp Feb 8, 2018

Owner

In fact, I can take advantage of at least
one of those two fixes. Which is much better
than nothing, so done.

Owner

stsp commented Feb 8, 2018

In fact, I can take advantage of at least
one of those two fixes. Which is much better
than nothing, so done.

@newbluemoon

This comment has been minimized.

Show comment
Hide comment
@newbluemoon

newbluemoon Feb 8, 2018

Contributor

Did you ask them about the
removal of SS_AUTODISARM, or
have they done so on their own?

I asked a follow up question here: http://www.openwall.com/lists/musl/2017/12/23/3
(it’s also linked to in the first patch).

Contributor

newbluemoon commented Feb 8, 2018

Did you ask them about the
removal of SS_AUTODISARM, or
have they done so on their own?

I asked a follow up question here: http://www.openwall.com/lists/musl/2017/12/23/3
(it’s also linked to in the first patch).

@stsp

This comment has been minimized.

Show comment
Hide comment
@stsp

stsp Feb 8, 2018

Owner

OK, great.
So now there are fewer work-arounds in the
code, please see if it works as expected.

Owner

stsp commented Feb 8, 2018

OK, great.
So now there are fewer work-arounds in the
code, please see if it works as expected.

@newbluemoon

This comment has been minimized.

Show comment
Hide comment
@newbluemoon

newbluemoon Feb 8, 2018

Contributor

Applied the two musl patches (I think they haven’t been added officially, yet) and built dosemu2 based on your latest commit and as far as I can tell everything works as it’s supposed to. :)

Contributor

newbluemoon commented Feb 8, 2018

Applied the two musl patches (I think they haven’t been added officially, yet) and built dosemu2 based on your latest commit and as far as I can tell everything works as it’s supposed to. :)

@stsp

This comment has been minimized.

Show comment
Hide comment
@stsp

stsp Feb 8, 2018

Owner

Thanks! :)

Owner

stsp commented Feb 8, 2018

Thanks! :)

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