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

QApiTrace : invalid PNM header then segmentation fault #284

Closed
hadrien-psydk opened this issue Aug 3, 2014 · 3 comments
Closed

QApiTrace : invalid PNM header then segmentation fault #284

hadrien-psydk opened this issue Aug 3, 2014 · 3 comments

Comments

@hadrien-psydk
Copy link

I have a trace, when I replay it and click on a specific line, QApiTrace crashes. Here is the callstack:
#0 ?? ApiSurface::qimageFromRawImage (image=image@entry=0x0, lowerValue=lowerValue@entry=0, upperValue=upperValue@entry=1, opaque=opaque@entry=false, alpha=alpha@entry=false) (/home/hadrien/code-tiers/apitrace/gui/apisurface.cpp:163)
#1 0x422afc ApiSurface::contentsFromBase64(this=this@entry=0x7f95a95dd5c0, base64=...) (/home/hadrien/code-tiers/apitrace/gui/apisurface.cpp:43)
#2 0x42ffdf ApiTraceState::ApiTraceState(this=0x7f9594012b80, parsedJson=...) (/home/hadrien/code-tiers/apitrace/gui/apitracecall.cpp:533)
#3 0x46dbd4 Retracer::run(this=0x2606d20) (/home/hadrien/code-tiers/apitrace/gui/retracer.cpp:527)
#4 0x7f95c359e32f ??() (/usr/lib/x86_64-linux-gnu/libQtCore.so.4:??)
#5 0x7f95c330d182 start_thread(arg=0x7f95a95de700) (pthread_create.c:312)
#6 0x7f95c261630d clone() (../sysdeps/unix/sysv/linux/x86_64/clone.S:111)

The "image" argument is null so when the function leads to a crash on line 162 of apisurface.cpp :
int width = image->width;

In the error log, I have this line:
32599 - Message - api issue 1: FBO incomplete: driver marked FBO as incomplete [-1]

Which is probably the source of the crash.

@hadrien-psydk
Copy link
Author

Here is a patch that avoids the crash and uses a replacement default image instead (a black square with the word "NULL" in the middle).

I did not find how to attach a file to a github ticket so here is an external link: http://mess.psydk.org/apitrace/avoid-crash-if-null-image.diff

Here is an illustration of the result:
apitrace-with-null-image

@jrfonseca
Copy link
Member

You patch is interesting (the NULL images actually don't look too bad) but I'd like to understand and fix glretrace not to dump these half-baked images.

Do you still have a trace that enables to repro this?

@jrfonseca
Copy link
Member

I think the above round of commits glretrace should no longer dump these half-baked images.

Thanks for looking into 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

2 participants