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

Assertion in Parser::parse_value() #15

Closed
chehrlic opened this issue Apr 28, 2011 · 5 comments
Closed

Assertion in Parser::parse_value() #15

chehrlic opened this issue Apr 28, 2011 · 5 comments

Comments

@chehrlic
Copy link

After reading zrushin's blog I did a short and quick test. All seemed to work fine but a replay (and qapitrace & others) are failing with an assertion in Parser::parse_value(): "error: unknown type -1".
Removing the assert and returning 0 solves the problem - the replay works fine until the end.
Here the bt:

...
42951 glPolygonMode(face = GL_FRONT, mode = GL_FILL)

Breakpoint 1, Trace::Parser::parse_value (this=0x7fffffffda80) at /home/chehrlic/tds/apitrace/trace_parser.cpp:246
246 std::cerr << "error: unknown type " << c << "\n";
(gdb) bt
#0 Trace::Parser::parse_value (this=0x7fffffffda80) at /home/chehrlic/tds/apitrace/trace_parser.cpp:246
#1 0x000000000041408a in Trace::Parser::parse_array (this=0x7fffffffda80) at /home/chehrlic/tds/apitrace/trace_parser.cpp:323
#2 0x00000000004139e6 in Trace::Parser::parse_value (this=0x7fffffffda80) at /home/chehrlic/tds/apitrace/trace_parser.cpp:238
#3 0x0000000000413866 in Trace::Parser::parse_arg (this=0x7fffffffda80, call=0x874ca0)

at /home/chehrlic/tds/apitrace/trace_parser.cpp:205

#4 0x00000000004137d2 in Trace::Parser::parse_call_details (this=0x7fffffffda80, call=0x874ca0)

at /home/chehrlic/tds/apitrace/trace_parser.cpp:187

#5 0x00000000004135fc in Trace::Parser::parse_enter (this=0x7fffffffda80) at /home/chehrlic/tds/apitrace/trace_parser.cpp:154
#6 0x00000000004133aa in Trace::Parser::parse_call (this=0x7fffffffda80) at /home/chehrlic/tds/apitrace/trace_parser.cpp:104
#7 0x000000000041035f in main (argc=2, argv=0x7fffffffdc18) at /home/chehrlic/tds/apitrace/tracedump.cpp:45

git revision e4397f1

@zackr
Copy link
Member

zackr commented Apr 29, 2011

Any chance to see the trace file? If not then if you could just post the value of call->sig->name (e.g. p call->sig->name.c_str()) in Trace::Parser::parse_call_details at trace_parser.cpp:187 then that should allow us to fix it quickly.

@chehrlic
Copy link
Author

I would rather not post the file in the bugtracker - private mail should be ok if you need it. I wrote you a message through github with my address if you need it.

#4 0x00000000004726ba in Trace::Parser::parse_call_details (this=0x7fffe41b4c80, call=0x7fffdd2cfb30)
at /home/chehrlic/tds/apitrace/trace_parser.cpp:187
187 parse_arg(call);
(gdb) p call->sig->name.c_str()
$1 = 0x7fffdd218058 "glLoadMatrixd"

And two frames below:
#1 0x0000000000472f72 in Trace::Parser::parse_array (this=0x7fffe41b4c80) at /home/chehrlic/tds/apitrace/trace_parser.cpp:323
323 array->values[i] = parse_value();
(gdb) p len
$6 = 16
(gdb) p i
$7 = 6

@chehrlic chehrlic reopened this Apr 29, 2011
@chehrlic
Copy link
Author

Pushed the wrong button :)

@chehrlic
Copy link
Author

chehrlic commented May 1, 2011

Ok, I think I've found the problem. To exit the application I simply killed it by pressing STRG+C. This leads to a corrupted gzip-file.
Imho the assert() should not be there when the file pointer is at EOF - this should fix the issue

@jrfonseca
Copy link
Member

It should be fixed now. Thanks for investigating this.

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

3 participants