maxlath / wikibase-cli

read and edit a Wikibase instance from the command line
MIT License
223 stars 24 forks source link

wb: line 14: Segmentation fault (on wd config) #92

Closed VladimirAlexiev closed 4 years ago

VladimirAlexiev commented 4 years ago

Running a couple of simple commands (wd config) returns Segmentation fault. No such problem with eg wd summary (though that runs quote slow and shows no color, I'll investigate).

I'm running Windows 10, Cygwin, npm@6.11.3.

wd config
/cygdrive/c/Users/vladimir.alexiev.000/AppData/Roaming/npm/wb: line 14:  7324 Segmentation fault      node "$basedir/node_modules/wikibase-cli/bin/wb" "$@"

  Usage: wd-config [options] <key> [value]

  get and set configuration parameters

  Options:

    -h, --help                   output usage information

wd config -h
/cygdrive/c/Users/vladimir.alexiev.000/AppData/Roaming/npm/wb: line 14: 16584 Segmentation fault      node "$basedir/node_modules/wikibase-cli/bin/wb" "$@"

  Usage: wd-config [options] <key> [value]

  get and set configuration parameters

  Options:

    -h, --help                   output usage information

(the number after line 14 is always different)

maxlath commented 4 years ago

do you get the same results running wb config? could you copy the error stack trace if any?

VladimirAlexiev commented 4 years ago

No stack trace. It's related to returning help, because eg this works fine: wd config clipboard true

VladimirAlexiev commented 4 years ago

Another example:

wd data Q1496 | jd labels.pt
/cygdrive/c/Users/vladimir.alexiev.000/AppData/Roaming/npm/wb: line 14:  2488 Segmentation fault      node "$basedir/node_modules/wikibase-cli/bin/wb" "$@"
{ language: 'pt', value: 'Fernão de Magalhães' }
VladimirAlexiev commented 4 years ago

@maxlath I don't get the segfault with wb config, only with wd config

maxlath commented 4 years ago

@VladimirAlexiev so this is very likely to be an issue with the wd bash script

maxlath commented 4 years ago

The implementation of wd is much simpler now (f575320), so I would expect this error to have disappeared. But the new implementation relies on environment variable, and I don't know how does behave on windows, please open a new issue if that's problematic