http://bugs.winehq.org/show_bug.cgi?id=16491
Summary: monthcal: MONTHCAL_GetMonthRange not implemented Product: Wine Version: 1.1.10 Platform: All URL: http://www.pindersoft.com/dotnettest.htm OS/Version: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: comctl32 AssignedTo: wine-bugs@winehq.org ReportedBy: focht@gmx.net
Hello,
just a small showcase bug. Someone emailed me a link to a .NET test app to check its "usefulness".
That app isn't sophisticated nor particularly useful at all (despite its name). Just a small GUI app with month calendar and hyperlink control.
Its only purpose seems to be to show Wine month calendar control insufficiency ;-)
Steps to reproduce:
1. clean WINEPREFIX 2. sh winetricks dotnet20 3. download from: ftp://ftp.pindersoft.com/DotNetTestDNF2.zip 4. run: wine ./DotNetTestDNF2.exe
When you advance the month in calendar control (arrows), it bails.
WINEDEBUG=+tid,+seh,+monthcal
--- snip wine trace --- ... 0036:trace:monthcal:MONTHCAL_LButtonDown e00a3 0036:trace:monthcal:MONTHCAL_GoToNextMonth MONTHCAL_GoToNextMonth 0036:trace:monthcal:MONTHCAL_WindowProc hwnd=0x8009c msg=1007 wparam=1 lparam=d913cc 0036:trace:monthcal:MONTHCAL_GetMonthRange 0036:trace:seh:raise_exception code=e0434f4d flags=1 addr=0x7b8434b0 0036:trace:seh:raise_exception info[0]=80131502 0036:trace:seh:raise_exception eax=7b82c6a5 ebx=7b8b3840 ecx=00000000 edx=0032e3f0 esi=0032e3f0 edi=e0434f4d 0036:trace:seh:raise_exception ebp=0032e3b8 esp=0032e354 cs=0023 ds=002b es=002b fs=0063 gs=006b flags=00000246 --- snip wine trace ---
--- snip CLR backtrace -- System.ArgumentOutOfRangeException: Year, Month, and Day parameters describe an un-representable DateTime. at System.DateTime.DateToTicks(Int32 year, Int32 month, Int32 day) at System.Windows.Forms.DateTimePicker.SysTimeToDateTime(SYSTEMTIME s) at System.Windows.Forms.MonthCalendar.GetMonthRange(Int32 flag) at System.Windows.Forms.MonthCalendar.BoldDates(DateBoldEventArgs e) at System.Windows.Forms.MonthCalendar.WmDateBold(Message& m) at System.Windows.Forms.MonthCalendar.WmReflectCommand(Message& m) at System.Windows.Forms.MonthCalendar.WndProc(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) --- snip CLR backtrace ---
Aric Stewart fleshed out MONTHCAL_GetMonthRange with a patch: http://www.winehq.org/pipermail/wine-patches/2008-August/060414.html
... but it didn't make it in. Maybe this bug report can give it the proper push ;-)
Regards
http://bugs.winehq.org/show_bug.cgi?id=16491
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |dotnet, download
http://bugs.winehq.org/show_bug.cgi?id=16491
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |patch
http://bugs.winehq.org/show_bug.cgi?id=16491
Vijay Kamuju infyquest@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |infyquest@gmail.com
--- Comment #1 from Vijay Kamuju infyquest@gmail.com 2008-12-18 11:56:28 --- i think I have to look into this. Its been a long time, I have been missing from action
http://bugs.winehq.org/show_bug.cgi?id=16491
Louis Lenders xerox_xerox2000@yahoo.co.uk changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW CC| |xerox_xerox2000@yahoo.co.uk Ever Confirmed|0 |1
--- Comment #2 from Louis Lenders xerox_xerox2000@yahoo.co.uk 2009-08-16 11:08:36 --- confirming
http://bugs.winehq.org/show_bug.cgi?id=16491
--- Comment #3 from Nikolay Sivov bunglehead@gmail.com 2009-10-08 09:19:37 --- Hi, Anastasius.
This should be fixed with:
http://source.winehq.org/git/wine.git/?a=commit;h=c68324dfedf2f1e25e984f3d87...
http://bugs.winehq.org/show_bug.cgi?id=16491
Jerome Leclanche adys.wh@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |adys.wh@gmail.com
--- Comment #4 from Jerome Leclanche adys.wh@gmail.com 2009-10-25 08:42:51 --- (In reply to comment #3)
Hi, Anastasius.
This should be fixed with:
http://source.winehq.org/git/wine.git/?a=commit;h=c68324dfedf2f1e25e984f3d87...
Not fixed, still freezes when going one month further than current one.
http://bugs.winehq.org/show_bug.cgi?id=16491
--- Comment #5 from Nikolay Sivov bunglehead@gmail.com 2009-10-25 08:55:08 --- (In reply to comment #4)
(In reply to comment #3)
Hi, Anastasius.
This should be fixed with:
http://source.winehq.org/git/wine.git/?a=commit;h=c68324dfedf2f1e25e984f3d87...
Not fixed, still freezes when going one month further than current one.
Ok. Attach current CLR trace then.
http://bugs.winehq.org/show_bug.cgi?id=16491
--- Comment #6 from Jerome Leclanche adys.wh@gmail.com 2009-10-25 09:28:26 --- Created an attachment (id=24341) --> (http://bugs.winehq.org/attachment.cgi?id=24341) +tid,+seh,+monthcal 1.1.32 trace
(In reply to comment #5)
(In reply to comment #4)
(In reply to comment #3)
Hi, Anastasius.
This should be fixed with:
http://source.winehq.org/git/wine.git/?a=commit;h=c68324dfedf2f1e25e984f3d87...
Not fixed, still freezes when going one month further than current one.
Ok. Attach current CLR trace then.
I'm not sure what you mean by CLR. Here is a +tid,+seh,+monthcal.
http://bugs.winehq.org/show_bug.cgi?id=16491
Nikolay Sivov bunglehead@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Depends on| |21798
--- Comment #7 from Nikolay Sivov bunglehead@gmail.com 2010-06-15 13:37:27 --- Added a dependency for starting gdiplus exception.
http://bugs.winehq.org/show_bug.cgi?id=16491
--- Comment #8 from Nikolay Sivov bunglehead@gmail.com 2010-06-15 13:42:20 --- Anastasius, how did you get this nice CLR trace? Could you please post some update for that, cause initial problem with empty date values is fixed I think.
http://bugs.winehq.org/show_bug.cgi?id=16491
--- Comment #9 from Anastasius Focht focht@gmx.net 2010-06-15 15:33:00 --- Hello,
--- quite --- Anastasius, how did you get this nice CLR trace? Could you please post some update for that, cause initial problem with empty date values is fixed I think. --- quite ---
It's the Framework itself that displays the dialog with CLR backtrace and assemblies list. See http://msdn.microsoft.com/en-us/library/2ac5yxx6%28VS.80%29.aspx or google "DbgJITDebugLaunchSetting" for further information.
One can also intercept/trap these exceptions by using managed CLR debuggers like mdbg or cdb (with mscorwks sos debugging extension) from "Debugging Tools for Windows".
As comment #4 already stated it freezes when advancing months. Seems there is some heap corruption caused by double free when handling reflected messages/commands (+tid,+seh,+relay,+loaddll,+heap,+win,+msg,+monthcal).
Regards
http://bugs.winehq.org/show_bug.cgi?id=16491
--- Comment #10 from Nikolay Sivov bunglehead@gmail.com 2010-06-19 08:04:26 --- Created an attachment (id=28958) --> (http://bugs.winehq.org/attachment.cgi?id=28958) log
Here is a log running 1.2-rc4. Without any channels enabled is allows to advance for a single month, after that it simply terminates. In attached log there's definitely a hang.
http://bugs.winehq.org/show_bug.cgi?id=16491
Bug 16491 depends on bug 21798, which changed state.
Bug 21798 Summary: SEHException / GdipGetRegionScansCount opening AutoWikiBrowser http://bugs.winehq.org/show_bug.cgi?id=21798
What |Old Value |New Value ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED
http://bugs.winehq.org/show_bug.cgi?id=16491
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords|patch | URL|http://www.pindersoft.com/d |http://pindersoft.com/ftp/D |otnettest.htm |otNetTestDNF2.zip Summary|monthcal: |Pindersoft DotNet Test |MONTHCAL_GetMonthRange not |hangs when advancing months |implemented |(monthcal day | |state/notification data | |handling)
--- Comment #11 from Anastasius Focht focht@gmx.net 2011-05-29 10:05:37 CDT --- Hello,
updating download link and changing summary to reflect current state.
Still happens, sometimes you need to advance months quickly. You need to revise the following code fragment:
http://source.winehq.org/git/wine.git/blob/HEAD:/dlls/comctl32/monthcal.c#l1...
--- snip dlls/comctl32/monthcal.c --- 1798 static void MONTHCAL_NotifyDayState(MONTHCAL_INFO *infoPtr) 1799 { 1800 if(infoPtr->dwStyle & MCS_DAYSTATE) { 1801 NMDAYSTATE nmds; 1802 1803 nmds.nmhdr.hwndFrom = infoPtr->hwndSelf; 1804 nmds.nmhdr.idFrom = GetWindowLongPtrW(infoPtr->hwndSelf, GWLP_ID); 1805 nmds.nmhdr.code = MCN_GETDAYSTATE; 1806 nmds.cDayState = infoPtr->monthRange; 1807 nmds.prgDayState = Alloc(infoPtr->monthRange * sizeof(MONTHDAYSTATE)); 1808 1809 nmds.stStart = infoPtr->todaysDate; 1810 nmds.stStart.wYear = infoPtr->minSel.wYear; 1811 nmds.stStart.wMonth = infoPtr->minSel.wMonth; 1812 nmds.stStart.wDay = 1; 1813 1814 SendMessageW(infoPtr->hwndNotify, WM_NOTIFY, nmds.nmhdr.idFrom, (LPARAM)&nmds); 1815 memcpy(infoPtr->monthdayState, nmds.prgDayState, infoPtr->monthRange*sizeof(MONTHDAYSTATE)); 1816 1817 Free(nmds.prgDayState); 1818 } 1819 } --- snip dlls/comctl32/monthcal.c ---
Passing day state structure and expect it still containing the _same_ member data after notification handling? ;-)
Have a look at the following notification message handler snippet "Setting Day States":
http://msdn.microsoft.com/en-us/library/bb760921.aspx
After fixing day state handling, the months can be advanced without any heap corruption anymore (which is the reason for hang).
$ sha1sum DotNetTestDNF2.zip 62ac4b8c1590ac8e7000be28191b9d6b3003042c DotNetTestDNF2.zip
$ sha1sum DotNetTestDNF2.exe 60a9ef5cf5b3008fd44b827e350f671ec2cbfb10 DotNetTestDNF2.exe
$ wine --version wine-1.3.21
Regards
http://bugs.winehq.org/show_bug.cgi?id=16491
--- Comment #12 from Nikolay Sivov bunglehead@gmail.com 2011-10-01 07:36:37 CDT --- I sent a fix for that http://www.winehq.org/pipermail/wine-patches/2011-September/107389.html.
http://bugs.winehq.org/show_bug.cgi?id=16491
Vijay Kamuju infyquest@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution| |FIXED
--- Comment #13 from Vijay Kamuju infyquest@gmail.com 2011-10-03 17:50:19 CDT --- commit for the fix http://source.winehq.org/git/wine.git/commit/40c783fcc10e47c9653322644956021...
http://bugs.winehq.org/show_bug.cgi?id=16491
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #14 from Alexandre Julliard julliard@winehq.org 2011-10-10 13:13:59 CDT --- Closing bugs fixed in 1.3.30.
http://bugs.winehq.org/show_bug.cgi?id=16491
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Fixed by SHA1| |40c783fcc10e47c965332264495 | |6021029368a34
--- Comment #15 from Anastasius Focht focht@gmx.net 2011-10-12 03:25:15 CDT --- Hello,
filling/correcting fields ...
Regards
http://bugs.winehq.org/show_bug.cgi?id=16491
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Platform|All |Other
--- Comment #16 from Austin English austinenglish@gmail.com 2012-02-23 15:27:20 CST --- Removing deprecated 'All' Platform.
http://bugs.winehq.org/show_bug.cgi?id=16491
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- Hardware|Other |x86
https://bugs.winehq.org/show_bug.cgi?id=16491
Anastasius Focht focht@gmx.net changed:
What |Removed |Added ---------------------------------------------------------------------------- URL|http://pindersoft.com/ftp/D | |otNetTestDNF2.zip | Keywords|download |
--- Comment #17 from Anastasius Focht focht@gmx.net --- Hello folks,
removing dead download link.
http://pindersoft.com/ftp/DotNetTestDNF2.zip
The site is long gone (domain recycled) and no archive.org snapshots exist.
https://web.archive.org/web/20110828113909/http://www.pindersoft.com/dotnett...
Unfortunately I lost parts of my wine-bugs git-annex some years ago, hence no alternate backup to recover from.
Regards