v1cont / yad

Yet Another Dialog
GNU General Public License v3.0
654 stars 58 forks source link

fix null pointer to form button command output #217

Closed step- closed 1 year ago

step- commented 1 year ago

related to #214

step- commented 1 year ago

Script to demonstrate SIGSEGV exception. Click button 1 then immediately after click button 2. Wait for sleep to complete and....

(yad:8940): GLib-CRITICAL **: 11:15:21.238: g_strsplit: assertion 'string != NULL' failed
./test.sh: line 27:  8940 Segmentation fault      yad --center --use-interp='bash -xc "%s"' --form --field="[1] can disable #1:fbtn" "@candisable" --field="[2] can enable  #1:fbtn" "@canenable " --button=quit:0 --buttons-layout=center

test.sh

#!/bin/bash -a

# disable #1 and stay disabled
candisable () {
: "1>"
    echo "1:@disabled@"
    sleep 2 # SIGSEGV w/o PR #217
: "<1"
}

# enable #1
canenable  () {
: "2>"
    echo "1:@candisable"
    sleep 5 # SIGSEGV w/o PR #217
: "<2"
}

yad \
    --center --use-interp='bash -xc "%s"' --form \
    --field="[1] can disable #1:fbtn" "@candisable" \
    --field="[2] can enable  #1:fbtn" "@canenable " \
    --button=quit:0 --buttons-layout=center
v1cont commented 1 year ago

cannot reproduce SIGSEGV. what version of glib you are using?

step- commented 1 year ago

2.58.1

v1cont commented 1 year ago

made it some other way, please check latest git

step- commented 1 year ago

OK, can't reproduce anymore.