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

string_replace_gpl3 is broken #3

Closed
orsonteodoro opened this issue Feb 11, 2018 · 1 comment
Closed

string_replace_gpl3 is broken #3

orsonteodoro opened this issue Feb 11, 2018 · 1 comment

Comments

@orsonteodoro
Copy link
Owner

orsonteodoro commented Feb 11, 2018

Since this is broken, the multicore version is considered broken. python's json decoder will complain about it:

2018-02-11 16:46:33,604 - INFO - Received completion request
2018-02-11 16:46:33,608 - INFO - Received extra conf ignore request
2018-02-11 16:46:34,910 - INFO - Received ready request
2018-02-11 16:46:34,926 - INFO - Received extra conf load request
2018-02-11 16:46:34,929 - INFO - Received event notification
Traceback (most recent call last):
File "/usr/lib64/python2.7/site-packages/ycmd/../bottle.py", line 862, in _handle
return route.call(**args)
File "/usr/lib64/python2.7/site-packages/ycmd/../bottle.py", line 1741, in wrapper
rv = callback(*a, **ka)
File "/usr/lib64/python2.7/site-packages/ycmd/../ycmd/watchdog_plugin.py", line 108, in wrapper
return callback( *args, **kwargs )
File "/usr/lib64/python2.7/site-packages/ycmd/../ycmd/hmac_plugin.py", line 70, in wrapper
body = callback( *args, **kwargs )
File "/usr/lib64/python2.7/site-packages/ycmd/../ycmd/handlers.py", line 59, in EventNotification
request_data = RequestWrap( request.json )
File "/usr/lib64/python2.7/site-packages/ycmd/../bottle.py", line 166, in get
if key not in storage: storage[key] = self.getter(obj)
File "/usr/lib64/python2.7/site-packages/ycmd/../bottle.py", line 1124, in json
return json_loads(b)
File "/usr/lib64/python2.7/json/init.py", line 339, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python2.7/json/decoder.py", line 364, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python2.7/json/decoder.py", line 382, in raw_decode
raise ValueError("No JSON object could be decoded")

This is the debug spew for string_replace_gpl3 function:

string_replace_gpl3 find arg: LINE_NUM
string_replace_gpl3 replace arg: 4
string_replace_gpl3 out is currently (befor):
j=0 running multicore sse2 compare threadid=0
used sse2 string_replace_gpl3 section
string_replace_gpl3 out is currently (after): { "column
string_replace_gpl3 out is currently (befor): { "column
j=0 running multicore sse2 compare threadid=0
used sse2 string_replace_gpl3 section
string_replace_gpl3 out is currently (after): { "column_num": 14,
string_replace_gpl3 out is currently (befor): { "column_num": 14,
j=0 running multicore sse2 compare threadid=0
used sse2 string_replace_gpl3 section
string_replace_gpl3 out is currently (after): { "column_num": 14, "event_name":
string_replace_gpl3 out is currently (befor): { "column_num": 14, "event_name":
j=0 running multicore sse2 compare threadid=0
used sse2 string_replace_gpl3 section
string_replace_gpl3 out is currently (after): { "column_num": 14, "event_name": "FileReadyToPars
string_replace_gpl3 out is currently (befor): { "column_num": 14, "event_name": "FileReadyToPars
j=0 running multicore sse2 compare threadid=0
used sse2 string_replace_gpl3 section
string_replace_gpl3 out is currently (after): { "column_num": 14, "event_name": "FileReadyToParse", "file
string_replace_gpl3 out is currently (befor): { "column_num": 14, "event_name": "FileReadyToParse", "file
j=0 running multicore sse2 compare threadid=0
string_replace_gpl3 out is currently (after): { "column_num": 14, "event_name": "FileReadyToParse", "file_data": { "FI
string_replace_gpl3 out is currently (befor): { "column_num": 14, "event_name": "FileReadyToParse", "file_data": { "FI
j=0 running multicore sse2 compare threadid=0
string_replace_gpl3 out is currently (after): { "column_num": 14, "event_name": "FileReadyToParse", "file_data": { "FILEPATH": { "contents": "CONTENTS", "filetypes": ["FI
string_replace_gpl3 out is currently (befor): { "column_num": 14, "event_name": "FileReadyToParse", "file_data": { "FILEPATH": { "contents": "CONTENTS", "filetypes": ["FI
j=0 running multicore sse2 compare threadid=0
string_replace_gpl3 out is currently (after): { "column_num": 14, "event_name": "FileReadyToParse", "file_data": { "FILEPATH": { "contents": "CONTENTS", "filetypes": ["FILETYPES"] } }, "filepath": "FI
string_replace_gpl3 out is currently (befor): { "column_num": 14, "event_name": "FileReadyToParse", "file_data": { "FILEPATH": { "contents": "CONTENTS", "filetypes": ["FILETYPES"] } }, "filepath": "FI
j=0 running multicore sse2 compare threadid=0
string_replace_gpl3 out is currently (after): { "column_num": 14, "event_name": "FileReadyToParse", "file_data": { "FILEPATH": { "contents": "CONTENTS", "filetypes": ["FILETYPES"] } }, "filepath": "FILEPATH", "line_num":
string_replace_gpl3 out is currently (befor): { "column_num": 14, "event_name": "FileReadyToParse", "file_data": { "FILEPATH": { "contents": "CONTENTS", "filetypes": ["FILETYPES"] } }, "filepath": "FILEPATH", "line_num":
j=0 running multicore sse2 compare threadid=0
string_replace_gpl3 out is currently (after): { "column_num": 14, "event_name": "FileReadyToParse", "file_data": { "FILEPATH": { "contents": "CONTENTS", "filetypes": ["FILETYPES"] } }, "filepath": "FILEPATH", "line_num": LINE_NUM}
string_replace_gpl3 final: { "column_num": 14, "event_name": "FileReadyToParse", "file_data": { "FILEPATH": { "contents": "CONTENTS", "filetypes": ["FILETYPES"] } }, "filepath": "FILEPATH", "line_num": LINE_NUM}

The string_replace_gpl3 final LINE_NUM should be 4.

The cause of the bug is that it is not doing single byte check after scanning ncores * register_width.

@orsonteodoro
Copy link
Owner Author

fixed: 61b82be

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant