Bug 1257471

Summary: completely unresponsive REPL loop
Product: [Fedora] Fedora Reporter: Przemek Klosowski <przemek>
Component: qepcad-BAssignee: Jerry James <loganjerry>
Status: CLOSED NEXTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 22CC: loganjerry
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 1.69-11.fc23 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-09-13 00:48:57 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Przemek Klosowski 2015-08-27 07:18:54 UTC
Description of problem:
completely unresponsive, fails to read input, internal infinite signal loop

Version-Release number of selected component (if applicable):
qepcad-B-1.69-8.fc22.x86_64


How reproducible:   every time

Steps to Reproduce:
1. run qepcad
2. type a single character, e.g. '[' in response to the promptb

Actual results:
prints out the initial REPL messages and prompt, waits for input, accepts single typed character, becomes unresponsive

Expected results: 
properly accepts and processes input


Additional info:
Seems to get stuck in a signal loop after echoing the input:
[pid  6600] <... read resumed> "[", 1)  = 1
[pid  6600] write(1, "[", 1[)            = 1
[pid  6600] read(0, 0x7ffeb438c227, 1)  = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
[pid  6600] --- SIGTTIN {si_signo=SIGTTIN, si_code=SI_KERNEL, si_value={int=0, ptr=0x5455203600000000}} ---
[pid  6600] rt_sigreturn({mask=[]})     = -1 EINTR (Interrupted system call)
[pid  6600] ioctl(1, TCXONC, TCOON)     = -1 ENOTTY (Inappropriate ioctl for device)
[pid  6600] ioctl(0, SNDCTL_TMR_STOP or TCSETSW, {B38400 opost isig icanon echo ...}) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
[pid  6600] --- SIGTTOU {si_signo=SIGTTOU, si_code=SI_KERNEL, si_value={int=0, ptr=0x5455203600000000}} ---
[pid  6600] rt_sigreturn({mask=[]})     = -1 EINTR (Interrupted system call)
[pid  6600] ioctl(0, SNDCTL_TMR_STOP or TCSETSW, {B38400 opost isig icanon echo ...}) = ? ERESTARTSYS (To be restarted if SA_RESTART is set)
[pid  6600] --- SIGTTOU {si_signo=SIGTTOU, si_code=SI_KERNEL, si_value={int=0, ptr=0x5455203600000000}} ---
[pid  6600] rt_sigreturn({mask=[]})     = -1 EINTR (Interrupted system call)

Comment 1 Jerry James 2015-08-28 03:06:25 UTC
Yes, I can reproduce this.  It used to work in Fedora 21, but probably by accident, because I see this in the build output:

In file included from io/CREAD.c:22:0:
./db/readlineistream.h: In constructor 'readlineIstream::readlineIstream()':
./db/readlineistream.h:29:18: warning: 'readlineIstream::buff' will be initialized after [-Wreorder]
   readlineInBuff buff;
                  ^
./db/readlineistream.h:31:51: warning:   base 'std::basic_istream<char>' [-Wreorder]
   inline readlineIstream() : buff(), istream(&buff) { }
                                                   ^
./db/readlineistream.h:31:10: warning:   when initialized here [-Wreorder]
   inline readlineIstream() : buff(), istream(&buff) { }
          ^
./db/readlineistream.h: In constructor 'readlineIstream::readlineIstream(int)':
./db/readlineistream.h:29:18: warning: 'readlineIstream::buff' will be initialized after [-Wreorder]
   readlineInBuff buff;
                  ^
./db/readlineistream.h:32:59: warning:   base 'std::basic_istream<char>' [-Wreorder]
   inline readlineIstream(int fd) : buff(fd), istream(&buff) { }
                                                           ^
./db/readlineistream.h:32:10: warning:   when initialized here [-Wreorder]
   inline readlineIstream(int fd) : buff(fd), istream(&buff) { }
          ^
In file included from io/CREAD.c:23:0:
./db/convenientstreams.h: In constructor 'slwcistream::slwcistream(std::istream&, slwcistream::option)':
./db/convenientstreams.h:47:23: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
     }while(c = in.get());
                       ^
In file included from io/CREAD.c:23:0:
./db/convenientstreams.h: In constructor 'cacIstream::cacIstream(std::istream&)':
./db/convenientstreams.h:74:13: warning: 'cacIstream::buff' will be initialized after [-Wreorder]
   cacInBuff buff;
             ^
./db/convenientstreams.h:76:54: warning:   base 'std::basic_istream<char>' [-Wreorder]
   cacIstream(istream &_in) : buff(_in), istream(&buff) { }
                                                      ^
./db/convenientstreams.h:76:3: warning:   when initialized here [-Wreorder]
   cacIstream(istream &_in) : buff(_in), istream(&buff) { }
   ^

In other words, the C++ stream objects are being initialized with uninitialized streambuf objects.  This will take a little coding work to fix.  I'll try to have a solution soon.

Comment 2 Fedora Update System 2015-09-04 03:10:39 UTC
qepcad-B-1.69-11.fc23 has been submitted as an update to Fedora 23. https://bodhi.fedoraproject.org/updates/FEDORA-2015-15046

Comment 3 Fedora Update System 2015-09-04 23:20:40 UTC
qepcad-B-1.69-11.fc22 has been pushed to the Fedora 22 testing repository. If problems still persist, please make note of it in this bug report.\nIf you want to test the update, you can install it with \n su -c 'yum --enablerepo=updates-testing update qepcad-B'. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-15045

Comment 4 Fedora Update System 2015-09-04 23:22:43 UTC
qepcad-B-1.69-11.fc23 has been pushed to the Fedora 23 testing repository. If problems still persist, please make note of it in this bug report.\nIf you want to test the update, you can install it with \n su -c 'yum --enablerepo=updates-testing update qepcad-B'. You can provide feedback for this update here: https://bodhi.fedoraproject.org/updates/FEDORA-2015-15046

Comment 5 Fedora Update System 2015-09-13 00:48:56 UTC
qepcad-B-1.69-11.fc22 has been pushed to the Fedora 22 stable repository. If problems still persist, please make note of it in this bug report.

Comment 6 Fedora Update System 2015-09-18 18:36:30 UTC
qepcad-B-1.69-11.fc23 has been pushed to the Fedora 23 stable repository. If problems still persist, please make note of it in this bug report.

Comment 7 Przemek Klosowski 2015-09-18 19:43:48 UTC
OP, confirming that the problem is fixed by the patch