[Project_owners] Newbie question about XPCOM strings

Nickolay Ponomarev asqueella at gmail.com
Wed Oct 24 07:34:35 PDT 2007


On 10/17/07, Ryan McLelland <ryan.mclelland at gmail.com> wrote:
> Hi Everyone-
> I'm working on a project with some classmates of mine trying to write some
> XPCOM components, and we are getting some very strange behavior from the
> ns*String* classes. For some reason, any time we use any of these string
> types in our code, install our extension into the browser, and run it, it
> segmentation faults at the first mention of any ns*String* class. We have
> tried copying numerous examples we've found on the web and have tried
> recompiling the entire source a few times, but nothing seems to work (we are
> developing in the mozilla build environment, not with the gecko-sdk). Any
> thoughts on what could be causing this would be very much appreciated.

You didn't mention what string classes and what linkage you're using
(or what tree you're using to build your component and in what build
of Firefox you're trying to use it). There is internal string API,
which you shouldn't use in extension components (and won't be able to
in fx3, as I understand) and public strings API, which you should use.

http://developer.mozilla.org/en/docs/Migrating_from_Internal_Linkage_to_Frozen_Linkage
may be helpful.

Note that I'm not familiar with specifics of writing/building
extension components myself, so this is just what I know from scanning
over various docs and newsgroup discussions. bsmedberg knows
everything about these issues, so if you get absolutely stuck, try
asking in mozilla.dev.tech.xpcom or try to get him on irc.

Nickolay


More information about the Project_owners mailing list