bugQuilt - Bugs: bug #18810, Lockup on $PATH modification in...

 
 

bug #18810: Lockup on $PATH modification in ~/.bashrc

Submitted by:  Jan Kratochvil <lace>
Submitted on:  Tue 16 Jan 2007 11:43:22 PM UTC  
 
Category: NoneSeverity: 2 - Minor
Item Group: NoneStatus: Works For Me
Privacy: PublicAssigned to: Jean Delvare <khali>
Open/Closed: Closed

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Thu 25 Oct 2012 04:08:28 PM UTC, comment #5:

No reply for months, closing. Reopen if this is still an issue and you can explain it better.

Jean Delvare <khali>
Project AdministratorIn charge of this item.
Wed 22 Feb 2012 09:11:12 PM UTC, comment #4:

From the bash manual page:

"When an interactive shell that is not a login shell is started, bash reads and executes commands from /etc/bash.bashrc then ~/.bashrc when those files exist and are readable."

This is why I can't reproduce the bug, my ~/.bashrc is simply not read, as is expected as the shell invoked to execute the wrapper is not interactive. Can you explain how it comes that yours is?

Jean Delvare <khali>
Project AdministratorIn charge of this item.
Wed 22 Feb 2012 08:42:12 PM UTC, comment #3:

Wow, nice ~/.bashrc ;)

~/.bash_profile is only read on login shell indeed.

So your point is valid, even though I am unable to reproduce the problem for now. Are you still able to reproduce it with quilt 0.51 (or latest git)? Looking at the code I'd say it should happen, but... it doesn't for me.

Jean Delvare <khali>
Project AdministratorIn charge of this item.
Wed 22 Feb 2012 03:46:53 PM UTC, comment #2:

The duplication does not happen. .bashrc checks for duplications.
http://git.jankratochvil.net/?p=nethome.git;a=blob_plain;f=.bashrc;hb=master

~/.bash_profile is not used in various case I do not remember, therefore some settings there are insufficient.

Feel free to WONTFIX it, I have workarounded it somehow.

Jan Kratochvil <lace>
Wed 22 Feb 2012 03:41:16 PM UTC, comment #1:

Your ~/.bashrc is wrong to start with. ~/.bashrc is sourced every time a new bash process is spawned, so it must be reentrant (or idempotent if you will.) Adding a new directory in front of your $PATH in this configuration file will happen again and again for sub-shells, leading to a needlessly long $PATH (which, if not too problematic in general, is nevertheless inefficient.) Just call "bash" recursively and check $PATH at each iteration to see what I mean.

So just move your changes to $PATH from ~/.bashrc to ~/.bash_profile, and I bet your problem is solved. As a matter of fact I do add something in front of my $PATH in ~/.bash_profile, and I never experienced the problem you're reporting here.

Jean Delvare <khali>
Project AdministratorIn charge of this item.
Tue 16 Jan 2007 11:43:22 PM UTC, original submission:

My ~/.bashrc contains prepending of $PATH which is incompatible with `quilt inspect' as it will lockup.

Reproducibility
echo 'PATH="/foobar:$PATH"' >~/.bashrc
quilt setup -v gdb.spec
[lockup]

With ps(1):
14576 pts/0 S+ 0:00 \_ /bin/bash /usr/bin/quilt setup -v gdb.spec
14577 pts/0 S+ 0:00 \_ bash -c . /usr/share/quilt/setup quilt setup -v gdb.spec
14586 pts/0 S+ 0:00 \_ /bin/bash /usr/share/quilt/scripts/inspect -v gdb.spec
14934 pts/0 S+ 0:00 \_ rpmbuild --eval %define _sourcedir /home/jkratoch/redhat/rpms/gdb/devel --eval %define _s
14935 pts/0 S+ 0:00 \_ /bin/sh -e /var/tmp/rpm-tmp.48744
14938 pts/0 S+ 0:00 \_ /bin/bash /var/tmp/inspect.Q14591/bin/tar -xf -
14946 pts/0 S+ 0:00 \_ /bin/bash /var/tmp/inspect.Q14591/bin/tar -xf -
[looping]

I hope the problem is visible from the attached patch.
Any prepending to $PATH from ~/.bashrc conflicts with the assumption the first PATH element removed is the one prepended in the parent shell.

Jan Kratochvil <lace>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

Attached Files
file #11768:  quilt-inspect.patch added by lace (680B - text/x-patch)

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -unavailable- added by khali (Posted a comment)
  • -unavailable- added by lace (Submitted the item)
  •  

    Do you think this task is very important?
    If so, you can click here to add your encouragement to it.
    This task has 0 encouragements so far.

    Only logged-in users can vote.

     

    Please enter the title of George Orwell's famous dystopian book (it's a date):

     

     

    Follow 6 latest changes.

    Date Changed By Updated Field Previous Value => Replaced By
    Thu 25 Oct 2012 04:08:28 PM UTCkhaliStatusNeed Info=>Works For Me
      Open/ClosedOpen=>Closed
    Wed 22 Feb 2012 03:41:16 PM UTCkhaliSeverity3 - Normal=>2 - Minor
      StatusNone=>Need Info
      Assigned toNone=>khali
    Tue 16 Jan 2007 11:43:22 PM UTClaceAttached File-=>Added quilt-inspect.patch, #11768

    Back to the top


    Powered by Savane 3.1-cleanup1