-
-
Notifications
You must be signed in to change notification settings - Fork 477
Closed
yishayv/86Box
#1Labels
Description
Describe the bug
86Box crashes when trying to use DOS with mTCP + PLIP.COM for a parallel port network.
First offending commit:
c30d5d9
To Reproduce
- Create or modify any machine with the following network settings:
[Network]
net_01_card = plip
net_01_net_type = slirp
[Ports (COM & LPT)]
lpt1_device = plip- Install FreeDOS (DOS 3.3 or newer work as well), mTCP and the PLIP.COM
86box.cfg.txt
packet driver. - Load PLIP (If I don't specify an ethernet address it defaults to
00:00:00:00:00:00- but it doesn't seem to matter anyway) with:
PLIP 0x65 7 0x378 04:FD:7A:11:ED:D9
- Create a config file starting from
sample.cfgand change the interrupt to 0x65:
packetint 0x65
SET MTCPCFG=<PATH-OF-MTCP-CONFIG-FILE>DHCP
Expected behavior
DHCP gets a proper IP address and networking is available.
Code
263 static bool
264 network_queue_full(netqueue_t *queue)
265 {
> 266 return ((queue->head + 1) & NET_QUEUE_LEN_MASK) == queue->tail;
267 }Stack Trace
$ gdb --tui --args build/src/86Box.exe --rompath 'C:\emu\86Box\roms' --vmpath '"C:\emu\86Box VMs\Debug"' '-O'
(gdb) bt
#0 network_queue_full (queue=queue@entry=0x148) at C:/Git/86Box/src/network/network.c:266
#1 0x00007ff771388047 in network_queue_put (queue=0x148, data=0x220e1565a20 "\004z\021b", len=307) at C:/Git/86Box/src/network/network.c:286
#2 0x00007ff7713881e7 in network_tx (card=0x0, bufp=0x220e1565a00 "", len=307) at C:/Git/86Box/src/network/network.c:575
#3 0x00007ff771391f38 in plip_write_data (val=<optimized out>, priv=0x220e155a8c0) at C:/Git/86Box/src/network/net_plip.c:237
#4 0x00007ff771337467 in lpt_write (port=<optimized out>, val=1 '\001', priv=0x7ff773694140 <lpt_ports>) at C:/Git/86Box/src/lpt.c:114
#5 0x00007ff7714f33e8 in outb (port=<optimized out>, val=1 '\001') at C:/Git/86Box/src/io.c:356
#6 0x00007ff771226943 in opOUT_AL_DX (rmdat=<optimized out>) at C:/Git/86Box/src/cpu/x86_ops_io.h:115
#7 0x00007ff771170573 in exec386 (cycs=<optimized out>) at C:/Git/86Box/src/cpu/386.c:194
#8 0x00007ff7714e9085 in pc_run () at C:/Git/86Box/src/86box.c:1280
#9 0x00007ff7715064a1 in main_thread_fn () at C:/Git/86Box/src/qt/qt_main.cpp:119
#10 0x00007ff7727ac457 in std::__invoke_impl<void, void (*)()> (__f=<error reading variable>) at C:/Users/user/scoop/apps/msys2/2023-07-18/mingw64/include/c++/13.2.0/bits/invoke.h:60
#11 std::__invoke<void (*)()> (__fn=<error reading variable>) at C:/Users/user/scoop/apps/msys2/2023-07-18/mingw64/include/c++/13.2.0/bits/invoke.h:96
#12 std::thread::_Invoker<std::tuple<void (*)()> >::_M_invoke<0ull> (this=0x150) at C:/Users/user/scoop/apps/msys2/2023-07-18/mingw64/include/c++/13.2.0/bits/std_thread.h:292
#13 std::thread::_Invoker<std::tuple<void (*)()> >::operator() (this=0x150) at C:/Users/user/scoop/apps/msys2/2023-07-18/mingw64/include/c++/13.2.0/bits/std_thread.h:299
#14 std::thread::_State_impl<std::thread::_Invoker<std::tuple<void (*)()> > >::_M_run (this=0x148) at C:/Users/user/scoop/apps/msys2/2023-07-18/mingw64/include/c++/13.2.0/bits/std_thread.h:244
#15 0x00007ff772850d4f in execute_native_thread_routine ()
#16 0x00007ff771c41fcb in pthread_create_wrapper ()
#17 0x00007fff60cbe634 in msvcrt!_beginthreadex () from C:\WINDOWS\System32\msvcrt.dll
#18 0x00007fff60cbe70c in msvcrt!_endthreadex () from C:\WINDOWS\System32\msvcrt.dll
#19 0x00007fff5fa0257d in KERNEL32!BaseThreadInitThunk () from C:\WINDOWS\System32\kernel32.dll
#20 0x00007fff6176aa68 in ntdll!RtlUserThreadStart () from C:\WINDOWS\SYSTEM32\ntdll.dll
#21 0x0000000000000000 in ?? ()
Backtrace stopped: previous frame inner to this frame (corrupt stack?)
(gdb) p queue
$3 = (netqueue_t *) 0x148
(gdb) p *queue
Cannot access memory at address 0x148
Desktop (please complete the following information):
- OS: Windows 11
- 86Box version: v4.0
- Build information: Windows-64-b5000
- Bisected with: local build - old dynarec, Mingw64 gcc Debug
Additional context
Thanks for continuing to improve this already amazing emulator :)