Re: Another issue on OpenBSD

2017-04-28 Thread fff iii
Sorry, I needed more coffee before I asked this. Newbie. Please ignore.


Re: Another issue on OpenBSD

2017-04-28 Thread fff iii
I am also wondering if it would be possible to set signal traps for
the script itself calling the trap program, rather than for a program
following the trap block (like in the regular shells)?

Thanks again.


Re: Another issue on OpenBSD

2017-04-28 Thread fff iii
Works! Thanks!


Re: Another issue on OpenBSD

2017-04-27 Thread fff iii
Now getting trap: fatal: unable to auto-trap signal 32: Invalid argument

Thank you.


Another issue on OpenBSD

2017-04-27 Thread fff iii
Hello, I am getting the following error when trying to use trap with -x:

#!/usr/local/bin/execlineb -W

define VAR THISISAVAR

trap -x {
 SIGQUIT { importas VAR VAR foreground { echo $VAR } }
 SIGTERM { importas VAR VAR foreground { echo $VAR } }
 SIGINT{ importas VAR VAR foreground { echo $VAR } }
} sleep 100

trap: fatal: unable to auto-trap signal 9: Invalid argument

on OpenBSD.

Thanks!


Re: multidefine segfault

2017-04-11 Thread fff iii
>  You only need one invocation.
>
> pipeline { echo one two three }
> withstdinas -n line
> importas -u line line
> multidefine $line { cmd key val }
> echo $key $val
>
>  will print "two three".

Thanks.

Is it possible to use one multidefine on a $line that gets an unknown
number of words from stdin, then split it by one type of delimiter
with the -r option (not knowing how many words it would get into
$val). For instance, val might contain an unknown number of words.

Then, I'd like to use a second multidefine or something like it to
extract those words out of $val into separate variables. Is this
possible?

Thank you.


Re: multidefine segfault

2017-04-11 Thread fff iii
Thanks Laurent!

Out of curiousity, what kind of bug was it in terms of what was
happening to the memory?

Also, in the above example, I would like to feed a three word input
(string or line in regular terminology?) to the first multidefine, and
extract the two of the words out of $msg with the second multidefine,
but it gives me an unquoted argument error. What am I doing wrong, or
what's the correct way to do this? I am stuck...

I don't care to be credited for bug reports, but thank you.

Thank you for the execline, it's really great!


Re: multidefine segfault

2017-04-10 Thread fff iii
'multidefine' segfaults on a recent OpenBSD snapshot:

The execline script like :

#!/usr/local/bin/execlineb -W

withstdinas line
importas -u line line
multidefine -r  $line  { cmd msg }
multidefine -r $msg { key val }

$ echo ' test ' | ./testmult
Segmentation fault (core dumped)

It's the second multidefine segfaulting. It does not seem to happen
without '-r'.


Thank you.


Re: multidefine failing for some reason

2017-04-10 Thread fff iii
I am not sure if I am doing anything wrong in the above execlineb
syntax-wise, or there's a bug. At some point multidefine segfaulted (I
think I fed the execline script a single newline from stdin or
something similar), but I forget now exactly what I did to make it
segfault. Will try again, and if it does it again. will let you know.

Thank you.


multidefine failing for some reason

2017-04-09 Thread fff iii
Greetings,

I am trying to run the following script:

#!/usr/local/bin/execlineb -W

withstdinas line

importas -u line line

multidefine -r $line { cmd msg }

multidefine -d"," $msg { key val  }

and I get a fatal error, but I don't understand why:

 $ echo 'command test,test test' | ./testsmultidefine
multidefine: fatal: unquoted argument test at block 1 position 0

Thank you!


Re: execline: Segfault with the define program

2017-04-05 Thread fff iii
Works now. Good designs are often quirky. DJB-like software is often
considered quirky or even hated as well...

execline is awesome! OpenBSD is awesome!

Thank you!


Re: execline: Segfault with the define program

2017-04-05 Thread fff iii
On further examination I found this: in my log: "define: backwards memcpy"

>From reading the mailing lists on this, it looks like OpenBSD detects
overlapping memcpy regions, considers it a bug, and segfaults the
offending program to prevent unpredictable behavior.

Here's a discussion explaining the motivation behind this that I found
in the archives:

https://marc.info/?l=openbsd-misc&m=148762033002663&w=2

On Wed, Apr 5, 2017 at 11:49 AM, fff iii  wrote:
> On Wed, Apr 5, 2017 at 4:08 AM, Laurent Bercot  
> wrote:
>>> define TESTING \#testing
>>> define TESTING2 /test1/test2/test3/test4/\\${TESTING}/test6
>>
>>
>>  Works for me.
>>
>>  Please make sure you're running the latest version of execline, built
>> against the latest version of skalibs. (execline-2.3.0.0 won't work
>> with a version of skalibs older than 2.5.0.0.)
>>
>>  If it's still not working for you after rebuilding, please give your
>> machine sysdeps (/usr/lib/skalibs/sysdeps/sysdeps).
>>
>> --
>>  Laurent
>
>
> Hi Laurent,
>
>
> Note there are two '\\' before ${TESTING}
> and TESTING is defined as TESTING="#testing" would be in a regular
> shell, I had to use a backslash to escape #
>
> Hope the following helps:
>
> If I use just one backslash, it works. If I use two - segfaults. If I
> use three backslashes, it also segfaults. If I use four or five
> backslashes it works. Segfaults with six backslashes.
>
> Yes, these are the latest skalibs and execline from the git on a
> recent OpenBSD-current snapshot:
>
> Here are the sysdeps:
>
> target: amd64-unknown-openbsd6.1
> clockrt: yes
> clockmon: yes
> posixspawn: yes
> timer: no
> endianness: little
> sizeofushort: 2
> sizeofuint: 4
> sizeofulong: 8
> sizeofsize: 8
> signedsize: no
> sizeofuid: 4
> signeduid: no
> sizeofgid: 4
> signedgid: no
> sizeofpid: 4
> signedpid: yes
> sizeoftime: 8
> signedtime: yes
> sizeofdev: 4
> signeddev: yes
> sizeofino: 8
> signedino: no
> accept4: yes
> ancilautoclose: no
> cmsgcloexec: yes
> devurandom: yes
> eproto: no
> eventfd: no
> flock: yes
> getpeereid: yes
> sopeercred: no
> getpeerucred: no
> ipv6: yes
> malloc0: yes
> msgdontwait: yes
> nbwaitall: no
> openat: yes
> linkat: yes
> pipe2: yes
> ppoll: yes
> revoke: yes
> sendfile: no
> setgroups: yes
> settimeofday: yes
> signalfd: no
> splice: no
> strcasestr: yes
> strnlen: yes
> uint64t: yes
> futimens: yes
> futimes: yes
> arc4random: yes
> arc4random_addrandom: no
> getrandom: no
> itimer: yes
>
> Thank you.


Re: execline: Segfault with the define program

2017-04-05 Thread fff iii
On Wed, Apr 5, 2017 at 4:08 AM, Laurent Bercot  wrote:
>> define TESTING \#testing
>> define TESTING2 /test1/test2/test3/test4/\\${TESTING}/test6
>
>
>  Works for me.
>
>  Please make sure you're running the latest version of execline, built
> against the latest version of skalibs. (execline-2.3.0.0 won't work
> with a version of skalibs older than 2.5.0.0.)
>
>  If it's still not working for you after rebuilding, please give your
> machine sysdeps (/usr/lib/skalibs/sysdeps/sysdeps).
>
> --
>  Laurent


Hi Laurent,


Note there are two '\\' before ${TESTING}
and TESTING is defined as TESTING="#testing" would be in a regular
shell, I had to use a backslash to escape #

Hope the following helps:

If I use just one backslash, it works. If I use two - segfaults. If I
use three backslashes, it also segfaults. If I use four or five
backslashes it works. Segfaults with six backslashes.

Yes, these are the latest skalibs and execline from the git on a
recent OpenBSD-current snapshot:

Here are the sysdeps:

target: amd64-unknown-openbsd6.1
clockrt: yes
clockmon: yes
posixspawn: yes
timer: no
endianness: little
sizeofushort: 2
sizeofuint: 4
sizeofulong: 8
sizeofsize: 8
signedsize: no
sizeofuid: 4
signeduid: no
sizeofgid: 4
signedgid: no
sizeofpid: 4
signedpid: yes
sizeoftime: 8
signedtime: yes
sizeofdev: 4
signeddev: yes
sizeofino: 8
signedino: no
accept4: yes
ancilautoclose: no
cmsgcloexec: yes
devurandom: yes
eproto: no
eventfd: no
flock: yes
getpeereid: yes
sopeercred: no
getpeerucred: no
ipv6: yes
malloc0: yes
msgdontwait: yes
nbwaitall: no
openat: yes
linkat: yes
pipe2: yes
ppoll: yes
revoke: yes
sendfile: no
setgroups: yes
settimeofday: yes
signalfd: no
splice: no
strcasestr: yes
strnlen: yes
uint64t: yes
futimens: yes
futimes: yes
arc4random: yes
arc4random_addrandom: no
getrandom: no
itimer: yes

Thank you.


execline: Segfault with the define program

2017-04-04 Thread fff iii
Hello, I am sure I am doing something I am not supposed to, and
getting a segfault with the 'define' program.

How to reproduce:

define TESTING \#testing
define TESTING2 /test1/test2/test3/test4/\\${TESTING}/test6

Thanks!