Preston L. Bannister { random memes }

2009.11.30

Identifying and documenting bugs in Sun Java Printing

Filed under: Software — Preston L. Bannister @ 1:26 pm

I have had a fair amount of trouble with odd behaviors and bugs in printing with Java. The time I have had to spend at work to eliminate troublesome behavior in a heavily used Java application (both before customers see the problem, and after customers report problems) … is embarrassing.

After getting stuck on the latest problem, I finally built a “PrintExplorer” test program. The sources are up on Kenai, and on my website. In both cases the sources are in a Mercurial repository, and I “push” changes to both (one of the nice features of Mercurial). The project was built using NetBeans 6.7, and you can download the built PrintExplorer.jar file.

Run as usual:

java -jar PrintExplorer.jar

(On Windows you can just double-click the JAR file.)

I filed two reports (so far, with review ids: 1660182 and 1660234) with bugs.sun.com, though for all I know that may be a black hole (or not … I have no idea). With the OpenJDK and JDK7 work there may be better places to report/record this … I do not know. (If you know a better path, please let me know.)

Found so far:

  • PrinterJob.getPageDialog() makes invalid change to page size. (log)
  • Toolkit.getPrintJob() changes JobAttributes.getPrinter() to default(?) printer. (log)
  • Quarter-sized pages sometimes printed on an HP DeskJet 5550 on Windows 7. (log)

I am sure there are more. :/

Note that PrintExplorer always generates a log file. The log file contains the parameter values and print operations performed. (You need to be acquainted with Java Printing, otherwise the test program will be entirely obscure.) If you can reproduce a problem, then you can see in the log file exactly what you did, and what was returned. (Useful when you lost track of the exact sequence of steps.) When you send a log file, anyone can verify the exact sequence of steps you followed (a mistake in the problem description can be caught).

At this point the DocPrinterJob works for an empty Doc and a Pageable Doc, but not for a Reader Doc. (Unclear if the last is my bug, or a Java bug.)

Update – 2010.02.01
Today the filed reports became public-visible bugs 6921596 and 6921597.

2009.11.23

Tilting at windmills

Filed under: Software — Preston @ 11:10 pm

Bought a Canon MX860. Did my research beforehand, and was able to force-install the 32-bit Canon drivers (for printing) on my 64-bit Ubuntu desktop. Getting scanning to work is another exercise as yet not done. The fact that Canon has published sources that (with the exception of a missing library) could be compiled as 64-bit native, lead me to poke Canon USA support.

My original query as represented in Canon’s support system (and trimmed):

Original Message Follows:
————————-
Email Support Form Message
Product Type: PIXMA MX860
Product Serial Number: absx22394
Date of Purchase: 11/18/2009
First Name: Preston
Last Name: Bannister
Address: 14 Vallecito
City: Foothill Ranch
State: CA
Zip: 92610
Phone Number: 9495880872
Email Address: preston@bannister.us
INQUIRY: Need drivers for 64-bit Ubuntu (Debian Linux).
Found the 32-bit drivers and sources on the Canon European site, but the sources are incomplete, so I cannot compile a 64-bit version.
Either compiled 64-bit drivers, or a complete set of sources would be acceptable.

The response was pretty predictable, if not exactly addressing the question as posed.

On Fri, Nov 20, 2009 at 5:09 AM, Canon Support – MFP <mfp @cits.canon.com> wrote:

Dear Preston Bannister:

Thank you for contacting Canon product support. We value you as a Canon customer and appreciate the opportunity to assist you. We regret the issues experienced with locating Linux drivers for the MX860.

Canon USA does not support Linux with its consumer products. The only recommendation I can offer would be to check the various Linux enthusiast websites to see if anyone has successfully attempted writing a third party driver.

We apologize for any inconvenience. Please let us know if we can be of any further assistance with your MX860.

Sincerely,

James
Technical Support Representative

Since there is always a chance (if small) of a constructive outcome, I tried again.

What I did was find that the Canon Europe and Canon Australia sites distribute Canon-developed Linux drivers for the MX860 (and other printers).

The software is pretty well done, has an active documented development history that goes at least to the year 2000, and is distributed as both binaries and source.

Odd that Canon USA does not distribute Canon-developed drivers (in which Canon has made a significant investment).

This is a case of so-close-but-not-quite there. The effort required for Canon to have a complete offering is pretty small, if someone can find the right branch of the company hierarchy to nudge.

Any chance of finding who within Canon sponsored development of the existing drivers for Linux?

The last response, which sounds dangerously close to “Fuck you. Go away.” (Though I would gladly be proven wrong.)

Dear Preston Bannister:

We appreciate your continued correspondence regarding Linux drivers for your PIXMA MX860.

I have forwarded your comments to Canon USA through our Customer Feedback process. This process allows us to capture important feedback from our valued customers. As we constantly strive to improve our products and services, your comments are vital to our continued success.

We hope this information is helpful to you. Please let us know if we can be of any further assistance with your PIXMA MX860.

Thank you for choosing Canon.

Sincerely,

George
Technical Support Representative

Had to try….

2009.11.20

Apples iTunes store hacked?

Filed under: General — Preston @ 12:00 am

Just arrived in email.

Billed To:
preston@bannister.us
Preston Bannister
14 Vallecito
Foothill Ranch, CA 92610

Order Number: MGLN2G836G
Receipt Date: 11/19/09
Order Total: $4.99
Billed To: MasterCard …. 1234

Item Number
1

Description
변환기, v1.0, Seller: Wang Xi|299225365 (4+)

Unit Price
$4.99

Write a Review
Report a Problem

Subtotal: $4.99
Tax: $0.00
Order Total: $4.99

Please retain for your records.
Please See Below For Terms And Conditions Pertaining To This Order.

Apple Inc.
You can find the iTunes Store Terms of Sale and Sales Policies by launching your iTunes application and clicking on Terms of Sale or Sales Policies

Answers to frequently asked questions regarding the iTunes Store can be found at http://www.apple.com/support/itunes/store/

I do not have iTunes installed. Both my desktop and laptop are running Ubuntu Linux. Also I cannot read Chinese Korean, so I do not know what was ordered. The “Report a Problem” link asks me to install iTunes.

I am guessing the iTunes store has a (big!) problem.

Update:
No charges have appeared on my credit card (so far).

I eventually found a “support” link for the iTunes site where you fill out a form to send email. Had to lie a bit as you cannot complete the form without indicating the OS on which you are running iTunes. Linux is not offered as a choice. The first email from Apple was not useful (“run iTunes to check on your account”, grrr). I replied with a copy of the receipt, and they did … something.

If no credit card charge appears, my guess is the Apple caught the problem part-way through.

Got an email from another iTunes customer who also got a receipt with the exact same mysterious item. Interesting.

Update (2):
The charge just appeared on my credit card, so it is not clear the exchange with iTunes Support addressed the problem.

Update (3):
Shortly after my last email (where I again described the problem, and added the other guy’s receipt), Apple Support sent an unexpected email refunding the charge to the other guy! Right. Half-successful?

2009.11.10

Shallow or deep?

Filed under: Politics — Preston @ 5:59 am

The current trade dispute between China and the US – on the surface – really makes no sense.

China to investigate U.S. car subsidies
China is preparing to launch a trade investigation into whether US carmakers are being unfairly subsidised by the US government, according to people familiar with the matter.

The move comes at a time of heightened trade tensions between the two countries after the US imposed duties on Chinese tyres last month. Many warned this would prompt Beijing to retaliate.

Interesting. Is this shallow, or deep?

China is using extraordinary measures to keep the dollar high and the yuan low. This has huge effect on trade. Words from the US to China have no leverage, at least compared to China’s near-term benefit from continued exports.

What has leverage? An import duty on tires … really … why tires? Is there some shallow US domestic political motivation? Or is this an opening move with enough lead time prior to Obama visiting China?

The Chinese government used to subsidize all sorts of industries, and they probably still do to some degree. At least some of that goes into exports. Tagging the US for subsidizing an industry – one that likely does more imports from China than exports to China – is odd. If the yuan rises relative to the dollar, then US exports to China become more competitive. Bit of a doubled impact on the Chinese economy (less exports and more imports). Discouraging imports from the US through import duties could lessen that impact. Is this a pretext for the logical counter-move (but not a strong move). Again, is this shallow or deep?

In this game, China is on the wrong end of the lever. Less trade between the US and China is likely to hurt China far more than the US. There may be some point in the future when they can absorb the loss of exports to the US. Is China at that point now? Or more relevant, do the Chinese leadership believe China is at that point?

My bet is that the Chinese leadership is too conservative, too cautious to want to risk too much change. China is a country of “rule by men”, not “rule by law”. Obama meeting with the Chinese leaders would be the point where – privately – the game is made plain … if this the deeper game. If China allows the yuan to rise after the meeting – that would be a big clue. (Likely China will keep buying dollars, but at a lesser rate – a sort of compromise.)

Is this shallow, or deep?

2009.11.08

GTK bug in Ubuntu 9.10

Filed under: General — Preston @ 12:35 pm

Upgraded my desktop from Ubuntu 9.04 to 9.10. That was a mistake. I could really use an “undo” button right about now (as ZFS users have for large scale file system changes).

The problem is buttons. A change in GTK+ 2.18 broke Eclipse, and anything based on Eclipse.

There are a number of bug reports tracking this problem. On the Eclipse site look at:
Bug 291257 – [Widgets] Buttons functionality problem with GTK+ 2.18

There is a work-around offered on the above ticket (setting the GTK_NATIVE_WINDOWS environment variable). It seems to work for some. For others – myself included – it causes another severe problem (for which there are other bug reports).

#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGSEGV (0xb) at pc=0x00007f30eb1e7f7a, pid=4766, tid=139848919398672
#
# JRE version: 6.0_16-b01
# Java VM: Java HotSpot(TM) 64-Bit Server VM (14.2-b01 mixed mode linux-amd64 )
# Problematic frame:
# C  [libpango-1.0.so.0+0x24f7a]  pango_layout_new+0x2a
#

Strictly speaking, this is a bug in GTK. A new version of GTK shipped that was meant to be compatible, but instead broke existing applications (at the very least those based on Eclipse). The application use of GTK might (or might not) be considered in some way improper, but practical considerations should be dominant.

Fixing this in GTK will in one step remove the problem in all currently impacted applications. Fixing this in Eclipse will only help new and newly updated Eclipse installations. Existing Eclipse-based applications will continue to be impacted until (and if) updated by their respective developers.

Other related/duplicate bug reports:
Buttons in Eclipse not working correctly with GTK+ 2.18.1-1
Eclipse loses button events with swt-gtk in karmic
GDK_NATIVE_WINDOWS=1 still required for some dialogs
Breaks Default button in some eclipse dialogs (and rcp apps)