Re: Crash only in recent SVN on FreeBSD

2007-07-09 Thread José Matos
On Sunday 08 July 2007 18:10:37 Koji Yokota wrote:
 Yap, it solved the problem. Thank you!!

  OK Enrico you can commit the patch.

 Koji

-- 
José Abílio


Re: Crash only in recent SVN on FreeBSD

2007-07-09 Thread Enrico Forestieri
On Mon, Jul 09, 2007 at 10:51:15AM +0100, José Matos wrote:

 On Sunday 08 July 2007 18:10:37 Koji Yokota wrote:
  Yap, it solved the problem. Thank you!!
 
   OK Enrico you can commit the patch.

Done.

-- 
Enrico


Re: Crash only in recent SVN on FreeBSD

2007-07-09 Thread José Matos
On Sunday 08 July 2007 18:10:37 Koji Yokota wrote:
> Yap, it solved the problem. Thank you!!

  OK Enrico you can commit the patch.

> Koji

-- 
José Abílio


Re: Crash only in recent SVN on FreeBSD

2007-07-09 Thread Enrico Forestieri
On Mon, Jul 09, 2007 at 10:51:15AM +0100, José Matos wrote:

> On Sunday 08 July 2007 18:10:37 Koji Yokota wrote:
> > Yap, it solved the problem. Thank you!!
> 
>   OK Enrico you can commit the patch.

Done.

-- 
Enrico


Re: Crash only in recent SVN on FreeBSD

2007-07-08 Thread Koji Yokota
Enrico Forestieri wrote:
 This occurs when the locale itself is not supported and I also get it
 on cygwin. Please, try the attached patch, which should definitely
 solve the issue.

Yap, it solved the problem. Thank you!!

Koji


Re: Crash only in recent SVN on FreeBSD

2007-07-08 Thread Koji Yokota
Enrico Forestieri wrote:
> This occurs when the locale itself is not supported and I also get it
> on cygwin. Please, try the attached patch, which should definitely
> solve the issue.

Yap, it solved the problem. Thank you!!

Koji


Re: Crash only in recent SVN on FreeBSD

2007-07-07 Thread Enrico Forestieri
On Sun, Jul 08, 2007 at 02:13:41AM +0900, Koji Yokota wrote:

 Hi,
 
 Only recently lyx-svn begins to crash when I open some of menus on a
 FreeBSD machine (I confirmed on revision 19004). Is this only a
 temporary phenomenon to be fixed soon? If so, please neglect this mail.
 
 Lyx crashes, for example, when I open Tools - Preferences, with error
 messages:
 
  LyXFunc::dispatch: cmd:  action: 225 arg: 'prefs' x: 0 y: 0
  Setting controller ro: 1
  Transition from state INITIAL to state INITIAL after input SMI_READ_ONLY
  Calling BC refresh()
  addCategory n= User interface   parent=
  addCategory n= Look and feel   parent=
  addCategory n= Screen fonts   parent=
  addCategory n= Colors   parent=
  addCategory n= Graphics   parent=
  addCategory n= Keyboard   parent=
  addCategory n= Paths   parent=
  addCategory n= Identity   parent=
  terminate called after throwing an instance of 'std::bad_cast'
what():  St8bad_cast
  Abort.

This is another consequence of http://www.lyx.org/trac/changeset/18988.
Try whether reverting that changeset helps. 

I think that the problem here is a missing locale facet.

-- 
Enrico


Re: Crash only in recent SVN on FreeBSD

2007-07-07 Thread Alfredo Braunstein
Enrico Forestieri wrote:

 On Sun, Jul 08, 2007 at 02:13:41AM +0900, Koji Yokota wrote:
 
 Hi,
 
 Only recently lyx-svn begins to crash when I open some of menus on a
 FreeBSD machine (I confirmed on revision 19004). Is this only a
 temporary phenomenon to be fixed soon? If so, please neglect this mail.
 
 Lyx crashes, for example, when I open Tools - Preferences, with error
 messages:
 
  LyXFunc::dispatch: cmd:  action: 225 arg: 'prefs' x: 0 y: 0
  Setting controller ro: 1
  Transition from state INITIAL to state INITIAL after input
  SMI_READ_ONLY Calling BC refresh()
  addCategory n= User interface   parent=
  addCategory n= Look and feel   parent=
  addCategory n= Screen fonts   parent=
  addCategory n= Colors   parent=
  addCategory n= Graphics   parent=
  addCategory n= Keyboard   parent=
  addCategory n= Paths   parent=
  addCategory n= Identity   parent=
  terminate called after throwing an instance of 'std::bad_cast'
what():  St8bad_cast
  Abort.
 
 This is another consequence of http://www.lyx.org/trac/changeset/18988.
 Try whether reverting that changeset helps.
 
 I think that the problem here is a missing locale facet.

Wild guess: does the following helps?

A/

Index: frontends/controllers/frontend_helpers.cpp
===
--- frontends/controllers/frontend_helpers.cpp	(revision 19003)
+++ frontends/controllers/frontend_helpers.cpp	(working copy)
@@ -1108,7 +1108,7 @@
   LanguagePair, bool
 {
 public:
-	Sorter() : loc_() {};
+	Sorter() : loc_() {};
 	bool operator()(LanguagePair const  lhs,
 			LanguagePair const  rhs) const {
 		return loc_(lhs.first, rhs.first);



Re: Crash only in recent SVN on FreeBSD

2007-07-07 Thread Enrico Forestieri
On Sat, Jul 07, 2007 at 07:40:23PM +0200, Alfredo Braunstein wrote:

 Wild guess: does the following helps?

No, sorry.

 Index: frontends/controllers/frontend_helpers.cpp
 ===
 --- frontends/controllers/frontend_helpers.cpp(revision 19003)
 +++ frontends/controllers/frontend_helpers.cpp(working copy)
 @@ -1108,7 +1108,7 @@
 LanguagePair, bool
  {
  public:
 - Sorter() : loc_() {};
 + Sorter() : loc_() {};
   bool operator()(LanguagePair const  lhs,
   LanguagePair const  rhs) const {
   return loc_(lhs.first, rhs.first);
 

-- 
Enrico


Re: Crash only in recent SVN on FreeBSD

2007-07-07 Thread Pavel Sanda
 Wild guess: does the following helps?

this maybe helps from the exception, but it will cause that sorting
wont be working with current settings of locale.
i think as well as Enrico that missing facet is the problem.

pavel


Re: Crash only in recent SVN on FreeBSD

2007-07-07 Thread Koji Yokota

Enrico Forestieri wrote:

This is another consequence of http://www.lyx.org/trac/changeset/18988.
Try whether reverting that changeset helps. 


Yes, I identified that reverting it removes the problem.



I think that the problem here is a missing locale facet.


Indeed, lyx always compains

 Locale ja_JP could not be set
 Locale en_US could not be set

but crash also happens when I start it with

 env LC_ALL=C lyx

In this case, there are no such complaints.

Koji


Re: Crash only in recent SVN on FreeBSD

2007-07-07 Thread Enrico Forestieri
On Sun, Jul 08, 2007 at 03:29:46AM +0900, Koji Yokota wrote:

 Enrico Forestieri wrote:
  This is another consequence of http://www.lyx.org/trac/changeset/18988.
  Try whether reverting that changeset helps. 
 
 Yes, I identified that reverting it removes the problem.

I was sure that that was the problem in your case, too.

  I think that the problem here is a missing locale facet.
 
 Indeed, lyx always compains
 
   Locale ja_JP could not be set
   Locale en_US could not be set

No, these are not related. These warnings mean that you don't have
support for those locales.

 but crash also happens when I start it with
 
   env LC_ALL=C lyx
 
 In this case, there are no such complaints.

Yes, the C locale is always supported. The crash is due to missing
support for wchar_t, meaning that even the C locale can't deal with
wide characters. Please try the patch I sent you.

-- 
Enrico


Re: Crash only in recent SVN on FreeBSD

2007-07-07 Thread Enrico Forestieri
On Sat, Jul 07, 2007 at 08:37:15PM +0200, Enrico Forestieri wrote:

 On Sun, Jul 08, 2007 at 03:29:46AM +0900, Koji Yokota wrote:
 
  but crash also happens when I start it with
  
env LC_ALL=C lyx
  
  In this case, there are no such complaints.
 
 Yes, the C locale is always supported. The crash is due to missing
 support for wchar_t, meaning that even the C locale can't deal with
 wide characters. Please try the patch I sent you.

Strange. I still don't see on the list the mail with the patch, so
I am resending it attached here.

-- 
Enrico
Index: src/frontends/controllers/frontend_helpers.cpp
===
--- src/frontends/controllers/frontend_helpers.cpp  (revision 19004)
+++ src/frontends/controllers/frontend_helpers.cpp  (working copy)
@@ -,7 +,11 @@ public:
Sorter() : loc_() {};
bool operator()(LanguagePair const  lhs,
LanguagePair const  rhs) const {
+#if !defined(USE_WCHAR_T)  defined(__GNUC__)
+   return loc_(to_local8bit(lhs.first), to_local8bit(rhs.first));
+#else
return loc_(lhs.first, rhs.first);
+#endif
}
 private:
std::locale loc_;


Re: Crash only in recent SVN on FreeBSD

2007-07-07 Thread Koji Yokota
Enrico Forestieri wrote:
 On Sat, Jul 07, 2007 at 08:37:15PM +0200, Enrico Forestieri wrote:
 
 On Sun, Jul 08, 2007 at 03:29:46AM +0900, Koji Yokota wrote:

 but crash also happens when I start it with

   env LC_ALL=C lyx

 In this case, there are no such complaints.
 Yes, the C locale is always supported. The crash is due to missing
 support for wchar_t, meaning that even the C locale can't deal with
 wide characters. Please try the patch I sent you.
 
 Strange. I still don't see on the list the mail with the patch, so
 I am resending it attached here.

Indeed the problem seems around here. The patch solved the problem when
I start lyx with LC_ALL=C.

However, when it is started with ja_JP locale for example, it still
crashes with complaints:

 terminate called after throwing an instance of 'std::runtime_error'
   what():  locale::facet::_S_create_c_locale name not valid
 Abort (damped core)

A little more modification may be necessary.

Koji


Re: Crash only in recent SVN on FreeBSD

2007-07-07 Thread Enrico Forestieri
On Sun, Jul 08, 2007 at 04:22:29AM +0900, Koji Yokota wrote:

 Enrico Forestieri wrote:
  On Sat, Jul 07, 2007 at 08:37:15PM +0200, Enrico Forestieri wrote:
  
  On Sun, Jul 08, 2007 at 03:29:46AM +0900, Koji Yokota wrote:
 
  but crash also happens when I start it with
 
env LC_ALL=C lyx
 
  In this case, there are no such complaints.
  Yes, the C locale is always supported. The crash is due to missing
  support for wchar_t, meaning that even the C locale can't deal with
  wide characters. Please try the patch I sent you.
  
  Strange. I still don't see on the list the mail with the patch, so
  I am resending it attached here.
 
 Indeed the problem seems around here. The patch solved the problem when
 I start lyx with LC_ALL=C.
 
 However, when it is started with ja_JP locale for example, it still
 crashes with complaints:
 
  terminate called after throwing an instance of 'std::runtime_error'
what():  locale::facet::_S_create_c_locale name not valid
  Abort (damped core)
 
 A little more modification may be necessary.

This occurs when the locale itself is not supported and I also get it
on cygwin. Please, try the attached patch, which should definitely
solve the issue.

-- 
Enrico
Index: src/frontends/controllers/frontend_helpers.cpp
===
--- src/frontends/controllers/frontend_helpers.cpp  (revision 18988)
+++ src/frontends/controllers/frontend_helpers.cpp  (working copy)
@@ -1108,6 +1108,12 @@ class Sorter
  LanguagePair, bool
 {
 public:
+#if !defined(USE_WCHAR_T)  defined(__GNUC__)
+   bool operator()(LanguagePair const  lhs,
+   LanguagePair const  rhs) const {
+   return lhs.first  rhs.first;
+   }
+#else
Sorter() : loc_() {};
bool operator()(LanguagePair const  lhs,
LanguagePair const  rhs) const {
@@ -1115,6 +1121,7 @@ public:
}
 private:
std::locale loc_;
+#endif
 };
 
 } // namespace anon


Re: Crash only in recent SVN on FreeBSD

2007-07-07 Thread Enrico Forestieri
On Sun, Jul 08, 2007 at 02:13:41AM +0900, Koji Yokota wrote:

> Hi,
> 
> Only recently lyx-svn begins to crash when I open some of menus on a
> FreeBSD machine (I confirmed on revision 19004). Is this only a
> temporary phenomenon to be fixed soon? If so, please neglect this mail.
> 
> Lyx crashes, for example, when I open Tools -> Preferences, with error
> messages:
> 
> > LyXFunc::dispatch: cmd:  action: 225 arg: 'prefs' x: 0 y: 0
> > Setting controller ro: 1
> > Transition from state INITIAL to state INITIAL after input SMI_READ_ONLY
> > Calling BC refresh()
> > addCategory n= User interface   parent=
> > addCategory n= Look and feel   parent=
> > addCategory n= Screen fonts   parent=
> > addCategory n= Colors   parent=
> > addCategory n= Graphics   parent=
> > addCategory n= Keyboard   parent=
> > addCategory n= Paths   parent=
> > addCategory n= Identity   parent=
> > terminate called after throwing an instance of 'std::bad_cast'
> >   what():  St8bad_cast
> > Abort.

This is another consequence of http://www.lyx.org/trac/changeset/18988.
Try whether reverting that changeset helps. 

I think that the problem here is a missing locale facet.

-- 
Enrico


Re: Crash only in recent SVN on FreeBSD

2007-07-07 Thread Alfredo Braunstein
Enrico Forestieri wrote:

> On Sun, Jul 08, 2007 at 02:13:41AM +0900, Koji Yokota wrote:
> 
>> Hi,
>> 
>> Only recently lyx-svn begins to crash when I open some of menus on a
>> FreeBSD machine (I confirmed on revision 19004). Is this only a
>> temporary phenomenon to be fixed soon? If so, please neglect this mail.
>> 
>> Lyx crashes, for example, when I open Tools -> Preferences, with error
>> messages:
>> 
>> > LyXFunc::dispatch: cmd:  action: 225 arg: 'prefs' x: 0 y: 0
>> > Setting controller ro: 1
>> > Transition from state INITIAL to state INITIAL after input
>> > SMI_READ_ONLY Calling BC refresh()
>> > addCategory n= User interface   parent=
>> > addCategory n= Look and feel   parent=
>> > addCategory n= Screen fonts   parent=
>> > addCategory n= Colors   parent=
>> > addCategory n= Graphics   parent=
>> > addCategory n= Keyboard   parent=
>> > addCategory n= Paths   parent=
>> > addCategory n= Identity   parent=
>> > terminate called after throwing an instance of 'std::bad_cast'
>> >   what():  St8bad_cast
>> > Abort.
> 
> This is another consequence of http://www.lyx.org/trac/changeset/18988.
> Try whether reverting that changeset helps.
> 
> I think that the problem here is a missing locale facet.

Wild guess: does the following helps?

A/

Index: frontends/controllers/frontend_helpers.cpp
===
--- frontends/controllers/frontend_helpers.cpp	(revision 19003)
+++ frontends/controllers/frontend_helpers.cpp	(working copy)
@@ -1108,7 +1108,7 @@
   LanguagePair, bool>
 {
 public:
-	Sorter() : loc_("") {};
+	Sorter() : loc_() {};
 	bool operator()(LanguagePair const & lhs,
 			LanguagePair const & rhs) const {
 		return loc_(lhs.first, rhs.first);



Re: Crash only in recent SVN on FreeBSD

2007-07-07 Thread Enrico Forestieri
On Sat, Jul 07, 2007 at 07:40:23PM +0200, Alfredo Braunstein wrote:

> Wild guess: does the following helps?

No, sorry.

> Index: frontends/controllers/frontend_helpers.cpp
> ===
> --- frontends/controllers/frontend_helpers.cpp(revision 19003)
> +++ frontends/controllers/frontend_helpers.cpp(working copy)
> @@ -1108,7 +1108,7 @@
> LanguagePair, bool>
>  {
>  public:
> - Sorter() : loc_("") {};
> + Sorter() : loc_() {};
>   bool operator()(LanguagePair const & lhs,
>   LanguagePair const & rhs) const {
>   return loc_(lhs.first, rhs.first);
> 

-- 
Enrico


Re: Crash only in recent SVN on FreeBSD

2007-07-07 Thread Pavel Sanda
> Wild guess: does the following helps?

this maybe helps from the exception, but it will cause that sorting
wont be working with current settings of locale.
i think as well as Enrico that missing facet is the problem.

pavel


Re: Crash only in recent SVN on FreeBSD

2007-07-07 Thread Koji Yokota

Enrico Forestieri wrote:

This is another consequence of http://www.lyx.org/trac/changeset/18988.
Try whether reverting that changeset helps. 


Yes, I identified that reverting it removes the problem.



I think that the problem here is a missing locale facet.


Indeed, lyx always compains

> Locale ja_JP could not be set
> Locale en_US could not be set

but crash also happens when I start it with

> env LC_ALL=C lyx

In this case, there are no such complaints.

Koji


Re: Crash only in recent SVN on FreeBSD

2007-07-07 Thread Enrico Forestieri
On Sun, Jul 08, 2007 at 03:29:46AM +0900, Koji Yokota wrote:

> Enrico Forestieri wrote:
> > This is another consequence of http://www.lyx.org/trac/changeset/18988.
> > Try whether reverting that changeset helps. 
> 
> Yes, I identified that reverting it removes the problem.

I was sure that that was the problem in your case, too.

> > I think that the problem here is a missing locale facet.
> 
> Indeed, lyx always compains
> 
>  > Locale ja_JP could not be set
>  > Locale en_US could not be set

No, these are not related. These warnings mean that you don't have
support for those locales.

> but crash also happens when I start it with
> 
>  > env LC_ALL=C lyx
> 
> In this case, there are no such complaints.

Yes, the C locale is always supported. The crash is due to missing
support for wchar_t, meaning that even the C locale can't deal with
wide characters. Please try the patch I sent you.

-- 
Enrico


Re: Crash only in recent SVN on FreeBSD

2007-07-07 Thread Enrico Forestieri
On Sat, Jul 07, 2007 at 08:37:15PM +0200, Enrico Forestieri wrote:

> On Sun, Jul 08, 2007 at 03:29:46AM +0900, Koji Yokota wrote:
> 
> > but crash also happens when I start it with
> > 
> >  > env LC_ALL=C lyx
> > 
> > In this case, there are no such complaints.
> 
> Yes, the C locale is always supported. The crash is due to missing
> support for wchar_t, meaning that even the C locale can't deal with
> wide characters. Please try the patch I sent you.

Strange. I still don't see on the list the mail with the patch, so
I am resending it attached here.

-- 
Enrico
Index: src/frontends/controllers/frontend_helpers.cpp
===
--- src/frontends/controllers/frontend_helpers.cpp  (revision 19004)
+++ src/frontends/controllers/frontend_helpers.cpp  (working copy)
@@ -,7 +,11 @@ public:
Sorter() : loc_("") {};
bool operator()(LanguagePair const & lhs,
LanguagePair const & rhs) const {
+#if !defined(USE_WCHAR_T) && defined(__GNUC__)
+   return loc_(to_local8bit(lhs.first), to_local8bit(rhs.first));
+#else
return loc_(lhs.first, rhs.first);
+#endif
}
 private:
std::locale loc_;


Re: Crash only in recent SVN on FreeBSD

2007-07-07 Thread Koji Yokota
Enrico Forestieri wrote:
> On Sat, Jul 07, 2007 at 08:37:15PM +0200, Enrico Forestieri wrote:
> 
>> On Sun, Jul 08, 2007 at 03:29:46AM +0900, Koji Yokota wrote:
>>
>>> but crash also happens when I start it with
>>>
>>>  > env LC_ALL=C lyx
>>>
>>> In this case, there are no such complaints.
>> Yes, the C locale is always supported. The crash is due to missing
>> support for wchar_t, meaning that even the C locale can't deal with
>> wide characters. Please try the patch I sent you.
> 
> Strange. I still don't see on the list the mail with the patch, so
> I am resending it attached here.

Indeed the problem seems around here. The patch solved the problem when
I start lyx with LC_ALL=C.

However, when it is started with ja_JP locale for example, it still
crashes with complaints:

> terminate called after throwing an instance of 'std::runtime_error'
>   what():  locale::facet::_S_create_c_locale name not valid
> Abort (damped core)

A little more modification may be necessary.

Koji


Re: Crash only in recent SVN on FreeBSD

2007-07-07 Thread Enrico Forestieri
On Sun, Jul 08, 2007 at 04:22:29AM +0900, Koji Yokota wrote:

> Enrico Forestieri wrote:
> > On Sat, Jul 07, 2007 at 08:37:15PM +0200, Enrico Forestieri wrote:
> > 
> >> On Sun, Jul 08, 2007 at 03:29:46AM +0900, Koji Yokota wrote:
> >>
> >>> but crash also happens when I start it with
> >>>
> >>>  > env LC_ALL=C lyx
> >>>
> >>> In this case, there are no such complaints.
> >> Yes, the C locale is always supported. The crash is due to missing
> >> support for wchar_t, meaning that even the C locale can't deal with
> >> wide characters. Please try the patch I sent you.
> > 
> > Strange. I still don't see on the list the mail with the patch, so
> > I am resending it attached here.
> 
> Indeed the problem seems around here. The patch solved the problem when
> I start lyx with LC_ALL=C.
> 
> However, when it is started with ja_JP locale for example, it still
> crashes with complaints:
> 
> > terminate called after throwing an instance of 'std::runtime_error'
> >   what():  locale::facet::_S_create_c_locale name not valid
> > Abort (damped core)
> 
> A little more modification may be necessary.

This occurs when the locale itself is not supported and I also get it
on cygwin. Please, try the attached patch, which should definitely
solve the issue.

-- 
Enrico
Index: src/frontends/controllers/frontend_helpers.cpp
===
--- src/frontends/controllers/frontend_helpers.cpp  (revision 18988)
+++ src/frontends/controllers/frontend_helpers.cpp  (working copy)
@@ -1108,6 +1108,12 @@ class Sorter
  LanguagePair, bool>
 {
 public:
+#if !defined(USE_WCHAR_T) && defined(__GNUC__)
+   bool operator()(LanguagePair const & lhs,
+   LanguagePair const & rhs) const {
+   return lhs.first < rhs.first;
+   }
+#else
Sorter() : loc_("") {};
bool operator()(LanguagePair const & lhs,
LanguagePair const & rhs) const {
@@ -1115,6 +1121,7 @@ public:
}
 private:
std::locale loc_;
+#endif
 };
 
 } // namespace anon