View Issue Details

IDProjectCategoryView StatusLast Update
0000550CUPS for OS/2 & eComStationBugpublic2020-08-24 03:13
Reporterdiver Assigned Topsmedley  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionfixed 
Summary0000550: Qt Apps can't print
DescriptionWith the recent build of cups (1.4.8) i'm not able to print anything from Qt apps.
Steps To ReproduceUse a small Qt app like Textedit from the Qt Demos and print the file. It sends it to cups, but cups can't print it. If i look at the file i see that the file is larger that it should be. I suspect some kind of CRLF problems
TagsNo tags attached.

Activities

psmedley

2012-10-25 09:36

administrator   ~0002332

will try look at this over the weekend

psmedley

2012-10-26 08:43

administrator   ~0002333

unfortunately, right now I am struggling to test. In my virtualised environment, as soon as I select print from a qt app, the app effectively locks up and needs to be killed - I can't get a list of printers :(

psmedley

2012-10-26 08:55

administrator   ~0002334

My T60 can still run ecS natively - will try a setup on that hardware tomorrow

psmedley

2012-10-27 08:11

administrator   ~0002335

I read your IRC comments about the use of cupsPrintFiles()

This same API is used by lpr.exe in CUPS and seems to work fine - ie:
lpr.exe testprint.ps prints perfectly.

psmedley

2012-10-27 08:15

administrator   ~0002336

ahh lpr uses cupsPrintFiles - Qt uses cupsPrintFile

subtle, but potentially important difference

psmedley

2012-10-27 08:18

administrator   ~0002337

testcups.exe from cups uses cupsPrintFile and works fine. I suspect a Qt bug...

psmedley

2012-10-27 08:25

administrator   ~0002338

the only other opportunity I see for cups to be to blame is the use of cupsTempFd() in qcups.cpp

however, the relevant cups code sets binary on OS/2:
#ifdef WIN32
    fd = open(filename, _O_CREAT | _O_RDWR | _O_TRUNC | _O_BINARY,
              _S_IREAD | _S_IWRITE);
#elif __OS2__
    fd = open(filename, O_RDWR | O_CREAT | O_EXCL | O_NOFOLLOW | O_BINARY, 0600);
#elif defined(O_NOFOLLOW)
    fd = open(filename, O_RDWR | O_CREAT | O_EXCL | O_NOFOLLOW, 0600);
#else
    fd = open(filename, O_RDWR | O_CREAT | O_EXCL, 0600);
#endif /* WIN32 */

just in case, i've added a call to use setmode to set the fs to O_BINARY

New cups.dll at http://smedley.id.au/cups.zip

diver

2012-10-29 10:47

reporter   ~0002339

i just tried the new dll, but still the same. could you zip up your source tree, so i can look at it. as the app i'm testing cupsPrintFile() uses i doubt it's a Qt bug.

psmedley

2012-10-30 08:32

administrator   ~0002340

http://smedley.id.au/cups-1.4.8-src.zip

What app are you trying to print from? looking at the source might give me some clues as to which api's it's using (other than cupsprintfile)

diver

2012-10-30 14:47

reporter   ~0002341

for me even lpr doesn't print. i tried to print with the following command:
lpr -T test -P HP_LaserJet_6P d:\download\anypdf.pdf

i have the feeling it's only a problem if pdf's are printed as Qt apps produce pdf and send them to cups.

psmedley

2012-10-31 04:48

administrator   ~0002342

i wonder if its a problem with pdftops.exe given that it's pdf files that cause the problem - i will investigate tonight

psmedley

2012-10-31 08:12

administrator   ~0002343

hopefully email notifications will work now

psmedley

2012-10-31 08:19

administrator   ~0002344

nope try this one

psmedley

2012-10-31 08:39

administrator   ~0002345

Try replacing /cups/lib/cups/pdftops.exe with the copy at http://smedley.id.au/pdftops.zip

psmedley

2012-10-31 08:40

administrator   ~0002346

The problem was actually the use of pipe (ILO socketpair) in CUPS pdftops.exe

diver

2012-10-31 09:12

reporter   ~0002347

either i replaced the wrong exe or i have no clue, as it's still not working here.
notification works again thanks

psmedley

2012-11-01 09:00

administrator   ~0002348

slowly making progress. The above fixes _part_ of the prolem.

The remainder is that the file created in /cups/var/spool is butchered.

eg.
31/10/12 5:39 14,022 0 Invoice_AU_CMR_SMB_2406567255_2012-
10-30.pdf

becomes:
 1/11/12 19:13 14,284 124 d00077-001

I can't figure out (yet) why this happening

psmedley

2012-11-02 09:02

administrator   ~0002349

sample of first few lines shows additional blank lines inserted.

ie PDF
%PDF-1.4
%ÔÒ¤Ë
1 0 obj
<<
/Type /Catalog

becomes
%PDF-1.4
%ÔÒ¤Ë

1 0 obj

<<

/Type /Catalog

psmedley

2012-11-03 05:27

administrator   ~0002350

This should be fixed in the build I'll release either today or tomorrow

diver

2012-11-03 08:31

reporter   ~0002351

What was the cause? could you send me the diff?

psmedley

2012-11-03 08:35

administrator   ~0002352

http://smedley.id.au/cups-1.4.8-os2-20121103.zip binary + diff

scheduler/client.c opened a temp file without O_BINARY

Above zip is still a work in progress, will add it to my site once it's a little more polished

psmedley

2012-11-04 02:41

administrator   ~0002353

uggh can't add a new printer with this build :(

psmedley

2012-11-04 05:37

administrator   ~0002354

Please test http://smedley.id.au/cups-1.4.8-os2-20121104.zip

Adding printer seems to work here. The fix for printing PDF's via lpr.exe broke adding printing. Compiling the whole thing with -Zbin-files appears to have fixed that, and not broken anything else

diver

2012-11-05 14:13

reporter   ~0002355

this seems to work with the small tests i did.
but be aware that afaik -Zbin-files is useless on dll. if the exe using the dll is built with -Zbin-files all is ok, but if the exe doesn't have it also the dll will not use it.

psmedley

2012-12-25 07:36

administrator   ~0002391

I believe this is resolved in the latest CUPS builds

Issue History

Date Modified Username Field Change
2012-10-24 13:33 diver New Issue
2012-10-25 09:36 psmedley Note Added: 0002332
2012-10-26 08:43 psmedley Note Added: 0002333
2012-10-26 08:55 psmedley Note Added: 0002334
2012-10-27 08:11 psmedley Note Added: 0002335
2012-10-27 08:15 psmedley Note Added: 0002336
2012-10-27 08:18 psmedley Note Added: 0002337
2012-10-27 08:25 psmedley Note Added: 0002338
2012-10-29 10:47 diver Note Added: 0002339
2012-10-30 08:32 psmedley Note Added: 0002340
2012-10-30 14:47 diver Note Added: 0002341
2012-10-31 04:48 psmedley Note Added: 0002342
2012-10-31 08:12 psmedley Note Added: 0002343
2012-10-31 08:19 psmedley Note Added: 0002344
2012-10-31 08:39 psmedley Note Added: 0002345
2012-10-31 08:40 psmedley Note Added: 0002346
2012-10-31 09:12 diver Note Added: 0002347
2012-11-01 09:00 psmedley Note Added: 0002348
2012-11-02 09:02 psmedley Note Added: 0002349
2012-11-03 05:27 psmedley Note Added: 0002350
2012-11-03 08:31 diver Note Added: 0002351
2012-11-03 08:35 psmedley Note Added: 0002352
2012-11-04 02:41 psmedley Note Added: 0002353
2012-11-04 05:37 psmedley Note Added: 0002354
2012-11-05 14:13 diver Note Added: 0002355
2012-12-25 07:36 psmedley Note Added: 0002391
2012-12-25 07:36 psmedley Status new => resolved
2012-12-25 07:36 psmedley Resolution open => fixed
2012-12-25 07:36 psmedley Assigned To => psmedley
2020-08-24 03:13 psmedley Status resolved => closed