Technical article 125538

when a Java invoked application pipes a print job to /usr/lpd/remote/lp it dumps core.

OpenServer 5.0.5OpenServer 5.0.6OpenServer 5.0.7

Written · Last revised

Problem

I have created an application that opens a pipe to send a job to the lp command. This application works fine from the command line. However, if I invoke this application from a Java application via the runtime exec method, the print job does not succeed and a core file is produced. Examination of the core file generated shows that it was the /usr/lpd/remote/lp binary that coredumped. This problem does not occur, however, if the print job is being sent to a local printer.

Solution

This has been reported to SCO Engineering.

As a workaround, you can modify the lp command within the application that is invoked by your Java application to include a "-" at the end of the command. For example, if your original lp command looks like

char *printercmd = "lp -s -dprintername >/dev/null 2>&1";
you can change this to
char *printercmd = "lp -s -dprintername - >/dev/null 2>&1";
to prevent lp from dumping core.

From the Xinuos technical article database, record 125538. Reproduced with permission. The original is at www.sco.com/ta/125538, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.