nix-community / dconf2nix

:feet: Convert dconf files (e.g. GNOME Shell) to Nix, as expected by Home Manager [maintainer=@jtojnar]
Apache License 2.0
218 stars 6 forks source link

Special unicode character causes timeout #77

Closed tennox closed 3 months ago

tennox commented 1 year ago

Type of bug

Timeout

Version

0.0.12

Did you test against master?

Error message (if not timeout)

cat test.conf | dconf2nix --verbose
dconf: "[org/gnome/Characters]\nrecent-characters=['\10149']\n"
dconf2nix: 💥 The process timed out.

DConf input

[org/gnome/Characters]
recent-characters=['➥']

Additional context

I developed this method to identify the problematic part of the dconf output - maybe this can be helpful for troubleshooting

1. Split dconf in parts on each newline - http://stackoverflow.com/questions/33294986/ddg#33297878

dconf dump / | awk -v RS= '{print > ("dconf-" NR ".conf")}'

2. Try dconf2nix on all parts to identify & print the problematic part

for f in dconf-*.conf; do
    echo -n $f
    if dconf2nix -e < $f > /dev/null 2>&1; then
        echo " -> SUCCESS"
    else
        echo " -> ERROR:"
        cat $f
        echo #newline
    fi
done
tennox commented 1 year ago

I see you fixed a similar issue in https://github.com/gvolpe/dconf2nix/pull/68/files - but I think adding all possible characters is not viable, is there a better way? Maybe a exclude pattern instead of include?

bashfulrobot commented 1 year ago

@tennox, your process helped me solve a major freeze on my system that would drive dconf2nix to consume my entire 64 GB of ram only to die. I found my problem process almost immediately. :partying_face:

jtojnar commented 3 months ago

The timeouts were fixed by https://github.com/gvolpe/dconf2nix/pull/80.