Closed javier-lopez closed 9 years ago
Thanks for the report.
It should work with json-c 0.11 thus there is no problem of version with json-c. What version of connman are you using?
We should check but it can take time.
Is there a work around?
I was able to reproduce this with the latest connman git version and connman 1.27, haven't tried with lower versions. I've not found any workaround but will keep poking it.
Hi,
I was able to reproduce the bug on debian with the connmand packaged and the latest git version. connman_ncurses don't crash every time, often it just keep hanging on "Toggling OfflineMode..." after at least 3 offline/online toggling.
@chilicuil when it crashes do you see "junk" string for State and OfflineMode in the header ? By junk string I mean some random JSON string that shouldn't be there, for example I have State: wifi
and OfflineMode: [ "Pow...
.
This far I found that the jobj
argument for __renderers_state()
causes a segfault when I try to print it (as well as state
and offline_mode
variables). I was able to trace back the faulty object back to state
in engine.c. I can't investigate more right away but I will do as soon as possible (e.g. one weekend).
Hello Alan,
Yes, I also see garbage strings in the headers, exactly the same text, State: wifi OfflineMode: [ "Pow
So I solved this:
In engine.c react_to_sig_manager()
(line 865), the state is updated with a pointer to the data to print but I forgot to increment the refcount of the aforementioned data.
@jobol Do you prefer a pull request or a commit to fix this ?
I'm sorry I missed it.
@alan-mushi to be honest, I prefer a pull request linked to that issue (#2) but the operation is really painful to do. That script is doing that:
#!/bin/bash
usage() {
echo "usage: $(basename $0) nick repo issue [brsrc [brtgt]]"
}
case $# in
3) nick=$1; repo=$2; issue=$3; brsrc=issue$3; brtgt=master;;
4) nick=$1; repo=$2; issue=$3; brsrc=$4; brtgt=master;;
5) nick=$1; repo=$2; issue=$3; brsrc=$4; brtgt=$5;;
*) usage >&2; exit 1;;
esac
cat << EOC
curl \
--user $nick \
--request POST \
--data '{"issue": "$issue", "head": "$nick:$brsrc", "base": "$brtgt"}' \
https://api.github.com/repos/$repo/pulls
EOC
By typing
script alan-mushi connman-json-client 2
You will get the REST API pull request for attaching the commit to the issue
PS: there might be a better solution than the script : https://github.com/blog/1506-closing-issues-via-pull-requests
When I tried what you suggest, it failed. So do it as you want. Let's try...
I got an issue (404 HTTP code) with your script for the api url see https://developer.github.com/v3/pulls/#create-a-pull-request for the new url format.
I'll update my script, thanks
Testcase:
libjson-c2 version 0.11-3. I don't know enough C, but anyway went on and tried to debug by myself without success =)