Last Comment Bug 444633 - [BEOS]Message pump in AppShell relies on bad assumption
: [BEOS]Message pump in AppShell relies on bad assumption
Status: ASSIGNED
:
Product: Core Graveyard
Classification: Graveyard
Component: Widget: BeOS (show other bugs)
: unspecified
: x86 BeOS
: -- major with 1 vote (vote)
: ---
Assigned To: Sergei Dolgov
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-07-10 11:44 PDT by Sergei Dolgov
Modified: 2014-12-09 11:27 PST (History)
4 users (show)
See Also:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
patch (8.57 KB, patch)
2008-07-11 08:28 PDT, Sergei Dolgov
thesuckiestemail: review-
Details | Diff | Review
uses strrchar (8.62 KB, patch)
2008-07-11 13:20 PDT, Sergei Dolgov
thesuckiestemail: review-
Details | Diff | Review

Description Sergei Dolgov 2008-07-10 11:44:32 PDT
for internal communication we use BeOS ports, which are OS-global objects, but assign to those names generated from PR_GetCurrentThread - actually from pointer, which value isn't OS-wide unique.

That worked with BeOS memory allocator, by occasion, actually, but in Haiku-OS those pointers get same value for simultaneously running Mozilla applications.

Which leads to closing one app by another.

We need to replace that bad port name generation in nsAppShell, nsToolkit and in plevent

http://community.livejournal.com/bezilla/282356.html

actual for all branches and trunks, but we do care only about 1.8 and above
Comment 1 Sergei Dolgov 2008-07-11 08:28:34 PDT
Created attachment 329080 [details] [diff] [review]
patch

using find_thread(appname) everywhere to generate ports and semaphores names.

looks like it is sufficient workaround for 1.8
Comment 2 Sergei Dolgov 2008-07-11 08:30:21 PDT
changing to MAJOR, as OS-global objects objects like port and semaphores may damage other apps or even OS when used unsafely
Comment 3 Sergei Dolgov 2008-07-11 13:20:22 PDT
Created attachment 329115 [details] [diff] [review]
uses strrchar

same as previous, but uniformely uses strrchar instead BPath::Leaf() everywhere, not only in plevent.c

may be bit faster than previous, but that's for choice by taste
Comment 4 Sergei Dolgov 2008-07-12 02:14:06 PDT
after little tests it looks like second version is really bit faster
Comment 5 Doug Shelton 2008-07-12 07:12:55 PDT
I've built Firefox and Thunderbird under Zeta using 2nd version.  Will build both under R5+BONE and test with Haiku this morning and report.
Comment 6 Doug Shelton 2008-07-12 14:19:56 PDT
Built Firefox and Thunderbird under BeOS BONE using second version.  Tested under Haiku and seems to work fine.  Nice work, fyysik!
Comment 7 Doug Shelton 2008-08-06 10:22:11 PDT
fyysik and tqh, how close are we to committing this patch?  Do you need further testing?
Comment 8 Sergei Dolgov 2008-08-07 05:23:13 PDT
(In reply to comment #7)
> fyysik and tqh, how close are we to committing this patch?  Do you need further
> testing?
> 
It's up to tqh. Both patches work OK for me since introduction, but personally I prefer second one. If tqh has neutral position and lack of time, I can put review request for you for second patch.
Comment 9 Doug Shelton 2008-10-01 15:36:52 PDT
Comment on attachment 329115 [details] [diff] [review]
uses strrchar

Been using this version for months in Firefox and Thunderbird.  Please review so we can commit.
Comment 10 tqh 2008-10-03 14:58:29 PDT
Sorry I've must have missed the patches completly. Will look at it tomorrow.
Comment 11 tqh 2008-10-04 00:35:22 PDT
Comment on attachment 329080 [details] [diff] [review]
patch

r-
The assumption that get_next_image_info(0, &cookie, &iinfo) is the app image may no longer be true with Haiku, although Ingo fixed that for now.

Couldn't we use arg[0] instead?
Comment 12 tqh 2008-10-04 00:35:46 PDT
Comment on attachment 329115 [details] [diff] [review]
uses strrchar

r-
See comments on other patch.
Comment 13 Sergei Dolgov 2008-10-04 01:33:56 PDT
> The assumption that get_next_image_info(0, &cookie, &iinfo) is the app image
> may no longer be true with Haiku, although Ingo fixed that for now.

Why so?

> Couldn't we use arg[0] instead?
That was my first idea. But is argc[0] accessible globally, outside of scope of main? I wish we have something like be_app->Name().
Comment 14 Doug Shelton 2008-10-04 06:14:25 PDT
tqh, can you suggest an alernative workaround?
Comment 15 tqh 2008-10-04 11:23:45 PDT
Sergei, might be available by tinfo.args
after
  get_team_info(0, &tinfo);

Need to verify this is true launching by commandline full/relative path and by click launching firefox-bin.

Otherwise loop thru the image until the type is of app image type, which is only small addition to the current code.

(Note I don't seem to get Mozilla mails atm. So I may miss a lot.)
Comment 16 tqh 2008-10-04 11:27:00 PDT
Hmm, yahoo filters mozilla mails as spam :(
Comment 17 tqh 2008-10-04 13:32:06 PDT
get_team_info(0, &tinfo) suffers from the following:
only 64 bytes and it also includes args as one string.

So not such a good idea.
Comment 18 Doug Shelton 2008-10-04 19:05:53 PDT
(In reply to comment #16)
> Hmm, yahoo filters mozilla mails as spam :(

Your name says it all:  "the suckiest email" :)
Comment 19 tqh 2008-10-05 10:13:26 PDT
Sergei I think we can just get the team id instead of trying to find_thread's.
Comment 20 tqh 2008-10-05 10:32:03 PDT
plevent.c would then be something like:
    team_info tinfo;
    get_team_info(0, &tinfo);
    
    PR_snprintf(portname, sizeof(portname), "MozEvent%lx", tinfo.team);
    PR_snprintf(semname, sizeof(semname), "MozSync%lx", tinfo.team);
Comment 21 Doug Shelton 2008-10-27 15:44:17 PDT
sergei and tqh, can we please get an update on this?  Haiku really needs a fix for this issue to be in the branch before Haiku Alpha release.  I'd be happy to try tqh's suggested code, but I don't trust myself to put it in the right place.  sergei, what do you think?
Comment 22 Sergei Dolgov 2008-10-27 15:54:26 PDT
(In reply to comment #21)
> sergei and tqh, can we please get an update on this?  Haiku really needs a fix
> for this issue to be in the branch before Haiku Alpha release.  I'd be happy to
> try tqh's suggested code, but I don't trust myself to put it in the right
> place.  sergei, what do you think?

Will be really busy next two days at least.
Comment 23 Carlos Alén Silva 2013-12-16 16:04:14 PST
Is this bug still relevant?

Note You need to log in before you can comment on or make changes to this bug.


Privacy Policy