View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0033102 | Lazarus | IDE | public | 2018-01-30 19:04 | 2018-01-31 23:16 |
Reporter | Martin Friebe | Assigned To | Juha Manninen | ||
Priority | normal | Severity | minor | Reproducibility | sometimes |
Status | resolved | Resolution | fixed | ||
Platform | w32 | OS | win | ||
Product Version | 1.9 (SVN) | ||||
Summary | 0033102: w32 IDE Crash / range check, when accessing main menu of IDE | ||||
Description | I had several random crashes lately. No way to reproduce. But a few of them happened with a range check, when trying to open a main menu entry with the mouse. TApplication.HandleException Range check error Stack trace: $00563D85 line 461 of win32/win32callback.inc $00567814 line 2060 of win32/win32callback.inc $00568F99 line 2696 of win32/win32callback.inc $006B8908 line 386 of win32/win32wsforms.pp $7618FD92 $7618FE6A $76189D8A $76189FAD $77AE5D0E $761903CB $7527AF85 $7528B5CA $7527865F $752725F4 $7618982B $005631EF line 84 of win32/win32callback.inc $00568B11 line 2602 of win32/win32callback.inc | ||||
Tags | No tags attached. | ||||
Fixed in Revision | r57200 | ||||
LazTarget | - | ||||
Widgetset | |||||
Attached Files |
|
related to | 0033070 | closed | Juha Manninen | Hints mainmenu submenus are mixed up. Wrong hints are reported |
|
Menu := LParam Menu is a DWord LParam is a PtrInt |
|
This code added in the issue 0033070 (my patch). But, Menu: HMENU; HMENU is THandle and same size as PtrInt. And, as far as I know, all the USER handles are 32 bit. |
|
It's signed vs unsigned. So if the top bit is set => range check A simple type cast should do, if the code is otherwise correct. Also, I don't know the patch, and if other similar assignments may have been introduced |
|
Just a note: Looking at old Delphi references THandle = integer; I really don't think that is correct... Thandle currently uses DWORD/LONGWORD or QWORD for 64bit which is what it should be to match MS targets and to not use signed types incase the OS decides to use that upper bit.. MS uses PVOID type which is a untyped pointer. |
|
> A simple type cast should do, if the code is otherwise correct. Yes, a cast is needed here. |
|
Ok, it would be: Menu := HMENU(LParam) Please confirm. I can commit it although I am not able to test Windows code for a week now. I don't know why I or Serge Anvarov did not get range check errors in earlier tests. |
|
yes it will be Menu := HMENU(LParam) I have not looked at the commit/patch in question: Is this the only such assignment? |
|
Yes it was the only such assignment. Please test with r57200. |
Date Modified | Username | Field | Change |
---|---|---|---|
2018-01-30 19:04 | Martin Friebe | New Issue | |
2018-01-30 19:06 | Martin Friebe | Note Added: 0106129 | |
2018-01-30 21:04 | Serge Anvarov | Note Added: 0106130 | |
2018-01-30 21:50 | Martin Friebe | Note Added: 0106132 | |
2018-01-30 21:50 | Martin Friebe | Relationship added | related to 0033070 |
2018-01-30 21:51 | Martin Friebe | Assigned To | => Juha Manninen |
2018-01-30 21:51 | Martin Friebe | Status | new => assigned |
2018-01-31 01:53 | jamie philbrook | Note Added: 0106135 | |
2018-01-31 10:34 | Ondrej Pokorny | Note Added: 0106140 | |
2018-01-31 13:31 | Juha Manninen | Note Added: 0106142 | |
2018-01-31 13:32 | Juha Manninen | Note Edited: 0106142 | View Revisions |
2018-01-31 15:40 | Martin Friebe | Note Added: 0106145 | |
2018-01-31 23:16 | Juha Manninen | Fixed in Revision | => r57200 |
2018-01-31 23:16 | Juha Manninen | Note Added: 0106157 | |
2018-01-31 23:16 | Juha Manninen | Status | assigned => resolved |
2018-01-31 23:16 | Juha Manninen | Resolution | open => fixed |