[BEOS] Firefox crashes on 1st run with no existing profile [@ nsNetscapeProfileMigratorBase::GetProfileDataFromRegistry]

RESOLVED FIXED

Status

()

Firefox
Migration
--
critical
RESOLVED FIXED
13 years ago
7 years ago

People

(Reporter: Doug Shelton, Unassigned)

Tracking

({crash, fixed1.8.1})

Trunk
x86
BeOS
crash, fixed1.8.1
Points:
---
Dependency tree / graph

Firefox Tracking Flags

(Not tracked)

Details

(crash signature)

Attachments

(3 attachments, 2 obsolete attachments)

(Reporter)

Description

13 years ago
User-Agent:       Mozilla/5.0 (BeOS; U; BeOS BePC; en-US; rv:1.9a1) Gecko/20051105 Firefox/1.6a1
Build Identifier: Mozilla/5.0 (BeOS; U; BeOS BePC; en-US; rv:1.9a1) Gecko/20051105 Firefox/1.6a1

On clean install with no existing /boot/home/config/settings/mozilla folder, Firefox crashes on 1st startup.  Restart Firefox, everything proceeds as normal.

Reproducible: Always

Steps to Reproduce:
1.delete /boot/home/config/settings/mozilla
2.install Firefox
3.start Firefox

Actual Results:  
Firefox crashes.

Expected Results:  
Firefox runs.
(Reporter)

Comment 1

13 years ago
Created attachment 202510 [details]
stack crawl of crash with meaningful debug info
(Reporter)

Updated

13 years ago
Blocks: 311032

Updated

13 years ago
Severity: normal → critical
Keywords: crash
Summary: [BEOS] Firefox crashes on 1st run with no existing profile → [BEOS] Firefox crashes on 1st run with no existing profile [@ nsNetscapeProfileMigratorBase::GetProfileDataFromRegistry]
Version: unspecified → Trunk

Comment 2

13 years ago
did you try to build it with disabled profilesharing,
single profile enabled
and profile migrator disabled? (if such option exists)

Comment 4

13 years ago
try to add
http://lxr.mozilla.org/seamonkey/source/browser/components/migration/src/nsPhoenixProfileMigrator.cpp#274
before
#elif defined(XP_OS2)
following lines
#elif defined(XP_BEOS)
   fileLocator->Get(NS_BEOS_SETTINGS_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(phoenixRegistry));
   
   phoenixRegistry->Append(NS_LITERAL_STRING("Phoenix"));
   phoenixRegistry->Append(NS_LITERAL_STRING("appreg"));

if it works, submit patch

Comment 5

13 years ago
Doug, can you see if Sergei's suggested change works, and create a patch if it does?

Status: UNCONFIRMED → NEW
Ever confirmed: true
(Reporter)

Comment 6

13 years ago
(In reply to comment #5)
> Doug, can you see if Sergei's suggested change works, and create a patch if it
> does?
> 
I'll try.
(Reporter)

Comment 7

13 years ago
Created attachment 202600 [details]
stack crawl and console output

I incorporated the code fyysik suggested.  Firefox still crashes, but the stack crawl looks different.  I also included terminal output so you can see how far it gets brfore dying.
(Reporter)

Comment 8

13 years ago
Created attachment 202601 [details]
stack crawl and console output

I incorporated the code fyysik suggested.  Firefox still crashes, but the stack crawl looks different.  I also included terminal output so you can see how far it gets brfore dying.
(Reporter)

Comment 9

13 years ago
Just to double-check, here is the section of code after I made the change:
#elif defined(XP_UNIX)
  fileLocator->Get(NS_UNIX_HOME_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(phoenixRegistry));
  
  phoenixRegistry->Append(NS_LITERAL_STRING(".phoenix"));
  phoenixRegistry->Append(NS_LITERAL_STRING("appreg"));
#elif defined(XP_BEOS)
   fileLocator->Get(NS_BEOS_SETTINGS_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(phoenixRegistry));

   phoenixRegistry->Append(NS_LITERAL_STRING("Phoenix"));
   phoenixRegistry->Append(NS_LITERAL_STRING("appreg"));
#elif defined(XP_OS2)
  fileLocator->Get(NS_OS2_HOME_DIR, NS_GET_IID(nsILocalFile), getter_AddRefs(phoenixRegistry));
  
  phoenixRegistry->Append(NS_LITERAL_STRING("Phoenix"));
  phoenixRegistry->Append(NS_LITERAL_STRING("registry.dat"));
#endif

Hopefully I did this right, so the problem was not with my testing.

Comment 10

13 years ago
Tigerdog, if you start firefox from script (not firefox-bin),
please open this script using right-click->OpenWith->(some text editor here)
 find line
"$dist_bin/run-mozilla.sh" $script_args "$dist_bin/$MOZILLA_BIN" "$@"

(before exitcode)
and replace it with
exec "$dist_bin/run-mozilla.sh" $script_args "$dist_bin/$MOZILLA_BIN" "$@"

then do your crash text again, and if it crashes, look if stack crawl is more informative now.
(Reporter)

Comment 11

13 years ago
Created attachment 202654 [details]
more informative stack crawl

more informative stack crawl, per fyysik's suggestion.  same code mod as before.
Attachment #202600 - Attachment is obsolete: true
Attachment #202601 - Attachment is obsolete: true

Comment 12

13 years ago
notice for tqh. 
Not directly related to this bug.
Look pls here:
http://lxr.mozilla.org/seamonkey/source/xpcom/threads/nsEnvironment.cpp#95
and tell me what do you think about it. If we should add XP_BEOS there

Comment 13

13 years ago
Question for Doug.
Do you have folder home/config/settings/Phoenix at your machine?
If so, do you have file "appreg" inside it?

Comment 14

13 years ago
Tough question: I use the ultimate answer: Hmm, what do you think?

Not sure but I don't see how the current impl. would cause any problems.
(Reporter)

Comment 15

13 years ago
fyysik, I do not have home/config/settings/Phoenix.  Only home/config/settings/Mozilla.

Comment 16

13 years ago
if you don't have Phoenix and appreg, crahsing method should return immediately instead crash. Probably it means that MPath check macro or nsFile*::Exists() fails in this case.
Didn't we change something in 3 months in nsFile, moving it to common implementation? 
Nielx?

Comment 17

13 years ago
You mean nsLocalFileUnix.cpp (which btw we should create our own version of)?

Comment 18

13 years ago
(In reply to comment #16)
> if you don't have Phoenix and appreg, crahsing method should return immediately
> instead crash. Probably it means that MPath check macro or nsFile*::Exists()
> fails in this case.
> Didn't we change something in 3 months in nsFile, moving it to common
> implementation? 

I'm having a hard time remembering what we fixed, but it had something to do with launching files. What we replaced was the method in another file, nothing in nsLocalFileUnix.cpp.

Comment 19

13 years ago
tigerdog, put at this empty line
http://lxr.mozilla.org/seamonkey/source/browser/components/migration/src/nsNetscapeProfileMigratorBase.cpp#86
statement:
printf("Wow, ghost in the shell! Beware Phoenix rising from ashes!\n"); fflush(stdout);
and see if this line appears before crash.
(Reporter)

Comment 20

13 years ago
printf does not appear in console output, fyysik.  sorry so slow today.  day job.  leaving for meeting now; back in 2 hours.

Comment 21

13 years ago
Doug, next try:
before line
http://lxr.mozilla.org/seamonkey/source/xpcom/io/nsLocalFileUnix.cpp#108
insert 
if(!mPath) return NS_ERROR_FAILURE;

then run make in

mozilla/xpcom

and see if it still crashes
(Reporter)

Comment 22

13 years ago
(In reply to comment #21)
If I understand your request, resulting code should be:
<small>#define CHECK_mPath()                           \
    PR_BEGIN_MACRO                              \
    if(!mPath) return NS_ERROR_FAILURE; 
        if (mPath.IsEmpty())                    \
            return NS_ERROR_NOT_INITIALIZED;    \
    PR_END_MACRO</small>

but this will not compile.  Error is 
<small>/boot/home/develop/mozilla/xpcom/io/nsLocalFileUnix.cpp: In method `nsresult nsLocalFile::CopyToNative(nsIFile *, const nsACString_internal &)':
/boot/home/develop/mozilla/xpcom/io/nsLocalFileUnix.cpp:749: no match for `!nsCString &'
/boot/home/develop/mozilla/xpcom/io/nsLocalFileUnix.cpp:749: candidates are: operator !(bool) <builtin>
/boot/home/develop/mozilla/xpcom/io/nsLocalFileUnix.cpp: In method `nsresult nsLocalFile::MoveToNative(nsIFile *, const nsACString_internal &)':   </small>

I'm guessing I've done something wrong - let me know.

Comment 23

13 years ago
you did all right - just add back slash to end of line you inserted. Like it is at ends of other lines inside macro
(Reporter)

Comment 25

13 years ago
Created attachment 203866 [details] [diff] [review]
adds BeOS entries to Phoenix and SeaMonkey profile migrators

Updated

13 years ago
Attachment #203866 - Flags: review+

Comment 26

13 years ago
Nielx, maybe it needs also 1.8* approval at some moment, what do you think?

Comment 27

13 years ago
Patch landed in trunk by mconnor. Closing for 1.9*
Status: NEW → RESOLVED
Last Resolved: 13 years ago
Resolution: --- → FIXED

Comment 28

13 years ago
(In reply to comment #26)
> Nielx, maybe it needs also 1.8* approval at some moment, what do you think?
> 

I'll add this one to a list as well.

Updated

13 years ago
Blocks: 316882

Comment 29

12 years ago
Comment on attachment 203866 [details] [diff] [review]
adds BeOS entries to Phoenix and SeaMonkey profile migrators

With our cycle of backporting all trunk improvents to 1.8 branch we forgot this quite critical patch.

Asking approval for 1.8.1 for adding BeOS #ifdef case to Phoenix and SeaMonkey profile) migrators.
Attachment #203866 - Flags: approval1.8.1?
Comment on attachment 203866 [details] [diff] [review]
adds BeOS entries to Phoenix and SeaMonkey profile migrators

a=beltzner on behalf of 181drivers (NPOTB stuff is a-ok!)
Attachment #203866 - Flags: approval1.8.1? → approval1.8.1+

Comment 31

12 years ago
Checking in mozilla/browser/components/migration/src/nsPhoenixProfileMigrator.cpp;
/cvsroot/mozilla/browser/components/migration/src/nsPhoenixProfileMigrator.cpp,v  <--  nsPhoenixProfileMigrator.cpp
new revision: 1.12.24.2; previous revision: 1.12.24.1
done
Checking in mozilla/browser/components/migration/src/nsSeamonkeyProfileMigrator.cpp;
/cvsroot/mozilla/browser/components/migration/src/nsSeamonkeyProfileMigrator.cpp,v  <--  nsSeamonkeyProfileMigrator.cpp
new revision: 1.19.8.4; previous revision: 1.19.8.3
done 
Keywords: fixed1.8.1
(Assignee)

Updated

7 years ago
Crash Signature: [@ nsNetscapeProfileMigratorBase::GetProfileDataFromRegistry]
You need to log in before you can comment on or make changes to this bug.