<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugzilla.yoctoproject.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugzilla.yoctoproject.org/"
          
          maintainer="it-coreprojects-helpdesk@linuxfoundation.org"
>

    <bug>
          <bug_id>2382</bug_id>
          
          <creation_ts>2012-05-01 18:41:34 +0000</creation_ts>
          <short_desc>dropbear does not work with poky-tiny</short_desc>
          <delta_ts>2012-11-01 13:28:41 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>7</classification_id>
          <classification>Build System, Metadata &amp; Runtime</classification>
          <product>OE-Core</product>
          <component>core</component>
          <version>1.2</version>
          <rep_platform>x86</rep_platform>
          <op_sys>Multiple</op_sys>
          <bug_status>VERIFIED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard>(P2)(done)</status_whiteboard>
          <keywords></keywords>
          <priority>Medium</priority>
          <bug_severity>critical</bug_severity>
          <target_milestone>1.3 M3</target_milestone>
          <dependson>2443</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Reinette Chatre">reinette.chatre</reporter>
          <assigned_to name="Darren Hart">dvhart</assigned_to>
          <cc>corneliux.stoicescu</cc>
    
    <cc>dvhart</cc>
    
    <cc>jessica.zhang</cc>
    
    <cc>meta.mr.watcher</cc>
    
    <cc>meta.watcher</cc>
    
    <cc>nitin.a.kamble</cc>
    
    <cc>shane.wang</cc>
    
    <cc>song.liu</cc>
          
          
          <cf_os>---</cf_os>
          <cf_regression_type>---</cf_regression_type>
          
          <cf_docchange>---</cf_docchange>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>20964</commentid>
    <comment_count>0</comment_count>
    <who name="Reinette Chatre">reinette.chatre</who>
    <bug_when>2012-05-01 18:41:34 +0000</bug_when>
    <thetext>I am running poky.git from denzil branch with HEAD d20a24310eb43fed9a3f3e75752c9ad45a18cbe4

When I build a poky-tiny image that includes dropbear (ssh) and run the dropbear server from the image on a host then the server segfaults when a client attempts to connect. There is no trace printed, only &quot;Aiee, segfault! You should probably report this as a bug to the developer&quot; is printed on the server console.

dropbear works as expected with successful login when it is built with a full libc like:
DISTRO_FEATURES_LIBC = &quot;${DISTRO_FEATURES_LIBC_DEFAULT}&quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>20965</commentid>
    <comment_count>1</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2012-05-01 18:49:37 +0000</bug_when>
    <thetext>Adding Shane as he is listed as the maintainer of dropbear in distro_tracking_fields.

Adding Nitin to assist with libc features.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21235</commentid>
    <comment_count>2</comment_count>
    <who name="Shane Wang">shane.wang</who>
    <bug_when>2012-05-09 05:11:45 +0000</bug_when>
    <thetext>Lianhao is kindly helping to investigate the segmentation fault.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21273</commentid>
    <comment_count>3</comment_count>
    <who name="Lianhao Lu">lianhao.lu</who>
    <bug_when>2012-05-10 10:42:32 +0000</bug_when>
    <thetext>Can not reproduce this bug with eglibc-2.15.

Using the latest poky master (commit 6841abd) with Nitin&apos;s patch to fix bug #2443, 
I can&apos;t reproduce this bug.

try the followings commands in the target using the core-image-minimal including the dropbear:

#dropbearkey -t rsa -f ./rsa
#dropbear -r ./rsa
#ssh root@127.0.0.1 touch /abc
#ls /abc

All commands succeed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21277</commentid>
    <comment_count>4</comment_count>
    <who name="Lianhao Lu">lianhao.lu</who>
    <bug_when>2012-05-10 11:04:48 +0000</bug_when>
    <thetext>Cannot reproduce this on denzil branch either(eglibc 2.13).

Reinette, 

Could you please give me some information of how to reproduce the segfault?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21279</commentid>
    <comment_count>5</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2012-05-10 14:04:11 +0000</bug_when>
    <thetext>Lianhao, are you building with DISTRO=&quot;poky-tiny&quot; and building from a clean build directory (or at least one that has only been used to build &quot;tiny&quot;?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21283</commentid>
    <comment_count>6</comment_count>
    <who name="Reinette Chatre">reinette.chatre</who>
    <bug_when>2012-05-10 16:11:39 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; Can not reproduce this bug with eglibc-2.15.
&gt; 
&gt; Using the latest poky master (commit 6841abd) with Nitin&apos;s patch to fix bug
&gt; #2443, 
&gt; I can&apos;t reproduce this bug.
&gt; 
&gt; try the followings commands in the target using the core-image-minimal
&gt; including the dropbear:
&gt; 
&gt; #dropbearkey -t rsa -f ./rsa
&gt; #dropbear -r ./rsa
&gt; #ssh root@127.0.0.1 touch /abc
&gt; #ls /abc
&gt; 
&gt; All commands succeed.

I have not tried the steps above. I see the segfault when I try to connect via ssh from a different host to the host running this poky-tiny image.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21284</commentid>
    <comment_count>7</comment_count>
    <who name="Lianhao Lu">lianhao.lu</who>
    <bug_when>2012-05-10 16:27:18 +0000</bug_when>
    <thetext>Yes, I built core-image-minimal with DISTRO=&quot;poky-tiny&quot; from a clean build directory, with IMAGE_INSTALL_append=&quot;dropbear&quot;

(In reply to comment #5)
&gt; Lianhao, are you building with DISTRO=&quot;poky-tiny&quot; and building from a clean
&gt; build directory (or at least one that has only been used to build &quot;tiny&quot;?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21285</commentid>
    <comment_count>8</comment_count>
    <who name="Lianhao Lu">lianhao.lu</who>
    <bug_when>2012-05-10 16:36:18 +0000</bug_when>
    <thetext>(In reply to comment #6)
&gt;I have not tried the steps
&gt; above. I see the segfault when I try to connect via ssh from a different
&gt; host to the host running this poky-tiny image.

By saying poky-tiny image I assume you mean &quot;bitbake core-image-minimal&quot;, right?

If I use ssh from a different host, ssh reports something like &quot;can not open pty error&quot; and then exits. The dropbear server is still running without segfault. I think this error happens becuase the poky-tiny configuration doesn&apos;t support psuedo tty.

If I tried to use dropbear from different host:

./dbclient -T root@192.168.7.2 touch /abc

still can&apos;t reproduce the segfault.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21286</commentid>
    <comment_count>9</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2012-05-10 16:44:21 +0000</bug_when>
    <thetext>(In reply to comment #8)

&gt; By saying poky-tiny image I assume you mean &quot;bitbake core-image-minimal&quot;,
&gt; right?

Right.

&gt; If I use ssh from a different host, ssh reports something like &quot;can not open
&gt; pty error&quot; and then exits. The dropbear server is still running without
&gt; segfault. I think this error happens becuase the poky-tiny configuration
&gt; doesn&apos;t support psuedo tty.

Gah, I think you are right about this. I&apos;ll need to take a look at this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21936</commentid>
    <comment_count>10</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2012-06-08 16:15:08 +0000</bug_when>
    <thetext>The relevant bit from the log:

| make[1]: *** [miniperl] Error 1
| make[1]: Leaving directory `/srv/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-tiny/build/build/tmp/work/i586-poky-linux/perl-5.14.2-r6/perl-5.14.2&apos;
| make[1]: Entering directory `/srv/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-tiny/build/build/tmp/work/i586-poky-linux/perl-5.14.2-r6/perl-5.14.2&apos;
| /bin/ln -s perldelta.pod pod/perl5142delta.pod
| ./miniperl -Ilib autodoc.pl
| make[1]: ./miniperl: Command not found
| make[1]: *** [pod/perlintern.pod] Error 127
| make[1]: Leaving directory `/srv/home/pokybuild/yocto-autobuilder/yocto-slave/nightly-tiny/build/build/tmp/work/i586-poky-linux/perl-5.14.2-r6/perl-5.14.2&apos;
| make: *** [perl] Error 2
| ERRO
NOTE: package perl-5.14.2-r6: task do_compile: Failed

What is miniperl?

Can someone with more experience with the perl recipes have a look at this? Nitin?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21937</commentid>
    <comment_count>11</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2012-06-08 16:15:51 +0000</bug_when>
    <thetext>Sorry, Comment 10 was for a different bug.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>21961</commentid>
    <comment_count>12</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2012-06-09 00:18:55 +0000</bug_when>
    <thetext>Reinette, does your kernel config include CONFIG_UNIX98_PTYS=y ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22002</commentid>
    <comment_count>13</comment_count>
    <who name="Reinette Chatre">reinette.chatre</who>
    <bug_when>2012-06-11 17:37:35 +0000</bug_when>
    <thetext>(In reply to comment #12)
&gt; Reinette, does your kernel config include CONFIG_UNIX98_PTYS=y ?

It does.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22003</commentid>
    <comment_count>14</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2012-06-11 17:57:59 +0000</bug_when>
    <thetext>(In reply to comment #13)
&gt; (In reply to comment #12)
&gt; &gt; Reinette, does your kernel config include CONFIG_UNIX98_PTYS=y ?
&gt; 
&gt; It does.

And do you have devpts mounted?

If not, be sure to add the following to your init script (I don&apos;t know what you are using for init currently):

  mkdir /dev/pts
  mount none -t devpts /dev/pts</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22008</commentid>
    <comment_count>15</comment_count>
    <who name="Reinette Chatre">reinette.chatre</who>
    <bug_when>2012-06-11 19:51:01 +0000</bug_when>
    <thetext>(In reply to comment #14)
&gt; (In reply to comment #13)
&gt; &gt; (In reply to comment #12)
&gt; &gt; &gt; Reinette, does your kernel config include CONFIG_UNIX98_PTYS=y ?
&gt; &gt; 
&gt; &gt; It does.
&gt; 
&gt; And do you have devpts mounted?
&gt; 
&gt; If not, be sure to add the following to your init script (I don&apos;t know what
&gt; you are using for init currently):
&gt; 
&gt;   mkdir /dev/pts
&gt;   mount none -t devpts /dev/pts

We are doing most startup from inittab. In there we do the following that seems to work ok:
b000::bootwait:/bin/mkdir -p /dev/pts
b001::bootwait:/bin/mount -t devpts devpts /dev/pts -o gid=5,mode=620</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22009</commentid>
    <comment_count>16</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2012-06-11 21:29:08 +0000</bug_when>
    <thetext>(In reply to comment #15)
&gt; We are doing most startup from inittab. In there we do the following that
&gt; seems to work ok:
&gt; b000::bootwait:/bin/mkdir -p /dev/pts
&gt; b001::bootwait:/bin/mount -t devpts devpts /dev/pts -o gid=5,mode=620

OK, good. The segfault occurs with this configuration correct?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22010</commentid>
    <comment_count>17</comment_count>
    <who name="Reinette Chatre">reinette.chatre</who>
    <bug_when>2012-06-11 21:59:39 +0000</bug_when>
    <thetext>(In reply to comment #16)
&gt; (In reply to comment #15)
&gt; &gt; We are doing most startup from inittab. In there we do the following that
&gt; &gt; seems to work ok:
&gt; &gt; b000::bootwait:/bin/mkdir -p /dev/pts
&gt; &gt; b001::bootwait:/bin/mount -t devpts devpts /dev/pts -o gid=5,mode=620
&gt; 
&gt; OK, good. The segfault occurs with this configuration correct?

Correct. We have always mounted devpts. Before we had this entry in /etc/inittab we mounted devpts using fstab which initially was obtained from the base-files recipe.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>22806</commentid>
    <comment_count>18</comment_count>
    <who name="Song Liu">song.liu</who>
    <bug_when>2012-07-04 20:17:29 +0000</bug_when>
    <thetext>Change target to M3. There is a work around according to Darren.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23718</commentid>
    <comment_count>19</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2012-08-01 19:22:12 +0000</bug_when>
    <thetext>With current master (fd6251ef548da7dbca354754cc0b666b2ccd0c45) I built a poky-tiny core-image-minimal image for qemux86 and booted it in qemu with a tun/tap network setup. Starting dropbear manually and attempting to ssh in failed with:

&quot;PTY allocation request failed on channel 0&quot;

This is the result of /dev/ptmx not existing. By creating it in init provided by tiny-init along with the code to mount /dev/pts I am now able to successfully ssh into the qemu machine from the host machine as root. This patch has been sent to the poky list for review.

This is a different set of symptoms to what Reinette reported, but with this patch in place, it &quot;works for me&quot; on the master branch. I am working with Reinette to see what more may need to be done as she reported this issue against 1.2.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23721</commentid>
    <comment_count>20</comment_count>
    <who name="Darren Hart">dvhart</who>
    <bug_when>2012-08-01 22:41:30 +0000</bug_when>
    <thetext>With the following commit,

http://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=62d42fe3cfa575chttp://git.yoctoproject.org/cgit/cgit.cgi/poky/commit/?id=62d42fe3cfa575cb97b484ccf7b2e9a25cc50770b97b484ccf7b2e9a25cc50770

This is working in master. I&apos;ve discussed with Reinette and we agreed to close this out despite the different symptoms.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>26769</commentid>
    <comment_count>21</comment_count>
    <who name="Stoicescu Cornel">corneliux.stoicescu</who>
    <bug_when>2012-10-19 15:30:00 +0000</bug_when>
    <thetext>I can not test and verify this untill 3311 is fixed.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>27150</commentid>
    <comment_count>22</comment_count>
    <who name="Stoicescu Cornel">corneliux.stoicescu</who>
    <bug_when>2012-11-01 13:28:41 +0000</bug_when>
    <thetext>Verified using testcase:

On host machine:

#sudo /home/cornel/SDD/Yocto/poky/build/tmp/sysroots/x86_64-linux/usr/bin/qemu-system-i386 -kernel tmp/deploy/images/bzImage-qemux86.bin -net nic,vlan=0 -net tap,vlan=0,ifname=tap0 -initrd tmp/deploy/images/core-image-minimal-qemux86.cpio.gz -show-cursor -vga vmware -no-reboot -m 128 --append &quot;vga=0 root=/dev/ram0 rw mem=128M ip=192.168.122.2::192.168.122.1:255.255.255.0 oprofile.timer=1 ramdisk_size=9000K &quot; -nographic

On qemu machine:

#/etc/init.d/dropbear start

On host machine: 

ssh root@192.168.122.2 touch /abc

On target machine:

#ls
abc    boot   etc    init   media  proc   sbin   tmp    var
bin    dev    home   lib    mnt    root   sys    usr

It took me a while to get the correct qemu settings correct but in this setup, ssh with dropbear from a remote machine works. 

Verified.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>