summary refs log tree commit diff stats
path: root/results/classifier/118/peripherals/2308
diff options
context:
space:
mode:
authorChristian Krinitsin <mail@krinitsin.com>2025-06-16 16:59:00 +0000
committerChristian Krinitsin <mail@krinitsin.com>2025-06-16 16:59:33 +0000
commit9aba81d8eb048db908c94a3c40c25a5fde0caee6 (patch)
treeb765e7fb5e9a3c2143c68b0414e0055adb70e785 /results/classifier/118/peripherals/2308
parentb89a938452613061c0f1f23e710281cf5c83cb29 (diff)
downloademulator-bug-study-9aba81d8eb048db908c94a3c40c25a5fde0caee6.tar.gz
emulator-bug-study-9aba81d8eb048db908c94a3c40c25a5fde0caee6.zip
add 18th iteration of classifier
Diffstat (limited to 'results/classifier/118/peripherals/2308')
-rw-r--r--results/classifier/118/peripherals/2308109
1 files changed, 109 insertions, 0 deletions
diff --git a/results/classifier/118/peripherals/2308 b/results/classifier/118/peripherals/2308
new file mode 100644
index 00000000..a248a7e8
--- /dev/null
+++ b/results/classifier/118/peripherals/2308
@@ -0,0 +1,109 @@
+peripherals: 0.865
+debug: 0.839
+permissions: 0.834
+device: 0.833
+architecture: 0.823
+arm: 0.823
+virtual: 0.821
+register: 0.813
+performance: 0.807
+network: 0.805
+graphic: 0.803
+boot: 0.791
+kernel: 0.786
+TCG: 0.786
+assembly: 0.785
+PID: 0.782
+user-level: 0.782
+semantic: 0.775
+vnc: 0.767
+hypervisor: 0.755
+socket: 0.744
+KVM: 0.740
+files: 0.721
+risc-v: 0.691
+VMM: 0.690
+ppc: 0.685
+x86: 0.646
+i386: 0.634
+mistranslation: 0.627
+
+QEMU Windows COM port setup dialog always invoked and fails if none is available (USB or virtual serial port hardware)
+Description of problem:
+The Windows backend serial port in `chardev/char-win.c` always calls `CommConfigDialog()`. This should display a COM port configuration dialog which does (and can) not persist the COM port settings. If the COM port does not support this action (see https://learn.microsoft.com/en-us/windows/win32/api/winbase/nf-winbase-commconfigdialoga) then the function fails.
+Steps to reproduce:
+1. Currently not possible with QEMU releases as QEMU does not recognize extended COM port specifications like `\\.\COM19` or `\\.\CNCA0`
+Additional information:
+See https://support.microsoft.com/en-gb/topic/howto-specify-serial-ports-larger-than-com9-db9078a5-b7b6-bf00-240f-f749ebfd913e for details on COM port filenames.
+
+I have a patch which 'fixes' this problem by setting the nominated COM port to defaults of `115200,8,N,0` which seems perfectly sensible in 2024. Please contact me for more details. A git diff shown below (with extensive error reporting)
+
+N.B. Markodown will destroy formatting!
+
+```
+diff --git a/chardev/char-win.c b/chardev/char-win.c
+index d4fb44c4dc..a05896ffe9 100644
+--- a/chardev/char-win.c
++++ b/chardev/char-win.c
+@@ -96,12 +96,24 @@ int win_chr_serial_init(Chardev *chr, const char *filename, Error **errp)
+     s->file = CreateFile(filename, GENERIC_READ | GENERIC_WRITE, 0, NULL,
+                       OPEN_EXISTING, FILE_FLAG_OVERLAPPED, 0);
+     if (s->file == INVALID_HANDLE_VALUE) {
++        {
++            char buffer[1024] = { 0 };
++            DWORD dw = GetLastError();
++            sprintf_s(buffer, 1024, "%s(%d) Error: %d 0x%x %s\r\n", __FILE__, __LINE__, dw, dw, filename);
++            OutputDebugString(buffer);
++        }
+         error_setg_win32(errp, GetLastError(), "Failed CreateFile");
+         s->file = NULL;
+         goto fail;
+     }
+
+     if (!SetupComm(s->file, NRECVBUF, NSENDBUF)) {
++        {
++            char buffer[1024] = { 0 };
++            DWORD dw = GetLastError();
++            sprintf_s(buffer, 1024, "%s(%d) Error: %d 0x%x %s\r\n", __FILE__, __LINE__, dw, dw, filename);
++            OutputDebugString(buffer);
++        }
+         error_setg(errp, "Failed SetupComm");
+         goto fail;
+     }
+@@ -110,9 +122,31 @@ int win_chr_serial_init(Chardev *chr, const char *filename, Error **errp)
+     size = sizeof(COMMCONFIG);
+     GetDefaultCommConfig(filename, &comcfg, &size);
+     comcfg.dcb.DCBlength = sizeof(DCB);
+-    CommConfigDialog(filename, NULL, &comcfg);
+-
++#if 1
++    // JME hardwire. There seems to be no mechanism to simply specify serial port options
++    comcfg.dcb.BaudRate = 115200;
++    comcfg.dcb.Parity = NOPARITY;
++    comcfg.dcb.StopBits = ONESTOPBIT;
++    comcfg.dcb.ByteSize = 8;
++#else
++    {
++        BOOL ret = CommConfigDialog(filename, NULL, &comcfg);
++        if (!ret)
++        {
++            char buffer[1024] = { 0 };
++            DWORD dw = GetLastError();
++            sprintf_s(buffer, 1024, "%s(%d) Error: %d 0x%x %s\r\n", __FILE__, __LINE__, dw, dw, filename);
++            OutputDebugString(buffer);
++        }
++    }
++#endif
+     if (!SetCommState(s->file, &comcfg.dcb)) {
++        {
++            char buffer[1024]={0};
++            DWORD dw = GetLastError();
++            sprintf_s(buffer,1024,"%s(%d) Error: %d 0x%x %s\r\n",__FILE__,__LINE__,dw,dw, filename);
++            OutputDebugString(buffer);
++        }
+         error_setg(errp, "Failed SetCommState");
+         goto fail;
+     }
+```
+
+/label ~"kind::Bug"