Bug 105844

Summary: [EFL][WK2] MiniBrowser could not be launched on specific machine
Product: WebKit Reporter: Kangil Han <kangil.han>
Component: WebKit EFLAssignee: Ryuan Choi <ryuan.choi>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, gyuyoung.kim, lucas.de.marchi, rakuco, ryuan.choi, tmpsantos, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
suggestion none

Kangil Han
Reported 2012-12-28 19:20:52 PST
Launching MibiBrowser doesn't work on my machine because executable path of WebProcess is NULL in child process.
Attachments
suggestion (2.57 KB, patch)
2012-12-28 20:26 PST, Ryuan Choi
no flags
Ryuan Choi
Comment 1 2012-12-28 20:26:14 PST
Created attachment 180910 [details] suggestion
Kangil Han
Comment 2 2012-12-28 20:55:31 PST
FOA, MiniBrowser works with your suggestion, thanks. :) Would you please mention in ChangeLog why we should use CString instead of const char* in detail? Please name an attachment as a patch as well. :)
Gyuyoung Kim
Comment 3 2012-12-28 21:20:02 PST
Comment on attachment 180910 [details] suggestion As Kangil said, it would be good if you say why we need to use CString instead of const char*. However, I think we have to use CString inside WebKit.
WebKit Review Bot
Comment 4 2012-12-28 21:31:51 PST
Comment on attachment 180910 [details] suggestion Clearing flags on attachment: 180910 Committed r138557: <http://trac.webkit.org/changeset/138557>
WebKit Review Bot
Comment 5 2012-12-28 21:31:55 PST
All reviewed patches have been landed. Closing bug.
Thiago Marcos P. Santos
Comment 6 2012-12-30 04:46:26 PST
Comment on attachment 180910 [details] suggestion View in context: https://bugs.webkit.org/attachment.cgi?id=180910&action=review > Source/WebKit2/UIProcess/Launcher/efl/ProcessLauncherEfl.cpp:48 > - executablePath = executablePathOfWebProcess().utf8().data(); > + executablePath = executablePathOfWebProcess().utf8(); Now I see the issue here. A better fix would be make executablePathOfWebProcess() return a const reference instead of a copy, since it is getting static data.
Chris Dumez
Comment 7 2012-12-30 04:49:30 PST
Comment on attachment 180910 [details] suggestion View in context: https://bugs.webkit.org/attachment.cgi?id=180910&action=review >> Source/WebKit2/UIProcess/Launcher/efl/ProcessLauncherEfl.cpp:48 >> + executablePath = executablePathOfWebProcess().utf8(); > > Now I see the issue here. A better fix would be make executablePathOfWebProcess() return a const reference instead of a copy, since it is getting static data. Thiago, the issue is that String::utf8() returns a new temporary CString object and CString::data() returns a pointer to the internal CString data representation. Since the CString is temporary, the pointer returned by data() becomes invalid on next line.
Thiago Marcos P. Santos
Comment 8 2012-12-30 05:15:46 PST
Comment on attachment 180910 [details] suggestion View in context: https://bugs.webkit.org/attachment.cgi?id=180910&action=review >>> Source/WebKit2/UIProcess/Launcher/efl/ProcessLauncherEfl.cpp:48 >>> + executablePath = executablePathOfWebProcess().utf8(); >> >> Now I see the issue here. A better fix would be make executablePathOfWebProcess() return a const reference instead of a copy, since it is getting static data. > > Thiago, the issue is that String::utf8() returns a new temporary CString object and CString::data() returns a pointer to the internal CString data representation. Since the CString is temporary, the pointer returned by data() becomes invalid on next line. Now I see, this patch is fine. Sorry for introducing this bug and thanks guys for fixing.
Kangil Han
Comment 9 2012-12-30 17:48:12 PST
(In reply to comment #7) > Thiago, the issue is that String::utf8() returns a new temporary CString object and CString::data() returns a pointer to the internal CString data representation. Since the CString is temporary, the pointer returned by data() becomes invalid on next line. Yes, right! thanks for explanation Chris! :) (In reply to comment #8) > Now I see, this patch is fine. Sorry for introducing this bug and thanks guys for fixing. No problem! :)
Note You need to log in before you can comment on or make changes to this bug.