Sign in Join

Live chat for Free Pascal, Lazarus, Delphi and every Pascal programmer.

Mailing lists / qt / 2007-07

64 bit problems

20 messages · 6 people · –

Reply by email Subscribe to this list Your subscription

Read-only archive. Use j and k to move between messages.

Giulio Bernardi

After some time I tried to compile lcl-qt on linux-amd64, and I got some compilation errors.

Please remember that not all machines are 32 bit, so whenever you cast handles, pointers and so on to integer types you shouldn't assume they are 4 bytes large.
If you need to do such casts, use PtrInt/PtrUInt: they are signed/unsigned integer types of the same size of pointers (so they are Integer/LongWord on 32 bit machines and Int64/QWord on 64 bit machines).

These are the errors I have:

qtcaret.pas(139,33) Error: Illegal type conversion: "DWord" to "QPixmapH"
qtcaret.pas(269,6) Error: Illegal type conversion: "QPixmapH" to "DWord"
qtcaret.pas(272,34) Error: Illegal type conversion: "QPixmapH" to "LongInt"

Explanation:

line 139, CreateCaret function:
ColorCaret is cardinal, so it cannot be cast to a QPixmapH on 64 bit machines.

line 269,272 TEmulatedCaret.CreateCaret method:
A QPixmapH is cast to a Cardinal.
A QPixmapH is cast to an Integer (moreover, CreateColorPixmap wants a Cardinal:
maybe CreateColorPixmap should be modified too to accept a PtrInt/PtrUint?)

I didn't provide a patch because I don't know qt-lcl internals and I don't want
to break things.

bye,
Giulio

zeljko
to Giulio Bernardi
Giulio Bernardi wrote 31 lines
After some time I tried to compile lcl-qt on linux-amd64, and I got some compilation errors. Please remember that not all machines are 32 bit, so whenever you cast handles, pointers and so on to integer types you shouldn't assume they are 4 bytes large. If you need to do such casts, use PtrInt/PtrUInt: they are signed/unsigned integer types of the same size of pointers (so they are Integer/LongWord on 32 bit machines and Int64/QWord on 64 bit machines). These are the errors I have: qtcaret.pas(139,33) Error: Illegal type conversion: "DWord" to "QPixmapH" qtcaret.pas(269,6) Error: Illegal type conversion: "QPixmapH" to "DWord" qtcaret.pas(272,34) Error: Illegal type conversion: "QPixmapH" to "LongInt" Explanation: line 139, CreateCaret function: ColorCaret is cardinal, so it cannot be cast to a QPixmapH on 64 bit machines. line 269,272 TEmulatedCaret.CreateCaret method: A QPixmapH is cast to a Cardinal. A QPixmapH is cast to an Integer (moreover, CreateColorPixmap wants a Cardinal: maybe CreateColorPixmap should be modified too to accept a PtrInt/PtrUint?) I didn't provide a patch because I don't know qt-lcl internals and I don't want to break things.

will be fixed, tnx for report.

Daniel Jesús Pérez Burgos
to zeljko

I get this error yet in 64 bit machine

lazarus/lcl/interfaces/qt/qtcaret.pas(269,6) Error: Illegal type conversion:
"QPixmapH" to "DWord"

Thanks

Best Regards

2007/7/29, zeljko :

Show quoted text 13 lines
On Friday 27 July 2007 19:40, Giulio Bernardi wrote: > After some time I tried to compile lcl-qt on linux-amd64, and I got some > compilation errors. can U test it now , and possibly send feedback ? tnx _______________________________________________ Qt mailing list http://www.lazarus.freepascal.org/mailman/listinfo/qt

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus.freepascal.org/pipermail/qt/attachments/20070729/4300ab58/attachment.html>

Giulio Bernardi
can U test it now , and possibly send feedback ?

Still compilation problems.
This patch should fix it (I hope).

Howver, on my 32 bit chroot environment lazarus ide compiled for qt (qt 4.3) starts, while the 64 bit version crashes, so I think there are still problems here and there.
I'll try to investigate.

bye
Giulio

_________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/ -------------- next part --------------
A non-text attachment was scrubbed...
Name: lcl_qtcaret_64bit.patch
Type: text/x-patch
Size: 462 bytes
Desc: not available
URL: <http://lists.lazarus.freepascal.org/pipermail/qt/attachments/20070729/46a62208/attachment.bin>

zeljko
to Giulio Bernardi
Giulio Bernardi wrote 9 lines
>can U test it now , and possibly send feedback ? Still compilation problems. This patch should fix it (I hope). Howver, on my 32 bit chroot environment lazarus ide compiled for qt (qt 4.3) starts, while the 64 bit version crashes, so I think there are still problems here and there. I'll try to investigate.

tnx, any hint for 64bit will be appreciated (I don't have an 64bit machine)

zeljko
to Giulio Bernardi: Still compilation problems. This patch should fix it (I hope). Howver, on my 32 bit…
Giulio Bernardi wrote 9 lines
>can U test it now , and possibly send feedback ? Still compilation problems. This patch should fix it (I hope). Howver, on my 32 bit chroot environment lazarus ide compiled for qt (qt 4.3) starts, while the 64 bit version crashes, so I think there are still problems here and there. I'll try to investigate.

maybe you should recompile libqt4intf on your own. It can causes problems.

Den Jean
to zeljko
zeljko wrote
maybe you should recompile libqt4intf on your own. It can causes problems.

I never compiled a 64bit verson ?!

Unknown author
to Den Jean

Quoting Den Jean :

On Sunday 29 July 2007 15:18:31 zeljko wrote: > maybe you should recompile libqt4intf on your own. It can causes problems. I never compiled a 64bit verson ?!

I don't know ;), I just want to help to Giulio, I have to recompile bindings each time since I cannot use it (glibc-2.3.6 & qt compiled with -no-sse2).

Unknown author
to Giulio Bernardi

Quoting Giulio Bernardi :

Show quoted text 5 lines
> > maybe you should recompile libqt4intf on your own. It can causes problems. > _______________________________________________ Yes I always do this :)

ok, then any feedback will be appreciated :)

Jesus Reyes
to Unknown author

--- escribi?:

Show quoted text 10 lines
Quoting Giulio Bernardi : >> >> maybe you should recompile libqt4intf on your own. It can causes problems. >> _______________________________________________ > > Yes I always do this :) ok, then any feedback will be appreciated :)

starting qt lazarus under linux 64 bits, fpc 2.3.1, qt4.3

(gdb) set args --nsc --skip-last-project
(gdb) r
Starting program: /home/prog/lazarus/lazarus --nsc --skip-last-project
[Thread debugging using libthread_db enabled]
[New Thread 47082101943104 (LWP 13889)]
Qt: gdb: -nograb added to command-line options.
Use the -dograb option to enforce grabbing.
TApplication.IconChanged - TODO: convert this message...no implementation in gtk or win32
NOTE: codetools config file not found - using defaults [New Thread 1082132800 (LWP 13905)]
NOTE: help options config file not found - using defaults TMainIDE.DoNewProject A
TMainIDE.DoNewEditorFile A NewFilename=

Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 47082101943104 (LWP 13889)]
0x00000000005ebaab in FREE (self=0x2880a5a0) at
/home/prog/fpc/rtl/inc//objpas.inc:152
152 self.destroy;
Current language: auto; currently pascal
(gdb) bt
#0 0x00000000005ebaab in FREE (self=0x2880a5a0) at /home/prog/fpc/rtl/inc//objpas.inc:152
#1 0x00000000007b2b19 in DESTROYTIMER (DESTROYTIMER=false, TIMERHANDLE=679519648, self=0x2ad227f66580) at qtobject.inc:77 #2 0x0000000000798a2f in KILLTIMER (self=0x2aaaaabbab20) at customtimer.pas:109
#3 0x0000000000798aa5 in UPDATETIMER (self=0x2aaaaabbab20) at customtimer.pas:130
#4 0x0000000000798ccf in SETENABLED (VALUE=false, self=0x2aaaaabbab20) at customtimer.pas:192
#5 0x00000000007c9832 in DESTROYCARET (DESTROYCARET=false, self=0x2aaaaabbaa80) at qtcaret.pas:280
#6 0x00000000007c9780 in CREATECARET (CREATECARET=true (170), AWIDGET=0x2aaaaabba9e0, PIXMAP=0x0, WIDTH=2, HEIGHT=21, self=0x2aaaaabbaa80)
at qtcaret.pas:265
#7 0x00000000007c8fc0 in CREATECARET (CREATECARET=false, WIDGET=0x2aaaaabba9e0, PIXMAP=0x0, WIDTH=2, HEIGHT=21) at qtcaret.pas:131
#8 0x00000000007c9021 in CREATECARET (CREATECARET=false, WIDGET=0x2aaaaabba9e0, COLORCARET=0, WIDTH=2, HEIGHT=21) at qtcaret.pas:139
#9 0x00000000007b3e71 in CREATECARET (CREATECARET=true, HANDLE=46912497232352, BITMAP=0, WIDTH=2, HEIGHT=21, self=0x2ad227f66580)
at qtwinapi.inc:488
#10 0x00000000006e80ba in CREATECARET (CREATECARET=true (170), HANDLE=46912497232352, BITMAP=0, WIDTH=2, HEIGHT=21) at ./include//winapi.inc:105
#11 0x0000000000b4cf29 in INITIALIZECARET (self=0x2aaaaabda010) at synedit.pp:7473
#12 0x0000000000b53b04 in SIZEORFONTCHANGED (BFONT=true, self=0x2aaaaabda010) at synedit.pp:9550
#13 0x0000000000b3c10d in FONTCHANGED (SENDER=0x2aaaaabba620, self=0x2aaaaabda010) at synedit.pp:1639
#14 0x0000000000770fba in CHANGED (self=0x2aaaaabba620) at src//fphelper.inc:70
#15 0x00000000006fb3ed in CHANGED (self=0x2aaaaabba620) at ./include//font.inc:1164
#16 0x00000000006f9bd4 in ENDUPDATE (self=0x2aaaaabba620) at ./include//font.inc:712
#17 0x00000000006f9e46 in SETSIZE (AVALUE=-12, self=0x2aaaaabba620) at ./include//font.inc:759
#18 0x00000000006fa080 in SETHEIGHT (VALUE=12, self=0x2aaaaabba620) at ./include//font.inc:807
#19 0x000000000092b968 in GETSYNEDITSETTINGS
(ASYNEDIT=0x2aaaaabda010, self=0x2ad2280e6c00) at
editoroptions.pp:2372
#20 0x00000000008f8fdb in REFRESHEDITORSETTINGS
(REFRESHEDITORSETTINGS=true, self=0x2aaaaabc21c0) at uniteditor.pp:2076
#21 0x00000000008f955b in CREATEEDITOR (AOWNER=0x2aaaaaaca7f0, APARENT=0x2aaaaabd9ab0, self=0x2aaaaabc21c0) at uniteditor.pp:2129 #22 0x00000000008f3ed5 in CREATE (AOWNER=0x2aaaaaaca7f0, APARENT=0x2aaaaabd9ab0, vmt=0x10f7af8, self=0x2aaaaabc21c0) at uniteditor.pp:1000
#23 0x0000000000901c32 in NEWSE (NEWSE=0x603722, PAGENUM=0, self=0x2aaaaaaca7f0) at uniteditor.pp:3964
#24 0x000000000090663f in NEWFILE (NEWSHORTNAME=0x2aaaaabb1e30 'Unit1', ASOURCE=0x2aaaaaad8600, FOCUSIT=true, self=0x2aaaaaaca7f0) at uniteditor.pp:5103
#25 0x00000000006394e3 in DONEWFILE (DONEWFILE=1,
NEWFILEDESCRIPTOR=0x2ad2284f5340, ,
NEWSOURCE=0x0,
NEWFLAGS=261, NEWOWNER=0x0, self=0x2ad227f7c1c0) at main.pp:6081 #26 0x0000000000849278 in DONEWEDITORFILE (DONEWEDITORFILE=10962, NEWFILEDESCRIPTOR=0x2ad2284f5340, NEWFILENAME=0x2ad22889e890 'unit1.pas',
NEWSOURCE=0x0, NEWFLAGS=261, self=0x2ad227f7c1c0) at lazideintf.pas:290
#27 0x0000000000885b0d in CREATESTARTFILES (CREATESTARTFILES=0, APROJECT=0x2aaaaaadc040, self=0x2ad22893d180) at project.pp:4572 #28 0x000000000063e511 in DONEWPROJECT (DONEWPROJECT=1, PROJECTDESC=0x2ad22893d180, self=0x2ad227f7c1c0) at main.pp:7163 #29 0x0000000000624d99 in SETUPSTARTPROJECT (self=0x2ad227f7c1c0) at main.pp:1729
#30 0x0000000000621b4a in STARTIDE (self=0x2ad227f7c1c0) at main.pp:1136
#31 0x00000000005de29a in main () at lazarus.pp:97

Regards.

Jesus Reyes A.

____________________________________________________________________________________ ?S? un mejor besador!
Comparte todo lo que sabes sobre besos.
http://mx.yahoo.com/promos/mejorbesador.html

Jesus Reyes
to Jesus Reyes

--- Jesus Reyes escribi?:

Show quoted text 38 lines
--- escribi?: > Quoting Giulio Bernardi : > > >> > >> maybe you should recompile libqt4intf on your own. It can causes > problems. > >> _______________________________________________ > > > > Yes I always do this :) > > ok, then any feedback will be appreciated :) starting qt lazarus under linux 64 bits, fpc 2.3.1, qt4.3 (gdb) set args --nsc --skip-last-project (gdb) r Starting program: /home/prog/lazarus/lazarus --nsc --skip-last-project [Thread debugging using libthread_db enabled] [New Thread 47082101943104 (LWP 13889)] Qt: gdb: -nograb added to command-line options. Use the -dograb option to enforce grabbing. TApplication.IconChanged - TODO: convert this message...no implementation in gtk or win32 NOTE: codetools config file not found - using defaults [New Thread 1082132800 (LWP 13905)] NOTE: help options config file not found - using defaults TMainIDE.DoNewProject A TMainIDE.DoNewEditorFile A NewFilename= Program received signal SIGSEGV, Segmentation fault. [Switching to Thread 47082101943104 (LWP 13889)] 0x00000000005ebaab in FREE (self=0x2880a5a0) at /home/prog/fpc/rtl/inc//objpas.inc:152 152 self.destroy;

fixed in r11674

Jesus Reyes A.

____________________________________________________________________________________ ?S? un mejor besador!
Comparte todo lo que sabes sobre besos.
http://mx.yahoo.com/promos/mejorbesador.html

Giulio Bernardi
to Jesus Reyes: --- Jesus Reyes escribi?: fixed in r11674 Jesus Reyes A.…
fixed in r11674

I still have problems... but it's very strange.
After your patch, lazarus starts (via ./startlazarus). However keeps crashing when starting it with ./lazarus, and gdb tells me something that shouldn't be related to the timer issue.

In fact, when lazarus starts it tells me that last project made lazarus crash, so a dialog box asks me if I want to try to reopen that project or not. When I click a button in the dialog, the ide crashes. What happens is this:

The dialog is created from QuestionDlg, that at some time calls ShowModal (of CustomForm).
ShowModal does a
ActiveWindow := GetActiveWindow;
(in the qt interface, it asks to the bindings for the active window, and then finds the qtwidget object if I understood correctly). After showing the Dialog, ShowModal does a
if ActiveWindow 0 then SetActiveWindow(ActiveWindow); In qt interface, we have

procedure TQtWidget.Activate;
begin
  QWidget_activateWindow(Widget);
end;

Widget passes TheObject, but TheObject is nil, so there is a SIGSEGV.

This is what seems to happen, but I'm a bit lost, and compiling with -dVerboseQt gives a lot of compilation errors.

_________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

Unknown author
to Giulio Bernardi

Quoting Giulio Bernardi :

Show quoted text 33 lines
> fixed in r11674 > I still have problems... but it's very strange. After your patch, lazarus starts (via ./startlazarus). However keeps crashing when starting it with ./lazarus, and gdb tells me something that shouldn't be related to the timer issue. In fact, when lazarus starts it tells me that last project made lazarus crash, so a dialog box asks me if I want to try to reopen that project or not. When I click a button in the dialog, the ide crashes. What happens is this: The dialog is created from QuestionDlg, that at some time calls ShowModal (of CustomForm). ShowModal does a ActiveWindow := GetActiveWindow; (in the qt interface, it asks to the bindings for the active window, and then finds the qtwidget object if I understood correctly). After showing the Dialog, ShowModal does a if ActiveWindow 0 then SetActiveWindow(ActiveWindow); In qt interface, we have procedure TQtWidget.Activate; begin QWidget_activateWindow(Widget); end; Widget passes TheObject, but TheObject is nil, so there is a SIGSEGV. This is what seems to happen, but I'm a bit lost, and compiling with -dVerboseQt gives a lot of compilation errors.

hm ... I don't have 64bit linux installation, so cannot help. Any ? I would like that we have 64bit compilation/running before 0.24 go out. Giulio, if you have any ideas || patch please provide so I can test against 32bit and if it work it will be commited.

grazie :)

zeljko

Giulio Bernardi
to Giulio Bernardi: I still have problems... but it's very strange. After your patch, lazarus starts (via…
I still have problems... but it's very strange. After your patch, lazarus starts (via ./startlazarus). However keeps crashing when starting it with ./lazarus, and gdb tells me something that shouldn't be related to the timer issue.

Ok, sorry, it's not a bug related to 64 bit, However it's a qt interface bug :P
You can reproduce it this way:

edit your .lazarus/protocol.xml so that it's like that:

<?xml version="1.0"?>
<CONFIG>
<Protocol Version="1">
<LastProjectLoading Failed="True"/>
</Protocol>
</CONFIG>

start lazarus with ./lazarus.

It fails even on 32 bit, in the way in wrote in the other mail. I think it should be a qt-interface bug because a gtk compiled lazarus starts fine in these conditions.

Probabily I had my protocol.xml set like that because of former crashes of qt-lazarus, and then I had it crashing because of this (not 64 bit) bug :P

bye,
Giulio

_________________________________________________________________ Express yourself instantly with MSN Messenger! Download today it's FREE! http://messenger.msn.click-url.com/go/onm00200471ave/direct/01/

Unknown author
to Giulio Bernardi

Quoting Giulio Bernardi :

Show quoted text 5 lines
start lazarus with ./lazarus. It fails even on 32 bit, in the way in wrote in the other mail. I think it should be a qt-interface bug because a gtk compiled lazarus starts fine in these conditions.

ide is still "watch but don't touch" :), but has huge progress last days, bugs will be fixed and ide probably should be useable in next month or two.

Probabily I had my protocol.xml set like that because of former crashes of qt-lazarus, and then I had it crashing because of this (not 64 bit) bug :P

so, can you confirm that apps & ide are compileable on 64bits machines in normal conditions ?

tnx
zeljko