TextEdit : critical error prevents loading

classic Classic list List threaded Threaded
15 messages Options
Reply | Threaded
Open this post in threaded view
|

TextEdit : critical error prevents loading

Patrick
Hi All,

When I try to start TextEdit, a critical error message is shown :

"NSInvalidArgumentException: Tried to add nil to array"

And then, I must stop the app.

So, is TextEdit actually used by any of You ?

- My context :
OS : GNU/Linux Ubuntu 18.04 (LTS)
WM : WindowMaker
GNUstep - All packages from the official deb packages of that distro :
Base : 1.25.1
Gui & Back : 0.26.2-3
Make : 2.7.0-3

Bye !
Patrick


_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: TextEdit : critical error prevents loading

Yavor Doganov-3
В Sun, 08 Jul 2018 18:08:09 +0200, Patrick CARDONA написа:

> When I try to start TextEdit, a critical error message is shown :
>
> "NSInvalidArgumentException: Tried to add nil to array"

You didn't specify the version of TextEdit, I assume it is 5.0-2?
Does it happen if you move ~/GNUstep/Defaults/TextEdit.plist away?  If it
doesn't, it is a bug that I attempted to fix (migrating some defaults to
the new types) but apparently the fix is not complete.

If you still get the exception, this could be related to your printing
problem since TextEdit does setup printing on startup (unlike Ink). Could
you please install gdb, libgnustep-base1.25-dbgsym, libgnustep-gui0.26-
dbgsym, textedit.app-dbgsym, libobjc4-dbg and run the app like this (in a
terminal):

$ gdb TextEdit
(gdb) break -[NSException raise]
...Answer "y" to the question...
(gdb) r

When you get back to the gdb prompt, type "bt" and send the output.
Thanks.


_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: TextEdit : critical error prevents loading

Patrick
On 2018-07-08 23:14:13 +0200 Yavor Doganov <[hidden email]> wrote:

Hi Davor,

I answer in the flow of your message :

> В Sun, 08 Jul 2018 18:08:09 +0200, Patrick CARDONA написа:
>
>> When I try to start TextEdit, a critical error message is shown :
>>
>> "NSInvalidArgumentException: Tried to add nil to array"
>
> You didn't specify the version of TextEdit, I assume it is 5.0-2?
In "Info-gnustep.plist", I got this :
> ApplicationRelease = 5; (it is not exactly 5.0-2)

> Does it happen if you move ~/GNUstep/Defaults/TextEdit.plist away?
When I rename "Info-gnustep.plist" to "Info-gnustep.plist.back", I get these messages :

> patrick@patrick-Macmini1:/usr/lib/GNUstep/Applications/TextEdit.app/Resources$
> ls
> accessories-text-editor_128x128x32.png  DocumentWindow.nib  Info-gnustep.plist
> accessories-text-editor.icns            English.lproj
> patrick@patrick-Macmini1:/usr/lib/GNUstep/Applications/TextEdit.app/Resources$
> sudo mv Info-gnustep.plist Info-gnustep.plist.back
> [sudo] Mot de passe de patrick :
> patrick@patrick-Macmini1:/usr/lib/GNUstep/Applications/TextEdit.app/Resources$
> openapp TextEdit
> 2018-07-09 14:36:52.540 TextEdit[3330:3330] Bad application class '(null)'
> specified
> 2018-07-09 14:36:52.864 TextEdit[3330:3330] styleoffsets ... guessing offsets
> 2018-07-09 14:36:52.864 TextEdit[3330:3330] styleoffsets ... guessing offsets

And then the app nether shows up, like it happens to the print panel  within Ink.

>  If it
> doesn't, it is a bug that I attempted to fix (migrating some defaults to the
> new types) but apparently the fix is not complete.
>
> If you still get the exception,

Well, no more exception thrown, but no app at all.

this could be related to your printing
> problem since TextEdit does setup printing on startup (unlike Ink). Could you
> please install gdb, libgnustep-base1.25-dbgsym, libgnustep-gui0.26-
> dbgsym, textedit.app-dbgsym, libobjc4-dbg and run the app like this (in a
> terminal):

I have already gdb installed, but I could not install the *.dbg neither *.dbgsym because there seem not available within Ubuntu :
This is the list of available packages which begin with "libgnustep-" :
libgnustep-base1.25  libgnustep-dl2-0d    libgnustep-gui0.26
libgnustep-base-dev  libgnustep-dl2-dev   libgnustep-gui-dev

So these steps are not avaible until now in my context.
> $ gdb TextEdit
> (gdb) break -[NSException raise]
> ...Answer "y" to the question...
> (gdb) r
>
> When you get back to the gdb prompt, type "bt" and send the output.
> Thanks.

Where Could I find the symbols files ?

Bye!
Patrick


_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: TextEdit : critical error prevents loading

Yavor Doganov-3
В Mon, 09 Jul 2018 15:47:48 +0200, Patrick CARDONA написа:
> On 2018-07-08 23:14:13 +0200 Yavor Doganov <[hidden email]> wrote:

>> ApplicationRelease = 5; (it is not exactly 5.0-2)

"dpkg -l textedit.app" should give the answer which package version you
have installed.

>> Does it happen if you move ~/GNUstep/Defaults/TextEdit.plist away?
> When I rename "Info-gnustep.plist" to "Info-gnustep.plist.back", I get
> these messages :

No, that is the wrong file to move.  I asked for
/home/patrick/GNUstep/Defaults/TextEdit.plist.

> I have already gdb installed, but I could not install the *.dbg neither
> *.dbgsym because there seem not available within Ubuntu :

Well, you'll probably have to enable additional repositories for them;
please check your usual Ubuntu documentation / support channels.  I found
this wiki page for Ubuntu but I don't know if it's accurate:

https://wiki.ubuntu.com/Debug%20Symbol%20Packages


_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: TextEdit : critical error prevents loading

Patrick
Hi Yavor,

I go on answering in the flow of your message :

On 2018-07-09 16:04:08 +0200 Yavor Doganov <[hidden email]> wrote:

> В Mon, 09 Jul 2018 15:47:48 +0200, Patrick CARDONA написа:
>> On 2018-07-08 23:14:13 +0200 Yavor Doganov <[hidden email]> wrote:
>
>>> ApplicationRelease = 5; (it is not exactly 5.0-2)
>
> "dpkg -l textedit.app" should give the answer which package version you have
> installed.
>
Ok : dpkg -l  returns :
> ii  textedit.app   5.0-2        i386         Text editor for GNUstep


>>> Does it happen if you move ~/GNUstep/Defaults/TextEdit.plist away?
>> When I rename "Info-gnustep.plist" to "Info-gnustep.plist.back", I get
>> these messages :
>
> No, that is the wrong file to move.  I asked for
> /home/patrick/GNUstep/Defaults/TextEdit.plist.
>
Sorry. The file "/home/patrick/GNUstep/Defaults/TextEdit.plist" does not exist, maybe because the app never started up to save preferences there.

>> I have already gdb installed, but I could not install the *.dbg neither
>> *.dbgsym because there seem not available within Ubuntu :
>
> Well, you'll probably have to enable additional repositories for them; please
> check your usual Ubuntu documentation / support channels.  I found this wiki
> page for Ubuntu but I don't know if it's accurate:
>
> https://wiki.ubuntu.com/Debug%20Symbol%20Packages
OK. I added those repositories, dit "sudo apt-get update" then "dist-upgrade"...
And then run gdb, but it says :

> patrick@patrick-Macmini1:~$ gdb TextEdit
> (...)
> Reading symbols from TextEdit...Reading symbols from
> /usr/lib/debug/.build-id/d3/d7000fb36cd0134659949fd83b715a6bda667d.debug...done.
> done.
> (gdb) break -[NSException raise]
> Function "-[NSException raise]" not defined.
> Make breakpoint pending on future shared library load? (y or [n])
>

Bye!
Patrick


_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: TextEdit : critical error prevents loading

Yavor Doganov-3
В Mon, 09 Jul 2018 21:18:12 +0200, Patrick CARDONA написа:
> On 2018-07-09 16:04:08 +0200 Yavor Doganov <[hidden email]> wrote:
>
> Ok : dpkg -l  returns :
>> ii  textedit.app   5.0-2        i386         Text editor for GNUstep

OK, thanks.

>> No, that is the wrong file to move.  I asked for
>> /home/patrick/GNUstep/Defaults/TextEdit.plist.
>>
> Sorry. The file "/home/patrick/GNUstep/Defaults/TextEdit.plist" does not
> exist, maybe because the app never started up to save preferences there.

OK, so the problem lies elsewhere.

>> patrick@patrick-Macmini1:~$ gdb TextEdit (...)
>> Reading symbols from TextEdit...Reading symbols from
>> /usr/lib/debug/.build-id/d3/
d7000fb36cd0134659949fd83b715a6bda667d.debug...done.
>> done.
>> (gdb) break -[NSException raise]
>> Function "-[NSException raise]" not defined.
>> Make breakpoint pending on future shared library load? (y or [n])

That's all expected and indicates you have at least textedit.app-dbgsym
installed -- the file at /usr/lib/debug contains the detached debugging
symbols.  Please answer "y" to the question "Make breakpoint pending on
future shared library load?", then type "r" and when you get SIGABRT, type
"bt" at the gdb prompt and send the output.


_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: TextEdit : critical error prevents loading

Patrick
On 2018-07-09 21:24:38 +0200 Yavor Doganov <[hidden email]> wrote:

> В Mon, 09 Jul 2018 21:18:12 +0200, Patrick CARDONA написа:
>> On 2018-07-09 16:04:08 +0200 Yavor Doganov <[hidden email]> wrote:
>>
>> Ok : dpkg -l  returns :
>>> ii  textedit.app   5.0-2        i386         Text editor for GNUstep
>
> OK, thanks.
>
>>> No, that is the wrong file to move.  I asked for
>>> /home/patrick/GNUstep/Defaults/TextEdit.plist.
>>>
>> Sorry. The file "/home/patrick/GNUstep/Defaults/TextEdit.plist" does not
>> exist, maybe because the app never started up to save preferences there.
>
> OK, so the problem lies elsewhere.
>
>>> patrick@patrick-Macmini1:~$ gdb TextEdit (...)
>>> Reading symbols from TextEdit...Reading symbols from
>>> /usr/lib/debug/.build-id/d3/
> d7000fb36cd0134659949fd83b715a6bda667d.debug...done.
>>> done.
>>> (gdb) break -[NSException raise]
>>> Function "-[NSException raise]" not defined.
>>> Make breakpoint pending on future shared library load? (y or [n])
>
> That's all expected and indicates you have at least textedit.app-dbgsym
> installed -- the file at /usr/lib/debug contains the detached debugging
> symbols.  Please answer "y" to the question "Make breakpoint pending on
> future shared library load?", then type "r" and when you get SIGABRT, type
> "bt" at the gdb prompt and send the output.
>
OK. I got it and send it as an attached file.
As I can understand, it seems You were right about the printer hypothesis.

Bye!
Patrick

<gdb_output_NSException_raise.txt>


_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep

gdb_output_NSException_raise.txt (6K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: TextEdit : critical error prevents loading

Yavor Doganov-3
В Mon, 09 Jul 2018 22:14:15 +0200, Patrick CARDONA написа:

> As I can understand, it seems You were right about the printer
> hypothesis.

Yes, thank you very much.  There's a problem with parsing the PPD file.
It could be a corrupted file or a bug.  I tried one .ppd file for your
printer (Epson-XP-510_Series-epson-escpr-en.ppd) and could not
reproduce.  Probably it is not the same file you are using, so it would
be best if you just send it (in case it is not available in some official
Ubuntu package).

You can find out which file it is with gdb.  When you reach the
breakpoint, type "fr 7", then type "po ppdPath".


_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: TextEdit : critical error prevents loading

Patrick
On 2018-07-09 23:12:15 +0200 Yavor Doganov <[hidden email]> wrote:

> В Mon, 09 Jul 2018 22:14:15 +0200, Patrick CARDONA написа:
>
>> As I can understand, it seems You were right about the printer
>> hypothesis.
>
> Yes, thank you very much.  There's a problem with parsing the PPD file. It
> could be a corrupted file or a bug.  I tried one .ppd file for your printer
> (Epson-XP-510_Series-epson-escpr-en.ppd) and could not reproduce.  Probably
> it is not the same file you are using, so it would be best if you just send
> it (in case it is not available in some official Ubuntu package).
>
> You can find out which file it is with gdb.  When you reach the breakpoint,
> type "fr 7", then type "po ppdPath".
>

Sorry, I can't get now the answer : I may do something wrong...

> (gdb) break -[NSException raise]
> Function "-[NSException raise]" not defined.
> Make breakpoint pending on future shared library load? (y or [n]) y
> Breakpoint 1 (-[NSException raise]) pending.
> (gdb) fr 7
> No registers.
> (gdb) po ppdPath
> No symbol "ppdPath" in current context.
>


_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: TextEdit : critical error prevents loading

Patrick
In reply to this post by Yavor Doganov-3
On 2018-07-09 23:12:15 +0200 Yavor Doganov <[hidden email]> wrote:

> В Mon, 09 Jul 2018 22:14:15 +0200, Patrick CARDONA написа:
>
>> As I can understand, it seems You were right about the printer
>> hypothesis.
>
> Yes, thank you very much.  There's a problem with parsing the PPD file. It
> could be a corrupted file or a bug.  I tried one .ppd file for your printer
> (Epson-XP-510_Series-epson-escpr-en.ppd) and could not reproduce.  Probably
> it is not the same file you are using, so it would be best if you just send
> it (in case it is not available in some official Ubuntu package).
>
> You can find out which file it is with gdb.  When you reach the breakpoint,
> type "fr 7", then type "po ppdPath".
>
Hi Yavor,

While searching with Synaptic, I could find the path to a ppd file associated with the CUPS package :
These are the infos :

Installed :
epson-inkjet-printer-201309w
XP-510 Series - Epson Inkjet Printer Driver
Seiko Epson Corporation <[hidden email]>
Paquets RPM convertis avec Alien
And the ppdpath seems to be :
/opt/epson-inkjet-printer-201309w/ppds/Epson/Epson-XP-510_Series-epson-driver.ppd.gz

And so I put this file attached within the message.

Hope it would help.

Bye !
Patrick

<Epson-XP-510_Series-epson-driver.ppd.gz>

_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep

Epson-XP-510_Series-epson-driver.ppd.gz (54K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: TextEdit : critical error prevents loading

Yavor Doganov-3
In reply to this post by Patrick
Patrick CARDONA wrote:
> Sorry, I can't get now the answer : I may do something wrong...

Yes, you do:

> > (gdb) break -[NSException raise]
> > Function "-[NSException raise]" not defined.
> > Make breakpoint pending on future shared library load? (y or [n]) y
> > Breakpoint 1 (-[NSException raise]) pending.

Here, type "r" and when it stops, instead of typing "bt" as I asked
initially, continue with these commands:

> > (gdb) fr 7
> > (gdb) po ppdPath

But nevermind, I was able to reproduce with the .ppd file you sent.
It is valid according to cupstestppd so I believe the problem is in
the parser, namely -addPPDKeyword:withScanner:withPPDPath:.  It
assumes the value is either quoted or unquoted string, which is not
always the case.  I'm not sure the attached patch is correct but I
would appreciate if you test it.

Do you need instructions how to apply the patch and rebuild the
gnustep-gui package?

_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep

test.patch (414 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: TextEdit : critical error prevents loading

Yavor Doganov-3
Patrick CARDONA wrote:
> I am very confused, beacause I tried an update of the Epson printer
> driver in the meanwhile, just from Epson support site; and now, I am
> not able to reproduce the bug : TextEdit is running and I can show up
> printer panel and Page Layout.

This means that the updated .ppd file doesn't have the same issue like
the old one, so it is parsed and loaded successfully.

> I just notice that the margins in the summery of the Page Layout are
> very odd (attached screenshot) and when I print an example, the text
> is not placed where it should be.

This is a separate issue; I think there's a bug in the way the margins
are computed as they are also wrong for me.

> To answer your question, yes, I would appreciate to know how to apply
> the patch and will try to reproduce the bug back again to verify the
> patch.

You will need the appropriate deb-src entries in your
/etc/apt/sources.list.  Then do:

$ apt-get source gnustep-gui
$ cd gnustep-gui-*
$ cp /path/to/test.patch debian/patches
$ echo test.patch >> debian/patches/series
$ sudo apt install build-essential devscripts
$ sudo apt-get build-dep gnustep-gui
$ DEB_BUILD_OPTIONS=nocheck debuild -b -us -uc
$ sudo dpkg -i ../libgnustep-gui0.26_*.deb

Make sure you close all GNUstep applications before testing; otherwise
the library that is already loaded will be used.  Also, it goes without
saying that you should downgrade your epson driver package to the old
version containing the problematic .ppd.


_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: TextEdit : critical error prevents loading

Yavor Doganov-3
On Tue, 10 Jul 2018 15:45:25 +0300,
Yavor Doganov wrote:
> Patrick CARDONA wrote:
> > I just notice that the margins in the summery of the Page Layout are
> > very odd (attached screenshot) and when I print an example, the text
> > is not placed where it should be.
>
> This is a separate issue; I think there's a bug in the way the margins
> are computed as they are also wrong for me.

Well, this turned out to be more complicated than I thought, so I
filed a bug:

https://savannah.gnu.org/bugs/index.php?54307

Some of these problems are well known and have been discussed before.
Fred, I would appreciate if you can take a look when you have the
time.

TextEdit has hardcoded margins (72 pts) that are not exposed in the UI
and cannot be changed.  It still needs the attached minimalistic patch
to do the right thing (along with the GUI patch from the bug above).

_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep

avoid-fitpagination.patch (428 bytes) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: TextEdit : critical error prevents loading

Patrick
In reply to this post by Yavor Doganov-3
Hi Yavor and All,

On 2018-07-10 14:45:25 +0200 Yavor Doganov <[hidden email]> wrote:

> Patrick CARDONA wrote:
>> I am very confused, beacause I tried an update of the Epson printer
>> driver in the meanwhile, just from Epson support site; and now, I am
>> not able to reproduce the bug : TextEdit is running and I can show up
>> printer panel and Page Layout.
>
> This means that the updated .ppd file doesn't have the same issue like
> the old one, so it is parsed and loaded successfully.
>
>> I just notice that the margins in the summery of the Page Layout are
>> very odd (attached screenshot) and when I print an example, the text
>> is not placed where it should be.
>
> This is a separate issue; I think there's a bug in the way the margins
> are computed as they are also wrong for me.
>
>> To answer your question, yes, I would appreciate to know how to apply
>> the patch and will try to reproduce the bug back again to verify the
>> patch.
>
> You will need the appropriate deb-src entries in your
> /etc/apt/sources.list.  Then do:
>
> $ apt-get source gnustep-gui
> $ cd gnustep-gui-*
> $ cp /path/to/test.patch debian/patches
> $ echo test.patch >> debian/patches/series
> $ sudo apt install build-essential devscripts
> $ sudo apt-get build-dep gnustep-gui
> $ DEB_BUILD_OPTIONS=nocheck debuild -b -us -uc
> $ sudo dpkg -i ../libgnustep-gui0.26_*.deb
>
> Make sure you close all GNUstep applications before testing; otherwise
> the library that is already loaded will be used.  Also, it goes
> without
> saying that you should downgrade your epson driver package to the old
> version containing the problematic .ppd.
>

Well, my migration to Debian testing (buster/sid) is complete now. I
had to make a few reinstall due to a screen issue after suspend mode.
I hope this is solved now, but no matter with GNUstep apps.
And so, from this fresh install, I set up my Epson printer with cups
and I could not reproduce the bug because the cups client got
obviously a good .PPD file. So I am sorry again not to be able to
approve the patch.

Bye!
Patrick


_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep
Reply | Threaded
Open this post in threaded view
|

Re: TextEdit : critical error prevents loading

Yavor Doganov-3
On Sat, 04 Aug 2018 18:16:01 +0300,
Patrick CARDONA wrote:
> And so, from this fresh install, I set up my Epson printer with cups
> and I could not reproduce the bug because the cups client got
> obviously a good .PPD file. So I am sorry again not to be able to
> approve the patch.

No problem, Fred committed a fix for it along with fixes for the other
printing problems you reported.  I'll update the Debian package at
some point, including this and some other important ABI-compatible
changes.


_______________________________________________
Discuss-gnustep mailing list
[hidden email]
https://lists.gnu.org/mailman/listinfo/discuss-gnustep