Bug 354438

Summary: yast2-printer crashes with SIGPIPE
Product: [openSUSE] openSUSE 10.3 Reporter: Petr Danecek <petr.danecek>
Component: YaST2Assignee: Michal Zugec <mzugec>
Status: RESOLVED FIXED QA Contact: Johannes Meixner <jsmeix>
Severity: Major    
Priority: P3 - Medium    
Version: Final   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE 10.3   
Whiteboard:
Found By: Customer Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: /var/log/YaST2/y2log

Description Petr Danecek 2008-01-17 15:12:40 UTC
The program "/usr/lib/YaST2/bin/y2base printer qt" always crashes, hence I cannot configure the printing system. Bellow is enclosed the gdb backtrace.
I'd be happy to supply more information to get this bug solved quickly.

------------------------------------------------------

...
(no debugging symbols found)
(no debugging symbols found)

Program received signal SIGPIPE, Broken pipe.
[Switching to Thread 0x2b1ab5cf05c0 (LWP 7502)]
0x00002b1ab397b281 in send () from /lib64/libpthread.so.0

bt
#0  0x00002b1ab397b281 in send () from /lib64/libpthread.so.0
#1  0x00002aaab0015e04 in ?? () from /usr/lib64/libcups.so.2
#2  0x00002aaab0015f98 in httpFlushWrite () from /usr/lib64/libcups.so.2
#3  0x00002aaab0016109 in httpWrite2 () from /usr/lib64/libcups.so.2
#4  0x00002aaab001c71e in ippWriteIO () from /usr/lib64/libcups.so.2
#5  0x00002aaab0025e5b in cupsDoFileRequest ()
from /usr/lib64/libcups.so.2
#6  0x00002aaab0243142 in PrintersConf::getPrinters ()
from /usr/lib64/YaST2/plugin/libpy2ag_cups.so.2
#7  0x00002aaab024465c in PrintersConf::readSettings ()
from /usr/lib64/YaST2/plugin/libpy2ag_cups.so.2
#8  0x00002aaab02478b1 in PrintersConf::Read ()
from /usr/lib64/YaST2/plugin/libpy2ag_cups.so.2
#9  0x00002aaab023d52d in CupsAgent::Read ()
from /usr/lib64/YaST2/plugin/libpy2ag_cups.so.2
#10 0x00002aaab025e7d5 in Y2AgentComp<CupsAgent>::evaluate ()
from /usr/lib64/YaST2/plugin/libpy2ag_cups.so.2
#11 0x00002b1ab32bd7f8 in Y2PluginComponent::evaluate ()
from /usr/lib64/liby2.so.2
#12 0x00002b1ab286c919 in ScriptingAgent::executeSubagentCommand ()
from /usr/lib64/YaST2/plugin/libpy2scr.so.2
#13 0x00002b1ab286eb34 in ScriptingAgent::Read ()
from /usr/lib64/YaST2/plugin/libpy2scr.so.2
#14 0x00002b1ab2d678fd in ?? () from /usr/lib64/libscr.so.2
#15 0x00002b1ab2d67b5e in ?? () from /usr/lib64/libscr.so.2
#16 0x00002b1ab2fdfc93 in YEBuiltin::evaluate ()
from /usr/lib64/libycp.so.3
#17 0x00002b1ab2fe464e in YEPropagate::evaluate ()
from /usr/lib64/libycp.so.3
#18 0x00002b1ab2fef397 in YSAssign::evaluate ()
from /usr/lib64/libycp.so.3
#19 0x00002b1ab300928a in YBlock::evaluate ()
from /usr/lib64/libycp.so.3
#20 0x00002b1ab2feefa1 in YSBlock::evaluate ()
from /usr/lib64/libycp.so.3
#21 0x00002b1ab2fefc6e in YSIf::evaluate () from /usr/lib64/libycp.so.3
#22 0x00002b1ab300928a in YBlock::evaluate ()
from /usr/lib64/libycp.so.3
#23 0x00002b1ab2fe5f42 in Y2YCPFunction::evaluateCall ()
from /usr/lib64/libycp.so.3
#24 0x00002b1ab2fdec1b in YEFunction::evaluate ()
from /usr/lib64/libycp.so.3
#25 0x00002b1ab2fef4c4 in YSReturn::evaluate ()
from /usr/lib64/libycp.so.3
#26 0x00002b1ab300928a in YBlock::evaluate ()
from /usr/lib64/libycp.so.3
#27 0x00002b1ab2feefa1 in YSBlock::evaluate ()
from /usr/lib64/libycp.so.3
#28 0x00002b1ab2fefc6e in YSIf::evaluate () from /usr/lib64/libycp.so.3
#29 0x00002b1ab300928a in YBlock::evaluate ()
from /usr/lib64/libycp.so.3
#30 0x00002b1ab2fe5f42 in Y2YCPFunction::evaluateCall ()
from /usr/lib64/libycp.so.3
#31 0x00002b1ab2fdec1b in YEFunction::evaluate ()
from /usr/lib64/libycp.so.3
#32 0x00002b1ab2fef397 in YSAssign::evaluate ()
from /usr/lib64/libycp.so.3
#33 0x00002b1ab300928a in YBlock::evaluate ()
from /usr/lib64/libycp.so.3
#34 0x00002b1ab2fe5f42 in Y2YCPFunction::evaluateCall ()
from /usr/lib64/libycp.so.3
#35 0x00002b1ab2fdec1b in YEFunction::evaluate ()
from /usr/lib64/libycp.so.3
#36 0x00002b1ab2fd05ff in YEUnary::evaluate ()
from /usr/lib64/libycp.so.3
#37 0x00002b1ab2fefac7 in YSIf::evaluate () from /usr/lib64/libycp.so.3
#38 0x00002b1ab300928a in YBlock::evaluate ()
from /usr/lib64/libycp.so.3
#39 0x00002b1ab2feefa1 in YSBlock::evaluate ()
from /usr/lib64/libycp.so.3
#40 0x00002b1ab2fefc93 in YSIf::evaluate () from /usr/lib64/libycp.so.3
#41 0x00002b1ab300928a in YBlock::evaluate ()
from /usr/lib64/libycp.so.3
#42 0x00002b1ab2fe5f42 in Y2YCPFunction::evaluateCall ()
from /usr/lib64/libycp.so.3
#43 0x00002b1ab2fdec1b in YEFunction::evaluate ()
from /usr/lib64/libycp.so.3
#44 0x00002b1ab2fef397 in YSAssign::evaluate ()
from /usr/lib64/libycp.so.3
#45 0x00002b1ab300928a in YBlock::evaluate ()
from /usr/lib64/libycp.so.3
#46 0x00002b1ab2fe5f42 in Y2YCPFunction::evaluateCall () from /usr/lib64/libycp.so.3
#47 0x00002b1ab2fdec1b in YEFunction::evaluate () from /usr/lib64/libycp.so.3
#48 0x00002b1ab2fce799 in YCPCodeRep::evaluate ()
from /usr/lib64/libycp.so.3
#49 0x00002b1ab3053887 in ?? () from /usr/lib64/libycp.so.3
---Type <return> to continue, or q <return> to quit--- 
#50 0x00002b1ab2fdfc93 in YEBuiltin::evaluate ()
from /usr/lib64/libycp.so.3
#51 0x00002b1ab2fef397 in YSAssign::evaluate ()
from /usr/lib64/libycp.so.3
#52 0x00002b1ab300928a in YBlock::evaluate ()
from /usr/lib64/libycp.so.3
#53 0x00002b1ab2fe5f42 in Y2YCPFunction::evaluateCall ()
from /usr/lib64/libycp.so.3
#54 0x00002b1ab2fdec1b in YEFunction::evaluate ()
from /usr/lib64/libycp.so.3
#55 0x00002b1ab2fef397 in YSAssign::evaluate ()
from /usr/lib64/libycp.so.3
#56 0x00002b1ab300928a in YBlock::evaluate ()
from /usr/lib64/libycp.so.3
#57 0x00002b1ab2feefa1 in YSBlock::evaluate ()
from /usr/lib64/libycp.so.3
#58 0x00002b1ab2ff3306 in YSWhile::evaluate ()
from /usr/lib64/libycp.so.3
#59 0x00002b1ab300928a in YBlock::evaluate ()
from /usr/lib64/libycp.so.3
#60 0x00002b1ab2fe5f42 in Y2YCPFunction::evaluateCall ()
from /usr/lib64/libycp.so.3
#61 0x00002b1ab2fdec1b in YEFunction::evaluate ()
from /usr/lib64/libycp.so.3
#62 0x00002b1ab2fef397 in YSAssign::evaluate ()
from /usr/lib64/libycp.so.3
#63 0x00002b1ab300928a in YBlock::evaluate ()
from /usr/lib64/libycp.so.3
#64 0x00002b1ab2fe5f42 in Y2YCPFunction::evaluateCall ()
from /usr/lib64/libycp.so.3
#65 0x00002b1ab2fdec1b in YEFunction::evaluate ()
from /usr/lib64/libycp.so.3
#66 0x00002b1ab2fef397 in YSAssign::evaluate ()
from /usr/lib64/libycp.so.3
#67 0x00002b1ab2fefc93 in YSIf::evaluate () from /usr/lib64/libycp.so.3
#68 0x00002b1ab300928a in YBlock::evaluate ()
from /usr/lib64/libycp.so.3
#69 0x00002b1ab2fe5f42 in Y2YCPFunction::evaluateCall ()
from /usr/lib64/libycp.so.3
#70 0x00002b1ab2fe6b0f in YEFunctionPointer::evaluate ()
from /usr/lib64/libycp.so.3
#71 0x00002b1ab2fef397 in YSAssign::evaluate ()
from /usr/lib64/libycp.so.3
#72 0x00002b1ab300928a in YBlock::evaluate ()
from /usr/lib64/libycp.so.3
#73 0x00002b1ab2feefa1 in YSBlock::evaluate ()
from /usr/lib64/libycp.so.3
#74 0x00002b1ab2fefc93 in YSIf::evaluate () from /usr/lib64/libycp.so.3
#75 0x00002b1ab300928a in YBlock::evaluate ()
from /usr/lib64/libycp.so.3
#76 0x00002b1ab2feefa1 in YSBlock::evaluate ()
from /usr/lib64/libycp.so.3
#77 0x00002b1ab2fefc6e in YSIf::evaluate () from /usr/lib64/libycp.so.3
#78 0x00002b1ab300928a in YBlock::evaluate ()
from /usr/lib64/libycp.so.3
#79 0x00002b1ab2fe5f42 in Y2YCPFunction::evaluateCall ()
from /usr/lib64/libycp.so.3
#80 0x00002b1ab2fdec1b in YEFunction::evaluate ()
from /usr/lib64/libycp.so.3
#81 0x00002b1ab2fe464e in YEPropagate::evaluate ()
from /usr/lib64/libycp.so.3
#82 0x00002b1ab2fef397 in YSAssign::evaluate ()
from /usr/lib64/libycp.so.3
#83 0x00002b1ab300928a in YBlock::evaluate ()
from /usr/lib64/libycp.so.3
#84 0x00002b1ab2fce799 in YCPCodeRep::evaluate ()
from /usr/lib64/libycp.so.3
#85 0x00002b1ab2653ed7 in Y2WFMComponent::doActualWork ()
from /usr/lib64/YaST2/plugin/libpy2wfm.so.2
#86 0x00002b1ab32b242d in main () from /usr/lib64/liby2.so.2
#87 0x00002b1ab59c5b54 in __libc_start_main () from /lib64/libc.so.6
#88 0x00000000004006d9 in main ()
Comment 1 Johannes Meixner 2008-01-18 06:16:13 UTC
It is no blocker bug because there are several other printer
setup tools available (i.e. a workaround exists).

Michal,
I don't know if the reason is in yast2-printer, in YaST
or somewhere in the underlying base system.

Comment 2 Michal Zugec 2008-01-18 09:58:41 UTC
please attach also YaST log
Comment 3 Petr Danecek 2008-01-18 14:17:58 UTC
Created attachment 191000 [details]
/var/log/YaST2/y2log
Comment 4 Michal Zugec 2008-01-18 14:50:07 UTC
Last 3 lines are:
2008-01-18 08:16:26 <0> mylap(6968) [agent-cups] scr/Y2AgentComponent.h(evaluate):99 Going to evaluate `Read (.printers)
2008-01-18 08:16:26 <0> mylap(6968) [agent-cups] scr/Y2AgentComponent.h(evaluate):120 After code evaluation: `Read (.printers)
2008-01-18 08:16:33 <3> mylap(6968) [liby2] genericfrontend.cc(signal_handler):59 got signal 2 at YCP file Printer.ycp:3

that means:
1 - try "hwinfo --printer"
2 - echo '`Read(.probe.printer)' | /usr/lib/YaST2/bin/y2base stdio scr
3 - it's SIGINT, not SIGPIPE (is log file really corresponding to backtrace?)
Comment 5 Petr Danecek 2008-01-18 15:05:58 UTC
Sorry for not giving an information detailed enough: There is not printer connected directly to my computer, I want to use a network printer.

The hwinfo gives no output and so does not the command 2. The program 
"y2base printer qt" does not crash, it comes to "Load current settings" and never ends. I have to CTRL+c it. However, when it is run in gdb, it gives the above backtrace. I was told that the problem is probably in the cups library..?
Comment 6 Michal Zugec 2008-01-19 12:10:41 UTC
Klaus, seems to be CUPS problem, right?
Comment 7 Klaus Singvogel 2008-01-21 09:53:43 UTC
Michal: sorry, but I'm not sure if so.
Reason is that we switched to cups-1.3.x meanwhile (remember my e-mails regarding this), and it might have happened a change in the library calls.
Please tell me, if you changed yast2 to the new library.
Comment 8 Michal Zugec 2008-01-21 11:47:43 UTC
Klaus, this bugreport is against 10.3, means related to CUPS-1.2
Comment 9 Klaus Singvogel 2008-01-21 12:13:30 UTC
Umpf. Sorry, didn't realized this (maybe a Monday morning effect? :-)

Petr Danecek:
I need more information... How long did you wait for program to terminate?

Reason: if network is not setup properly, it takes 5 minutes till the queries time out. This is not possible to change, as these values are set in the SSL/HTTP protocol and are given by some standardization organizations.

Fix for this: setup a correct network: DNS, IP adresses, etc. Disable firewalls at server and on host, which drop TCP packets.
Comment 10 Michal Zugec 2008-01-21 12:21:03 UTC
set needinfo to reporter, Peter try above, please
Comment 11 Petr Danecek 2008-01-21 15:37:59 UTC
I waited certainly for more than 5 minutes. Also, the program does not seem to just wait for a time out. It exhibits some quite activity, see the output from top:

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND                                                                                                                 
 3251 root      15   0 43520 2064 1416 S   50  0.2  11:05.02 cupsd                                                                                                                   
 4148 root      25   0  284m  49m  19m R   40  4.9   9:54.19 y2base                                                                                                                  

Also, in the backtrace above it can be seen that the program recieves SIGPIPE.
Comment 12 Klaus Singvogel 2008-01-21 18:10:29 UTC
I tried to reproduce it, but failed.
Well the chances that we find the cause of the problem are not very high, :( but I'll try my test.

The last related thing I saw in the yast logfile was:
"/usr/bin/lpstat -r 2>/dev/null"
This program terminates on my machine in <1 second. How about your machine?

So, I need this information:
- cups version. Output of: rpm -q --changelog cups | head
- cups logfiles:
  remove current ones: rm -f /var/log/cups/error_log
  start program again
  attache to this bug: /var/log/cups/error_log
- cups configuration files:
  attache to this bug /etc/cups/* (and subdirs)
  Please note that there might be confidential data stored there (passwords)
  -> make a copy and remove those data before attaching them
- I saw that you'd chosen x86_64 (e.g. AMD64) as architecture is this correct?
Comment 13 Petr Danecek 2008-01-21 18:24:46 UTC
Voila! Problem solved!! Thanks for the tip to look in /var/log/cups/error_log. It was full of messages that tcpwrappers deny access from 127.0.0.1:

 tcp_wrappers refused connection from 127.0.0.1, ip=127.0.0.1

Adding the line "cupsd: 127.0.0.1" in /etc/hosts.allow solved the problem. Too bad that the scripts gave no hint about the cause of the problem. 

Thanks very much for your help!!
Comment 14 Klaus Singvogel 2008-01-21 18:42:47 UTC
*smile* as said before: a network issue. :-)

Nevertheless, I think you should consider, if its not a good idea allow *all* services connection to localhost. Add a line "ALL: 127.0.0.1" in /etc/hosts.allow then.
Comment 15 Petr Danecek 2008-01-21 18:49:01 UTC
Well, that will be definitely the first thing which I will try before commiting any other problems to bugzilla.
:-)
Thanks again for your time & help.