I tried to replicate your findings, but my slow embedded OpenWRT
system (with musl libc) is so fast, that your tests always produce
0 seconds execution time. You are talking about nofork and cpu affinity:
Can you repoduce your findings with booting OpenWRT on your board?
bye, Bastian
On Wed, Sep 06, 2023 at 02:38:58AM +0200, Roberto A. Foglietta wrote:
> On Mon, 4 Sept 2023 at 21:52, Roberto A. Foglietta
> wrote:
> >
> > Just few facts:
> >
> > - moving from local var=$(command) to local var; car=$(commad)
> > - avoid to use pidof and pgrep but grep over /proc
> > - source
can you please give us a hint,
what makes your system special?
maybe several 1000 processes?
can you please show, how you measure
the time differences on your 2nd problem?
thanks & bye,
Bastian Bittorf
___
busybox mailing list
busybox@busybox
On Mon, Dec 21, 2020 at 08:22:59AM +0100, Bastian Bittorf wrote:
> On Mon, Dec 21, 2020 at 05:28:36AM +, Paul Larkin wrote:
> > #!/bin/sh
> >
> > +set -e
> > . ./.config || exit 1
> > +set +e
>
> IMHO the posix way is
>
> command . ./.conf
On Mon, Dec 21, 2020 at 05:28:36AM +, Paul Larkin wrote:
> #!/bin/sh
>
> +set -e
> . ./.config || exit 1
> +set +e
IMHO the posix way is
command . ./.config || exit 1
The set -e/+e seems fragile, see:
https://www.in-ulm.de/~mascheck/various/set-e/
Paul:
Can you please check if this
On Sun, Oct 20, 2019 at 09:54:01AM +0100, Ron Yorston wrote:
> Bastian Bittorf wrote:
> >Maybe i am a "victim" of this patch:
>
> 1.30.0 has the faulty commit d1a2fa2a4 (ash: catch error in arithmetic
> expansion in PS1) but not the subsequent correction in commit
| logger -s
Also reseting the terminal with 'reset' does not help.
With older busybox-versions, e.g. v1.27.2 it runs without problems.
Sorry that i cannot help more at the moment (e.g. git bisect).
thanks for your work - bye, Bastian Bittorf
prompt.sh
Description: Bourne shell script
__
* Kang-Che Sung [26.10.2016 10:00]:
> filename="`ls *zip | head -n 1`"
> nc 10.0.0.1 12345 < "$filename"
> do_something_else < "$filename"
>
> Yeah. Just avoid the glob on the redirection and instead get the
> filename before that. Any difficulty?
better do
* Denys Vlasenko [04.07.2016 09:06]:
> cd /proc && cat cpuinfo meminfo stat interrupts diskstats slabinfo
> schedstat buddyinfo >/dev/random
>
> in practice work quite satisfactorily for adding some entropy at boot time?
> If you don't think so, can you demonstrate a
* David Henderson [18.02.2016 17:14]:
> case "$(cat /tmp/md5.txt)" in
> '123456')
> ...implement updates for this particular version...
> ;;
> '234567')
> ...implement updates for this particular version...
> ;;
> esac
this is
* Bastian Bittorf <bitt...@bluebottle.com> [12.02.2016 12:04]:
> maybe somebody with more insight of libbb/parse_config.c
> has an idea where the problem can be...
I'am so sorry:
we had a glitch in the OpenWrt-config generator
which sets the default path to the table-entries
NOT to '/
* Bernhard Reutner-Fischer [12.02.2016 10:40]:
> > echo "50 test" >/etc/iproute2/rt_tables
> > ip route show table test
> >
> > -> error
>
> what error exactly?
sorry:
root@box:~ echo "50 test" >>/etc/iproute2/rt_tables
root@box:~ ip route show table test
ip: invalid
* Bernhard Reutner-Fischer [12.02.2016 10:40]:
> Does it go away if you enable CONFIG_DEBUG_PESSIMIZE, i.e. build
> without optimizations?
i rebuild busybox with optimizations disabled and the
problem keeps. both, on MIPS/ar71xx and UML/X84_64.
so we can rule out a
* Bernhard Reutner-Fischer [12.02.2016 10:40]:
> Does it go away if you enable CONFIG_DEBUG_PESSIMIZE, i.e. build
> without optimizations?
digging further into it:
# OK:
root@UML:/ cat /etc/iproute2/rt_tables
#
# reserved values
#
128 prelocal
255 local
254
OpenWrt switched to busybox's 'iproute2' applet:
An user recognized that using spaces in
/etc/iproute2/rt_tables will not work anymore
(but used to work earlier):
echo "50 test" >/etc/iproute2/rt_tables
ip route show table test
-> error
TAB=" "
echo "51${TAB}test1" >/etc/iproute2/rt_tables
* Laurent Bercot [11.02.2016 13:27]:
> I wonder if there are better solutions.
just for completeness:
with OpenWrt there is a feature where you have a "protected" area
in RAM which is not lost during reboot and used for having a crashlog
safed over a reboot.
* Ron Yorston [15.01.2016 11:20]:
> >sorry, i happend again:
yes, it happens even with reverting 8814431aca695a43b2e164a6620ea0a3274ce678
I'am on musl. I have some ideas, but need time 8-)
bye, bastian
___
busybox mailing list
* Ron Yorston [15.01.2016 08:56]:
> Curt Brune wrote:
> >Could xll_name_to_index() be corrupting something
>
> That rings a bell. Back in October I replaced some of the code in
> xll_name_to_index with a call to if_nametoindex.
>
> Bastian, does it work if you revert commit
* Ron Yorston [15.01.2016 08:56]:
> Bastian, does it work if you revert commit 8814431?
sorry, i happend again:
root@box:~ ip neigh show dev br-mastergate
root@box:~ ip neigh show dev br-mastergate
192.168.12.104 lladdr 78:d6:f0:45:eb:55 ref 1 used 0/0/0 probes 6 DELAY
* Curt Brune [15.01.2016 08:37]:
> On my x86 system I can't reproduce this. I created a bridge called
> br-mastergate. The ip neigh show dev br-mastergate command works fine.
[...]
i will debug further this weekend, thanks for your input.
bye, bastian
git busybox-git on OpenWrt / mips we see crashes when calling
root@box:~ ip neigh show dev br-mastergate
Segmentation fault
but this works:
root@box:~ ip neigh show | grep 'br-mastergate'
192.168.100.111 dev br-mastergate lladdr e8:de:27:fb:ea:c9 used 0/0/0 probes 6
FAILED
192.168.2.104 dev
* Isaac Dunham [07.01.2016 08:57]:
> If you read the help closer, you will see that it's
> flock FD
> *OR*
> flock FILE [-c] PROG ARGS
thanks for this long explanation, i was confused
by the usage of another 'lock' implementation.
bye, bastian
I'am trying to use flock on OpenWrt with musl and
busybox-git/HEAD. What happens here is this:
root@OpenWrt:/ flock test
flock: invalid number 'test'
root@OpenWrt:/ flock /tmp
flock: invalid number '/tmp'
root@OpenWrt:/ flock /tmp/test
flock: invalid number '/tmp/test'
root@OpenWrt:/ flock -x
* A.W.C. [04.12.2015 11:05]:
> There is no way to update Busybox to latest version, I can only use existing
> version, the code is precompiled and running on embedded device.
you can static compile a busybox-tftp and upload to the device.
bye, bastian
* A.W.C. [04.12.2015 20:23]:
> Can you illustrate this in details?
make allnoconfig
make menuconfig
# select only some of your needed applets, e.g. traceroute
# select "Busybox settings" -> "build options" -> "static binary"
make
ls -l busybox*
./busybox --list
# here you
* Cathey, Jim [01.12.2015 20:13]:
> (in BB V1.19.4 tested on a MIPS), in that it is doing the
this version is nearly 4 years old. please test if
this still is the case with current git or stable.
bye, bastian
___
busybox mailing
* Anshul [01.12.2015 08:50]:
> I am trying to use busybox with linux kernel.
which version of busybox exactly?
bye, bastian
___
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
* Rafał Miłecki [29.10.2015 07:29]:
> while loop. Minimal test-case:
> while [ 1 ]; do local foo=$(date); done
> BusyBox's ash never complained but it was leaking a memory.
i did some more testing with an OpenWrt-UML:
i=0;while :; do i=$(( i + 1 )); local foo=$(:); case "$i" in
* Rafał Miłecki [29.10.2015 07:29]:
> However I guess it would be nice thing to stop memory leak, even if
> script code is incorrect. Could someone take a look at this, please?
>
> My BusyBox/ash version:
> BusyBox v1.23.2 (2015-07-12 11:22:27 CEST) built-in shell (ash)
i just
* Rafał Miłecki [29.10.2015 07:29]:
> However I guess it would be nice thing to stop memory leak, even if
> script code is incorrect. Could someone take a look at this, please?
>
> My BusyBox/ash version:
> BusyBox v1.23.2 (2015-07-12 11:22:27 CEST) built-in shell (ash)
can
* Rafał Miłecki [29.10.2015 07:29]:
> However I guess it would be nice thing to stop memory leak, even if
> script code is incorrect. Could someone take a look at this, please?
>
> My BusyBox/ash version:
> BusyBox v1.23.2 (2015-07-12 11:22:27 CEST) built-in shell (ash)
please
i have a file in french language where i
want to replace chars to HTML-entities.
it is attached and I uploaded it[1].
replace hex seems not to work, no matter
if compiling with musl or uclibc and no
matter if on arm or x86.
# see 2nd line at the end: "c3 a9")
root@box:~ hexdump -C myfile
during switch-over from 'ifconfig' to 'ip' in the
OpenWrt project, we recognized that there es an
behaviour change compared to the full 'iproute2'
when using 'ip rule show' with numbers > 256 in
/etc/iproute2/rt_tables - see https://dev.openwrt.org/ticket/20650
the problem is in
* Joshua Judson Rosen [05.10.2015 17:03]:
> as an *operand*, because the binary operator "="
> is higher precedence than the unary operators. So,
thanks for the good explanation.
bye, bastian
___
busybox mailing list
while discussing a shellsheck issue[1], i stumpled
upon an interesting behaviour which is weird and
i cannot find it to be a problem when reading POSIX[2]
here, but all tested shells (ash,dash,bash) somehow
break at this:
user@box:~ x='='
user@box:~ test -n "$x" -a 1 -eq 1
ash: 1: unknown operand
* Ron Yorston [23.09.2015 12:08]:
> >no, as I wrote 'no matter how I escape' - it does not work.
> >(busybox git HEAD)
>
> Works for me in Busybox master. The example above, with the slash
sorry, this was an error on my side - i tested 1.23.2 stable, not HEAD.
thanks for making
hi devs,
trying to replace a slash in a variable using
substitution I stumbled over this old thread:
http://lists.busybox.net/pipermail/busybox/2010-September/073290.html
so basically this does not work (no matter how I escape)
var='a/c'; echo ${varb}
(should output 'abc')
'git log' did not
* INFO @ itPenguin GmbH [01.09.2015 20:41]:
> We are sending very low traffic to the daemon, approx. 1 to 2 telegrams per
> second.
a cgi script? please post it or say more about your specific approach.
bye, bastian
___
busybox
maybe this is a race?
root@box:~ rm -fR /tmp/dbcache
rm: can't remove '/tmp/dbcache': Directory not empty
root@box:~ echo $?
1
root@box:~ rm -fR /tmp/dbcache
root@box:~ echo $?
0
so it worked on the 2nd try. ideas?
this is v1.23.2 on OpenWrt with kernel 3.18.18
bye, bastian
* Laurent Bercot ska-dietl...@skarnet.org [13.08.2015 13:56]:
Most likely a race. It's impossible to atomically remove
a directory with Unix.
(There's a way to emulate that: first rename() the directory
to something unique and unpredictable, then rm -rf that
directory. But AFAIK, no rm
root@OpenWrt:/# cat /tmp/test.sh
#!/bin/sh
/tmp/test2.sh
root@OpenWrt:/# cat /tmp/test2.sh
#!/bin/sh
echo
root@OpenWrt:/# ls -l /tmp/test.sh /tmp/test2.sh
-rw-r--r--1 root root25 Aug 9 11:55 /tmp/test.sh
-rw-r--r--1 root root16 Aug 9 11:50
* Pratik Prajapati pratik.prajapat...@gmail.com [26.06.2015 08:44]:
305: shift
306: index=0307: for arg; 308: do
309: x[$index]=$arg310: ((index++)) 311: done
but i got error: syntax error: unexpected ( (expecting })
google for 'POSIX shell array'
* Xabier Oneca -- xOneca xon...@gmail.com [25.06.2015 07:10]:
I think it is copied from Bash behavior. According to bash(1) doc:
(section ARITHMETIC EVALUATION)
A shell variable that is null or unset evaluates to 0 when referenced by
name without using the parameter expansion syntax.
we stumbled over an interesting behaviour,
which is the same like in bash, but new to us:
root@box:~ a=120; echo $(( a / 60 )); echo HERE
2
HERE
root@box:~ a=; echo $(( a / 60 )); echo HERE
0
HERE
root@box:~ a=; echo $(( $a / 60 )); echo HERE
-ash: arithmetic syntax error
root@box:~ echo $(( /
* Mike Yates x...@fonehelp.co.uk [11.05.2015 18:05]:
The command read in Busybox v1.23 functions just like in GNU bash but in the
v1.1.1 in my old NAS it keeps complaining of not enough arguments.
what is your exact commandline?
The help for sh doesn't work either, even for v1.23 and read is
* Eugene Rudoy gene.de...@gmail.com [27.04.2015 07:52]:
fixes segfault introduced in 0a0acb55db8d7c4dec445573f1b0528d126b9e1f with
functions using local -.
test-case: f() { local -; local x; }; f
Thanks for that - i did'nt know this till yet,
and cannot find anything about 'local -' in the
* Eugene Rudoy gene.de...@gmail.com [17.04.2015 08:13]:
@Bastian: see 109ee5d336, your example is however quite strange -
what's the reason for declaring the variable twice, what's the real
use-case?
in fact it's a mistake in my script - but it has totally
changed the logic of my function, so
while heavy testing of recent OpenWrt i
discovered the following problem:
x() { local x=1; echo $x; local x; echo $x; }
older busybox will output
1
1
and v1.23.2 will only output
1
this means: 'local varname' will empty the var.
is this a problem with a changed config? at least
i cannot find a
test with 1.22.1 and HEAD:
when quering 'route -n' with an empty table
(e.g. UML) it does not output 'bb_msg_read_error'
but:
root@UML:/ route -n
Kernel IP routing table
Destination Gateway Genmask Flags Metric RefUse Iface
route: fscanf
i was wondering where this
* valent.turko...@gmail.com valent.turko...@gmail.com [16.11.2014 20:13]:
I'm using few custom scripts and using logger to write messages to
OpenWrt system log.
please write to the OpenWrt-mailinglist, the project does
not use the busybox-logger infrastructure. Also write something
more about
* valent.turko...@gmail.com valent.turko...@gmail.com [17.11.2014 07:59]:
I'm sure first thing that OpenWrt developers will say to me is to
report this issue upstream ie. to this mailing list.
you are using 'logger' but not the busybox backend.
look at the tasklist, there is something like
hi devs,
we have sometimes a crashing crond and no idea whats going on.
In OpenWrt we carry some patches which shouldnot(tm) be involved:
https://dev.openwrt.org/browser/trunk/package/utils/busybox/patches
here the crash:
bastian@server1:~/openwrt$ scripts/remote-gdb
* Laurent Bercot ska-dietl...@skarnet.org [01.09.2014 12:36]:
Note the always, which is not necessary, but serves to drive the point
home.
I maintain that false is NEVER allowed to return 0, --help or not.
i agree. the discussion is a little but driving away IMHO, because:
(i wrote already)
* Harald Becker ra...@gmx.de [01.09.2014 14:38]:
This shows me, your false is not same as Busybox internal false. You
are probably using a different false executable, script or alias.
Try which false and ls -al WHAT_YOU_GET_FROM_WHICH.
seems to be this busybox one 8-):
root@luxusAsus:~
* Harald Becker ra...@gmx.de [01.09.2014 15:27]:
How can that be, if both false are Busybox?
Please try:
/bin/false --help; echo $?
Also you may have a look at your aliases?
thanks for digging into this, here it is:
root@luxusAsus:~ alias
lr='logread'
myssh='echo executing: ssh -i
* Alive4ever alive4e...@live.com [29.08.2014 14:03]:
I'm using an embedded system with busybox v1.22.1, running Openwrt Chaos
Chalmer r42321, mips24k AR9330
When I call 'busybox false --help', the return status is zero. I think it has
nothing todo with openwrt, because it's the output of
* Tito farmat...@tiscali.it [01.04.2014 10:08]:
Real swapoff does more or less the same: first /proc/swaps and then
/etc/fstab. Doing both without further error checking maybe adds a little
overhead but reduces code needed.
i'am fine with this, maybe the reason is really to not rely on /proc
* Tito farmat...@tiscali.it [31.03.2014 09:53]:
So now swapoff first cycles through /proc/swaps and then through fstab
to swapoff all devices.
Does it make sense to swapoff devices which are not known via /proc/swaps?
Or is it just if /proc is missing?
nevertheless: thanks for submission!
unsure if this is normal, but today i stumbled over this:
root@box:~ ls -lt /dev/dsp*
crw-r--r--1 root root 14, 3 Jan 30 08:44 /dev/dsp
crw-r--r--1 root root 14, 19 Jan 30 08:44 /dev/dsp1
the exspected result was to get the 'newest' link on top.
normal sorting by
* Loïc Grenié loic.gre...@gmail.com [30.01.2014 11:05]:
I think you misread the time: date is Jan 30th for both, time is 8:44
oops, sorry for the noise - you are right 8-) bye, bastian
___
busybox mailing list
busybox@busybox.net
* Denys Vlasenko vda.li...@googlemail.com [13.01.2014 16:44]:
On Sat, Dec 21, 2013 at 8:03 PM, Bastian Bittorf bitt...@bluebottle.com
wrote:
You can, say, run crond under strace -tt -s99,
save the log and check what's there when it dies.
thanks for feedback. i have a ton of coredumps from
i'am using openwrt with busybox and since a long time
we see, that on some boxes crond silently dies. what
we can also see is a heavy usage of zram-swap in this
situation, but panic_on_oom is enabled (=2).
i read the source of miscutils/crond.c, but cannot
see an obvious reason for this behavior.
* Walter Dnes waltd...@waltdnes.org [10.05.2013 19:32]:
As the old saying goes... there can only be one. This applies to
default gw. Default means what to use if no other info is given.
The way to do it is to set routes for specific ranges, with higher
priority (i.e. lower metric values).
* Matthew Stoltenberg d3m...@gmail.com [18.03.2013 11:05]:
Can we do the same for . in favor of source? You can't exactly grep
for '.'
fgrep . $file. The normal grep invokes regex, which
does grep -f not.
bye, bastian
___
busybox mailing list
* Laurent Bercot ska-dietl...@skarnet.org [25.03.2013 12:18]:
2) For situations where this it not possible (e.g. Busybox ash) I used
a simple start wrapper to unblock signals.
I'm curious: how come your process 1 ash had blocked signals ?
* Bernd Petrovitsch be...@petrovitsch.priv.at [20.03.2013 14:06]:
ACK - and for that reason, I didn't mention it. Or - to avoid the
fork()+exec() - play around with s=0; while read l; do s=$s $l; done
$file eval $s (which propably needs quoting ...) or the like
8-)
i really like the
* Joshua Judson Rosen jro...@harvestai.com [18.03.2013 09:58]:
failure to dot/source a file can still result in an error-message without
making the shell quit. In order to do that, I had to slightly adjust
somebody posted a link to the posix-standard, where explicity is
written, a shell must
* Joshua Judson Rosen jro...@harvestai.com [18.03.2013 19:32]:
[ -e $file ] . $file
not ok for you? my usecase was more a speed issue, because
The only technical reason against that is the race condition if $file is
deleted after the existence/read check.
Yes. And there's no way to get
* Joshua Judson Rosen jro...@harvestai.com [15.03.2013 22:00]:
I just noticed that trying to source a nonexistent file from a script running
(non-interactively) through ash causes the shell to exit.
i also stumpled over the same? problem.
. nonexistent_file
is not possible, the script just
there is one known issue on Unix like systems which may lead to
the
case where a file system without file entries may report no
available
space. I do not know if this is the reason for your trouble, but
it
it's better to tell about, as this is not known to all Unix users.
On Unix like
for beeing complete, this is the corresponding ticket
on openwrt-trac: https://dev.openwrt.org/ticket/11851
problem solved, it's not syslogd but
ulogd. hopefully busybox is not involved.
strange thing: the same ulogd on other boxes
with same arch and nearly same busybox makes
no problems.
we have a strange problem, which occurs regulary
on our targets: ar71xx / MIPS / bigendian - an 128mb
RAM router with an 64 megabyte tmpfs with openwrt.
(Buffalo WZR-HP-AG300H).
for beeing complete, this is the corresponding ticket
on openwrt-trac: https://dev.openwrt.org/ticket/11851
So: 500
pidof: pid:9071 no match: comm:'sh' argv0:'sh' exe:'/bin/bash'
pidof: pid:9072 no match: comm:'busybox' argv0:'./busybox'
exe:'/root/srcdevel/bbox/fix/busybox.t2/busybox'
pidof: pid:9073 no match: comm:'sh' argv0:'sh' exe:'/bin/bash'
pidof: pid:24014 no match: comm:'top' argv0:'top'
dear embedded warriors,
we use BusyBox v1.19.3 (2011-11-24 08:39:59 CET)
on ar71xx and brcm47xx (mipsel) on openWRT.
It took us some days to trac down a problem with
pidof. We have some checker scripts, which regulary
watch for tasks, if they are running or not using 'pidof'.
Sometimes we catch
74 matches
Mail list logo