Closed Bug 737084 Opened 12 years ago Closed 12 years ago

Do pthread_atfork in jemalloc on mac and android

Categories

(Core :: mozglue, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla14

People

(Reporter: glandium, Assigned: glandium)

References

Details

Attachments

(1 file)

Currently, the pthread_atfork call from jemalloc is only done on Linux. There used to be a workaround in the ipc code, around a fork, but it went away recently. Anyways, to avoid any future surprise around this, we'd be better off doing pthread_atfork on Android, which "only" requires a few wrapped functions.
And we should also do it on mac, since that's supported.
Assignee: nobody → mh+mozilla
Attachment #607211 - Flags: review?(khuey)
Attachment #607211 - Flags: review?(blassey.bugs)
Attachment #607211 - Flags: feedback?(justin.lebar+bug)
I don't pretend to know exactly what's going on here, but 

         WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=getaddrinfo,--wrap=freeaddrinfo,--wrap=gai_strerror"
+        WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=fork,--wrap=pthread_atfork"

the second line doesn't overwrite the first one here?
Attachment #607211 - Flags: feedback?(justin.lebar+bug) → feedback+
(In reply to Justin Lebar [:jlebar] from comment #2)
> I don't pretend to know exactly what's going on here, but 
> 
>          WRAP_LDFLAGS="${WRAP_LDFLAGS}
> -Wl,--wrap=getaddrinfo,--wrap=freeaddrinfo,--wrap=gai_strerror"
> +        WRAP_LDFLAGS="${WRAP_LDFLAGS} -Wl,--wrap=fork,--wrap=pthread_atfork"
> 
> the second line doesn't overwrite the first one here?

It's appends each time.
> It's appends each time.

Wow, it's like they *tried* to make a ridiculous language.
(In reply to Mike Hommey [:glandium] from comment #0)
> Currently, the pthread_atfork call from jemalloc is only done on Linux.
> There used to be a workaround in the ipc code, around a fork, but it went
> away recently. 
What went away?
(In reply to Brad Lassey [:blassey] from comment #5)
> (In reply to Mike Hommey [:glandium] from comment #0)
> > Currently, the pthread_atfork call from jemalloc is only done on Linux.
> > There used to be a workaround in the ipc code, around a fork, but it went
> > away recently. 
> What went away?

See bug 622992. While this avoids the problem that using the atfork callbacks solves, it doesn't ensure that future changes won't break assumptions again. Or that we won't be doing a fork() for some place else.
Attachment #607211 - Flags: review?(blassey.bugs) → review+
https://hg.mozilla.org/mozilla-central/rev/c6634316f474
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla14
This breaks b2g build.
(In reply to Kan-Ru Chen [:kanru] from comment #9)
> This breaks b2g build.

Please file a bug. Do i guess right that it fails to link libmozglue because it can't find pthread_atfork?
Depends on: 738559
Depends on: 738561
Depends on: 738709
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: