freereport initialization crash - cups problem?

Grzegorz Prokopski greg at sente.pl
Wed Aug 21 09:52:54 CDT 2002


Hi!

I finally narowed down the problem with crashing freereport app while
it is initializing freereport dll.
I got a workaround, but real fix should be trivial for someone who knows
a bit more about wineps driver.

App was crashing int wineps/init.c:PSDRV_UpdateDevCaps at:
physDev->horzSize = (physDev->horzRes * 25.4) / physDev->logPixelsX
because physDev->logPixelsX == 0

In wineps/init.c:PSDRV_CreateDC I see:
physDev->logPixelsX = physDev->pi->ppd->DefaultResolution;
physDev->logPixelsY = physDev->pi->ppd->DefaultResolution;

in turn ppd->DefaultResolution is filled in wineps/ppd.c:PSDRV_ParsePPD
where it scans for "*DefaultResolution" or "*DefaultJCLResolution" in
ppd file.

For me it was /etc/cups/ppd/lp.ppd (HP DeskJet 694C, Foomatic + cdj550)
Unfortunatelly there was NO "DefaultResolution" information in it.

For now, because the app has more problems with running (now it hangs)
I just added: "DefaultResolution: 20" to this file.

But long term solution would be IMO to check in either ppd.c or
CreateDC if adequatly ppd->DefaultResolution or physDev->LogPixels*
are not 0.

If they are... hm... no idea - maybe we can somehow calculate some
values for that? Surely it shouldn't stay as it is now.
Dividing by zero in wine's code is Bad Thing(tm).

Anyone would propose "the right fix" for this?

Regards

					Grzegorz B. Prokopski







More information about the wine-devel mailing list