Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Data from hook_process is corrupted after repeated usage in (relatively) long time #442

tomoe-mami opened this Issue Jun 13, 2015 · 2 comments


None yet
3 participants
Copy link

commented Jun 13, 2015

When using hook_process/hook_process_hashtable to fetch content of URL, the returned data is prepended with one or more \x07 character after about 1 to 2 days of repeated usage.

I have put demo triggers for testing this in gist. The trigger will check this other gist (contains only AAAAAAAAAA so it's easier for checking) every 5 minutes. If it detect corruption it will print an error message in core buffer and run xxd to dump the hex output. When you're testing the trigger, do not upgrade/quit weechat. It looks like doing that reset the state/curl/whatever it is handling hook_process/etc and you'll have to wait another 1-2 days to get the corrupted data.

I'm using WeeChat 1.3-dev (git: v1.2-24-g799b0ca) [compiled on Jun 9 2015 09:22:20] but this issue has existed at least since v0.4.4-dev/v1.0 so I doubt the version matters.

@flashcode flashcode added the bug label Jun 13, 2015


This comment has been minimized.

Copy link

commented Jul 13, 2015

I have seen similar things using matrix.lua script. My script error reporting says the following:

Expected value but found invalid token at character 1 during json load: ^G^G{"chunk":[{"content":{"avatar_url":"mxc://","displayname":"Mike","last_active_ago":358952,"presence":"unavailable","user_id":""},"type":"m.presence"}],"end":"s220152_12024_4561","start":"s220152_12021_4561"}

This comment has been minimized.

Copy link

commented Jul 25, 2015

So the problem was caused by some printf on stdout or stderr without a flush after, like the "\a" sent when you search text in buffer (ctrl-R) and that this text is not found (by the way the alert sent in this case was not working properly: all the alerts were sent only on flush of stdout, so most of times on /quit only).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.