[Bug 58054] New: concurrent modifications of C++ collection during iteration
https://bugs.winehq.org/show_bug.cgi?id=58054 Bug ID: 58054 Summary: concurrent modifications of C++ collection during iteration Product: Wine Version: unspecified Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: enhancement Priority: P2 Component: -unknown Assignee: wine-bugs(a)winehq.org Reporter: christophgil(a)gmail.com Distribution: --- Deleting elements from a C++ collection during iteration is not allowed. This is a frequent programming error which goes unnoticed. It is not reported as a runtime error and tolerated on native Windows, while it causes page faults in Wine. This bug in Windows executables may be reason why programs fail on Wine. Suggestion: Please report this as a runtime error and/or make the runtime lib tolerant. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=58054 --- Comment #1 from Nikolay Sivov <bunglehead(a)gmail.com> --- What is this about exactly? Do you have a test project that shows this problem? -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=58054 Nikolay Sivov <bunglehead(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Severity|enhancement |normal -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=58054 --- Comment #2 from Christoph <christophgil(a)gmail.com> --- Thank you for getting in touch. I wanted to share some insights regarding the program diann.exe (https://github.com/vdemichev/DiaNN), which previously crashed with a page fault immediately after startup when run under Wine. At that time, the author kindly granted us access to the source code (which we unfortunately no longer have). Through basic printf debugging, we identified the issue as a std::vector being modified (elements deleted) while being iterated over—a classic case of unsafe concurrent modification. Once this bug was resolved, DIA-NN ran stably under Wine and was even successfully ported to Linux natively. Although I’m not a C++ programmer, I do have experience in Java, where such an error would typically result in a runtime exception. The fact that the VC++ environment did not catch this might suggest that this type of issue is a common programming pitfall, potentially contributing to the instability of Windows executables under Wine. At the time, I was not yet well-versed in Wine internals. Today, I would consider replacing certain DLLs with their native Windows counterparts as a possible workaround. Suggestions: 1. Quick & Low-Effort Improvement: Implementing modification counters in containers (e.g., vectors, lists) could help detect unsafe changes during iteration. These counters could increment on insertions or deletions, triggering a warning to /dev/stderr if a concurrent modification is detected. This could be accompanied by guidance on resolving the issue, possibly using winetricks or other tools. 2. Longer-Term Enhancement: Making standard containers more tolerant to concurrent modifications would require significantly more effort, but could increase robustness for a broader range of applications. Please let me know if any of this is helpful or if you'd like me to elaborate further. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
https://bugs.winehq.org/show_bug.cgi?id=58054 --- Comment #3 from Nikolay Sivov <bunglehead(a)gmail.com> --- Let me ask again. Do you have an application that shows some issue when running with Wine or not? I don't believe standard c++ library core exists in shared modules. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=58054 Zeb Figura <z.figura12(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |ABANDONED Status|UNCONFIRMED |RESOLVED CC| |z.figura12(a)gmail.com --- Comment #4 from Zeb Figura <z.figura12(a)gmail.com> --- No response, resolving ABANDONED. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
http://bugs.winehq.org/show_bug.cgi?id=58054 Ken Sharp <imwellcushtymelike(a)gmail.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED --- Comment #5 from Ken Sharp <imwellcushtymelike(a)gmail.com> --- Closing abandoned bugs. -- Do not reply to this email, post in Bugzilla using the above URL to reply. You are receiving this mail because: You are watching all bug changes.
participants (1)
-
WineHQ Bugzilla