error running Clipper/Fivewin 16 bit application

Questions about Wine on Linux
Locked
pepinfor
Level 1
Level 1
Posts: 6
Joined: Fri Jan 25, 2013 11:52 am

error running Clipper/Fivewin 16 bit application

Post by pepinfor »

I am trying to use in Linux (Ubuntu 12.04.1 LTS 32 bit) one of my Windows applications using Wine (1.4).
The 16 bit application (which is downloadable from http://www.pep.it/ric_setup.exe) is written using Clipper for Dos compiler with Fivewin 1.7 library for Windows GUI. It runs quite well, despite a couple of "fixme:hook:SetWindowsHookEx16 System-global hooks (-1) broken in Win16", but with some relevant bug:
1) when I have a listbox, the field is not correctly initialized (figure 1), despite the list is ok;
2) when browsing data, the used font is badly rendered (figure 2);
2) when printing, any printer is selected, the application aborts (figure 3) with the following dump:
Unhandled exception: page fault on read access to 0x00223000 in 32-bit code (0x682b7f8c).
Register dump:
CS:0073 SS:007b DS:007b ES:007b FS:0033 GS:003b
EIP:682b7f8c ESP:00bdcdd8 EBP:00bdce18 EFLAGS:00210206( R- -- I - -P- )
EAX:00222f88 EBX:68324ff4 ECX:000cf574 EDX:016efa40
ESI:0010e014 EDI:001e4568
Stack dump:
0x00bdcdd8: 68592ff4 6856b109 016b1020 001e4568
0x00bdcde8: 0010e014 6858a51c 00000002 00008398
0x00bdcdf8: 00bdce18 68632388 00000002 0010e014
0x00bdce08: 0000146f 20026ff4 00001e9e 00008398
0x00bdce18: 00bdce58 2001f86c 00008398 0010e014
0x00bdce28: 016b1020 00000000 00000000 00000000
Backtrace:
=>0 0x682b7f8c in libc.so.6 (+0x138f8c) (0x00bdce18)
1 0x6856b109 GetMetaFileBitsEx+0x68() in gdi32 (0x00bdce18)
2 0x2001f86c in gdi.exe16 (+0xf86b) (0x00bdce58)
3 0x2001f8ba CloseMetaFile16+0x19() in gdi.exe16 (0x00bdce78)
4 0x20015e00 in gdi.exe16 (+0x5dff) (0x00bdce88)
5 0x68627cbe in krnl386.exe16 (+0x7cbd) (0x00bdceb8)
6 0x1537:0x71d9 (0x16ff:0x9ddc)
7 0x151f:0x6de4 (0x16ff:0x9df4)
8 0x151f:0x2f17 (0x16ff:0x9dfe)
9 0x155f:0x000d (0x16ff:0x9e12)
10 0x151f:0x754a (0x16ff:0x9e30)
11 0x14b7:0x04ec (0x16ff:0x9e4e)
12 0x14af:0xeb06 (0x16ff:0x9e6c)
13 0x14af:0xe818 (0x16ff:0x9e8a)
14 0x14af:0xe156 (0x16ff:0x9ea8)
15 0x157f:0x1702 (0x16ff:0x9ed6)
16 0x155f:0x0c87 (0x16ff:0x9ee8)
17 0x157f:0x1702 (0x16ff:0x9f16)
18 0x155f:0x0c87 (0x16ff:0x9f28)
19 0x157f:0x1702 (0x16ff:0x9f56)
20 0x156f:0x2c10 (0x16ff:0x9f68)
21 0x155f:0x000d (0x16ff:0x9f78)
22 0x1537:0x45d7 (0x16ff:0x9f8c)
23 0x156f:0x2bb5 (0x16ff:0x9f9a)
24 0x155f:0x000d (0x16ff:0x9faa)
25 0x154f:0x3928 (0x16ff:0x9fba)
26 0x101f:0x0468 in krnl386.exe16 (+0x80af) (0x16ff:0x9ff4)
0x682b7f8c: repe movq 0x70(%eax),%mm7
Modules:
Module Address Debug info Name (123 modules)
ELF 20000000-2002d000 Dwarf gdi.exe16.so
PE 20010000-2002d000 DIA gdi.exe16
ELF 2002d000-20042000 Deferred display.drv16.so
PE 20030000-20042000 Deferred display.drv16
ELF 20042000-20121000 Deferred comdlg32<elf>
\-PE 20050000-20121000 \ comdlg32
ELF 20121000-20155000 Deferred uxtheme<elf>
\-PE 20130000-20155000 \ uxtheme
ELF 20155000-20167000 Deferred libavahi-client.so.3
ELF 20167000-2016c000 Deferred libcom_err.so.2
ELF 2016c000-2017e000 Deferred libtasn1.so.3
ELF 20b5b000-20b73000 Deferred shell.dll16.so
PE 20b60000-20b73000 Deferred shell.dll16
ELF 2522e000-25241000 Deferred gnome-keyring-pkcs11.so
ELF 25928000-2592d000 Deferred libgpg-error.so.0
ELF 25cf4000-25d2c000 Deferred usp10<elf>
\-PE 25d00000-25d2c000 \ usp10
ELF 274fb000-27523000 Deferred mmsystem.dll16.so
PE 27500000-27523000 Deferred mmsystem.dll16
ELF 2d313000-2d3d7000 Deferred libgnutls.so.26
ELF 2f24f000-2f28d000 Deferred libgssapi_krb5.so.2
ELF 2fa50000-2fa67000 Deferred commdlg.dll16.so
PE 2fa60000-2fa67000 Deferred commdlg.dll16
ELF 3018c000-301b2000 Deferred mpr<elf>
\-PE 30190000-301b2000 \ mpr
ELF 32b9e000-32bb3000 Deferred keyboard.drv16.so
PE 32ba0000-32bb3000 Deferred keyboard.drv16
ELF 34f27000-34f30000 Deferred libkrb5support.so.0
ELF 37014000-37029000 Deferred sound.drv16.so
PE 37020000-37029000 Deferred sound.drv16
ELF 39c55000-39c7d000 Deferred libk5crypto.so.3
ELF 3b34e000-3b3b8000 Deferred shlwapi<elf>
\-PE 3b360000-3b3b8000 \ shlwapi
ELF 3b3c9000-3b3d7000 Deferred libavahi-common.so.3
ELF 3f154000-3f16f000 Deferred spoolss<elf>
\-PE 3f160000-3f16f000 \ spoolss
ELF 4075e000-407b1000 Deferred libcups.so.2
ELF 41c81000-41cc8000 Deferred user.exe16.so
PE 41c90000-41cc8000 Deferred user.exe16
ELF 4a4e9000-4a55e000 Deferred rpcrt4<elf>
\-PE 4a4f0000-4a55e000 \ rpcrt4
ELF 4b4ca000-4b53d000 Deferred wineps<elf>
\-PE 4b4f0000-4b53d000 \ wineps
ELF 50000000-50014000 Deferred mouse.drv16.so
PE 50010000-50014000 Deferred mouse.drv16
ELF 522f9000-52333000 Deferred winspool<elf>
\-PE 52300000-52333000 \ winspool
ELF 54339000-54441000 Deferred ole32<elf>
\-PE 54350000-54441000 \ ole32
ELF 57e6f000-57e73000 Deferred libkeyutils.so.1
ELF 5817a000-58183000 Deferred librt.so.1
ELF 5e087000-5e09f000 Deferred libresolv.so.2
ELF 6191a000-6199f000 Deferred libgcrypt.so.11
ELF 647c4000-647d6000 Deferred libp11-kit.so.0
ELF 64af9000-64ba6000 Deferred winmm<elf>
\-PE 64b00000-64ba6000 \ winmm
ELF 6744c000-6765d000 Deferred shell32<elf>
\-PE 67460000-6765d000 \ shell32
ELF 68000000-68022000 Deferred ld-linux.so.2
ELF 68022000-68164000 Dwarf libwine.so.1
ELF 68164000-6817f000 Deferred libpthread.so.0
ELF 6817f000-68329000 Dwarf libc.so.6
ELF 68329000-6832e000 Deferred libdl.so.2
ELF 6832e000-6835a000 Deferred libm.so.6
ELF 6835a000-68363000 Deferred libnss_compat.so.2
ELF 68363000-6837d000 Deferred libnsl.so.1
ELF 6837d000-68389000 Deferred libnss_nis.so.2
ELF 68389000-68396000 Deferred libnss_files.so.2
ELF 68396000-683ad000 Deferred winevdm<elf>
\-PE 683a0000-683ad000 \ winevdm
ELF 683ad000-684ed000 Deferred user32<elf>
\-PE 683c0000-684ed000 \ user32
ELF 684ed000-685aa000 Dwarf gdi32<elf>
\-PE 68500000-685aa000 \ gdi32
ELF 685aa000-6860a000 Deferred advapi32<elf>
\-PE 685c0000-6860a000 \ advapi32
ELF 6860a000-686a9000 Dwarf krnl386.exe16.so
PE 68620000-686a9000 DIA krnl386.exe16
ELF 686a9000-686cb000 Deferred libncurses.so.5
ELF 686cb000-68765000 Deferred libfreetype.so.6
ELF 68765000-6877b000 Deferred libz.so.1
ELF 6877b000-6880e000 Deferred winex11<elf>
\-PE 68790000-6880e000 \ winex11
ELF 6880e000-68817000 Deferred libsm.so.6
ELF 68817000-68829000 Deferred libxext.so.6
ELF 68829000-6895d000 Deferred libx11.so.6
ELF 6895d000-68977000 Deferred libice.so.6
ELF 68977000-6897d000 Deferred libuuid.so.1
ELF 6897d000-6899e000 Deferred libxcb.so.1
ELF 6899e000-689a2000 Deferred libxau.so.6
ELF 689a2000-689a9000 Deferred libxdmcp.so.6
ELF 689a9000-689cb000 Deferred imm32<elf>
\-PE 689b0000-689cb000 \ imm32
ELF 689cb000-689cf000 Deferred libxinerama.so.1
ELF 689cf000-689d5000 Deferred libxxf86vm.so.1
ELF 689d5000-689df000 Deferred libxrender.so.1
ELF 689df000-689e8000 Deferred libxrandr.so.2
ELF 689e8000-689f8000 Deferred libxi.so.6
ELF 689f8000-68a2c000 Deferred libfontconfig.so.1
ELF 68a2c000-68a56000 Deferred libexpat.so.1
ELF 68a56000-68a61000 Deferred libxcursor.so.1
ELF 68a61000-68a67000 Deferred libxfixes.so.3
ELF 68a67000-68a7c000 Deferred system.drv16.so
PE 68a70000-68a7c000 Deferred system.drv16
ELF 68a7c000-68a90000 Deferred comm.drv16.so
PE 68a80000-68a90000 Deferred comm.drv16
ELF 6a14f000-6a153000 Deferred libxcomposite.so.1
ELF 6b514000-6b55d000 Deferred libdbus-1.so.3
ELF 6c3e7000-6c4b6000 Deferred libkrb5.so.3
ELF 6caea000-6cbe2000 Deferred comctl32<elf>
\-PE 6caf0000-6cbe2000 \ comctl32
ELF 720d2000-720eb000 Deferred version<elf>
\-PE 720e0000-720eb000 \ version
ELF 7414b000-7416c000 Deferred localspl<elf>
\-PE 74150000-7416c000 \ localspl
ELF 7b800000-7ba15000 Deferred kernel32<elf>
\-PE 7b810000-7ba15000 \ kernel32
ELF 7bc00000-7bcc3000 Deferred ntdll<elf>
\-PE 7bc10000-7bcc3000 \ ntdll
ELF 7bf00000-7bf04000 Deferred <wine-loader>
ELF 7c04e000-7c076000 Deferred msacm32<elf>
\-PE 7c050000-7c076000 \ msacm32
ELF 7d700000-7d71f000 Deferred libtinfo.so.5
Threads:
process tid prio (all id:s are in hex)
0000000e services.exe
0000001f 0
0000001e 0
00000015 0
00000010 0
0000000f 0
00000012 winedevice.exe
0000001c 0
00000019 0
00000014 0
00000013 0
0000001a plugplay.exe
00000020 0
0000001d 0
0000001b 0
00000021 explorer.exe
00000022 0
00000023 (D) C:\windows\system32\winevdm.exe
00000027 0
00000026 0 <==
00000025 0
00000024 0
System information:
Wine build: wine-1.4
Platform: i386
Host system: Linux
Host version: 3.2.0-36-generic

Can you help me?
Best regards.
Attachments
1) The empty field
1) The empty field
2) The bad font rendering in lists
2) The bad font rendering in lists
3) The print error
3) The print error
err stampa.png (9.58 KiB) Viewed 4470 times
User avatar
dimesio
Moderator
Moderator
Posts: 13208
Joined: Tue Mar 25, 2008 10:30 pm

Re: error running Clipper/Fivewin 16 bit application

Post by dimesio »

Your Wine version is old; try upgrading to the latest development release.
pepinfor
Level 1
Level 1
Posts: 6
Joined: Fri Jan 25, 2013 11:52 am

Re: error running Clipper/Fivewin 16 bit application

Post by pepinfor »

Now I am using Wine 1.5.22. The print is ok, but the first two problems previously exposed are still here.
User avatar
dimesio
Moderator
Moderator
Posts: 13208
Joined: Tue Mar 25, 2008 10:30 pm

Re: error running Clipper/Fivewin 16 bit application

Post by dimesio »

Terminal output?

For the font issue, try winetricks corefonts.
pepinfor
Level 1
Level 1
Posts: 6
Joined: Fri Jan 25, 2013 11:52 am

Re: error running Clipper/Fivewin 16 bit application

Post by pepinfor »

Corefonts don't helped me, but I solved the font problem changing it into my software.

For the combobox, debugging my application, I have found that it is due to a strange memory management. I start by saying that Clipper/xBase uses dynamic scoping, so the value of a variable is the last assigned to it into the stack; a variable can be local or global (prefixed by m->). When using the dialog that has the problem, I use the activation command (Fivewin library):
m->mTipoDoc:=.... // assign the global variable m->mTipoDoc
activate DIALOG oDlg centered on init (SettaCombo())
function SettaCombo() // initialization code of the dialog
... // use the global variable m->mTipoDoc but, at this point, when using WINE, the variable has lost its content and is empty


I solved the problem using a local variable that temporarily holds the value of the global variable:
m->mTipoDoc:=.... // assign the global variable m->mTipoDoc
local tmpcod:=m->mTipoDoc // to solve the wine bug
activate DIALOG oDlg centered on init (SettaCombo(tmpcod))
function SettaCombo(val)
m->mTipoDoc:=val // to solve the wine bug
... // use the global variable m->mTipoDoc


Evidently the local variable is managed in a different way by WINE and the error has disappered.
Thank you for the collaboration.
lahmbi5678
Level 7
Level 7
Posts: 823
Joined: Thu Aug 27, 2009 6:23 am

Re: error running Clipper/Fivewin 16 bit application

Post by lahmbi5678 »

Nice to hear, that it works for you with some workarounds. Yet this is probably still a bug in wine, so it would be nice, if you filed a bug and attached a sample application to the bug report.
pepinfor
Level 1
Level 1
Posts: 6
Joined: Fri Jan 25, 2013 11:52 am

Re: error running Clipper/Fivewin 16 bit application

Post by pepinfor »

Despite my claim, there is still a bug in printing.
I wrote a sample program (downloadable from http://pep.it/download/test_pr.zip) that prints a very simple report (after a preview).
The report is composed of:
1) a string ("TEST")
2) a bmp image from file test1.bmp
3) an optional bmp image from file test2.bmp
The program asks if you want to print test2.bmp. If "No" is selected, the preview appears as expected, else the program crashes. In Windows Xp, all is ok, instead.
I tried a lot of images that crashed. I suppose that the problem is the size of bmp file.
Best regards.
lahmbi5678
Level 7
Level 7
Posts: 823
Joined: Thu Aug 27, 2009 6:23 am

Re: error running Clipper/Fivewin 16 bit application

Post by lahmbi5678 »

Please file bugs for both issues, the printing/bmp bug and the memory bug (would be nice, if you'd provide a sample app for that issue, too). Filing bugs is the "wine way" to get into contact with the 'hardcore' wine developers, they aren't following this forum closely, and you shouldn't expect us to file bugs for you. This isn't due to lack of helpfulness, it's 'your' app, you know how it should behave, so you should file the bug.
pepinfor
Level 1
Level 1
Posts: 6
Joined: Fri Jan 25, 2013 11:52 am

Re: error running Clipper/Fivewin 16 bit application

Post by pepinfor »

It's ok, I used bugzilla to submit the print error and it seems that the issue was verified and patched. For the memory issue, instead, I am not able to reproduce the problem using simple code (apparently it needs a complex call-stack/memory-usage to happen) and my original application is too complicated to be used as sample program by a Wine developer.
Thank you very much.
pepinfor
Level 1
Level 1
Posts: 6
Joined: Fri Jan 25, 2013 11:52 am

Re: error running Clipper/Fivewin 16 bit application

Post by pepinfor »

I correct myself. Today I am submitting a sample for the memory bug, too.
Bye.
Locked