09-07-2013, 08:08 AM | #16 | |
Connoisseur
Posts: 97
Karma: 90350
Join Date: Aug 2013
Location: Berlin, Germany
Device: PB 622, PB 623
|
Quote:
Are you sure about the segfault? All the program should do when it can't open the PTY is call CloseApp() and die. Well, I'll go through all the destructors to check if there's anything that could be responsible.. Best regards, Jens |
|
09-07-2013, 01:11 PM | #17 |
Wizard
Posts: 3,016
Karma: 18765431
Join Date: Oct 2010
Location: Sudbury, ON, Canada
Device: PRS-505, PB 902, PRS-T1, PB 623, PB 840, PB 633
|
Well, it segfaults if I run it from a utelnetd session or from poterm.app itself. Then I can see what gets printed out. I don't actually know that it crashes in the same place when run from the Application tab. Anyway, here's what I can see when it runs in either of the command-lines above:
bash-4.1$ ./pbterm.app Atached mp shm: id 0 addr 404ed000 size 17260 Atached mqueue: id 8001 attach_shm: mtfb key=251331154 size=1028432 Atached mtfb shm: id 58006 addr 404f6000 size 1028432 ndepth:2 hqdepth:4 attach_shm: ref key=2130378752 size=993600 Atached ref shm: id 8001 addr 405f2000 size 993600 allocated 500912 bytes for ecmd Segmentation fault P.S. I tried to get gdb working on the PB device, but it relies on ncurses to handle the inputs, and that doesn't seem to work inside the utelnetd session unfortunately. Maybe I'll see if gdbserver can get around this somehow. |
Advert | |
|
09-07-2013, 04:23 PM | #18 |
Wizard
Posts: 3,016
Karma: 18765431
Join Date: Oct 2010
Location: Sudbury, ON, Canada
Device: PRS-505, PB 902, PRS-T1, PB 623, PB 840, PB 633
|
I managed to get pbterm.app to run via gdbserver. The segfault occurs in Term::get_shell_output(). I'll need a debugging version of pbterm.app to know more than that.
|
09-08-2013, 08:52 AM | #19 | |
Connoisseur
Posts: 97
Karma: 90350
Join Date: Aug 2013
Location: Berlin, Germany
Device: PB 622, PB 623
|
Quote:
http://users.physik.fu-berlin.de/~jt...1-debug.tar.gz It contains the application, compiled with "-O0 -g3". Please let me know if you need it compiled in some other way or additional information. Once I got my WLAN stuff running (but I fear that will have to wait until a new firmware version is out) I'll sk you for help with the reprroducing the setup you've got there (telnet/gdbserver) - that sounds great! Best regards, Jens |
|
09-08-2013, 05:18 PM | #20 |
Wizard
Posts: 3,016
Karma: 18765431
Join Date: Oct 2010
Location: Sudbury, ON, Canada
Device: PRS-505, PB 902, PRS-T1, PB 623, PB 840, PB 633
|
It's hard to tell with the remote debugging, but it looks like the segfault occurs during the read() because m_pty_fd = -1. I think the function should probably check the file descriptor value first, but in the end, without the pty working properly, nothing correct is ever going to happen anyway, so maybe getting a segfault at that point isn't any worse than just failing gracefully.
|
Advert | |
|
09-08-2013, 06:19 PM | #21 | |
Connoisseur
Posts: 97
Karma: 90350
Join Date: Aug 2013
Location: Berlin, Germany
Device: PB 622, PB 623
|
Quote:
But then I'm also surprised that you get to the get_shell_output() function if 'm_pty_fd' is negative - that's checked when the PTY is opened and on failure (or other problems) CloseApp() is called. Looks like my assumption that, like exit(), it would terminate the program immmediately, is wrong. I'll put something in that avoids this situation. Thanks for making me aware of this possibility! Best regards, Jens PS: The modified version is now available for download. Last edited by jtt; 09-08-2013 at 06:30 PM. |
|
09-08-2013, 07:03 PM | #22 |
Wizard
Posts: 3,016
Karma: 18765431
Join Date: Oct 2010
Location: Sudbury, ON, Canada
Device: PRS-505, PB 902, PRS-T1, PB 623, PB 840, PB 633
|
I'm not 100% sure that when I call 'step' within gdb in the remote system that it takes just one step. I'm new to remote debugging, so maybe it's not behaving as I expect.
Anyway, the new pbterm-1.3 version still segfaults, so perhaps it is occurring somewhere else than in the read() function call. I'm not sure it's really worth pursuing, since without the pty working, the program will not work anyway. I'll write up some notes on using gdbserver later and put them in a new thread in this PB/Developer section. That way, you and others can try it if you like. |
09-08-2013, 07:18 PM | #23 | ||
Connoisseur
Posts: 97
Karma: 90350
Join Date: Aug 2013
Location: Berlin, Germany
Device: PB 622, PB 623
|
Quote:
Quote:
Best regards, Jens |
||
09-08-2013, 08:08 PM | #24 |
Connoisseur
Posts: 97
Karma: 90350
Join Date: Aug 2013
Location: Berlin, Germany
Device: PB 622, PB 623
|
Hi rkomar,
I just tried to reproduce the SIGSEGV on my machine by setting 'm_pty_fd' to -1 (instead of opening the master side of the PTY), but had no luck in catching any signals as a result, the program seems to exit just normally and as expected. So, at the moment I'm out of ideas what else to try - perhaps the software on your device is too different from that on mine:-( Best regards, Jens |
09-10-2013, 02:32 PM | #25 |
Connoisseur
Posts: 97
Karma: 90350
Join Date: Aug 2013
Location: Berlin, Germany
Device: PB 622, PB 623
|
New version 1.4
Hi,
a new version is available (see links in my first post). Beside internal code reorganization the following things have changed in the interface: a) The program now comes with an (english) keyboard layout file that adds the missing '|' key. Use of the layout is optional and any other can be used (e.g. by setting your favourite layout in the configuration file). b) A tap on the lower left hand corner of the screen (about a quarter of the screens width and height) brings up the on-screen menu, seems more convenient to me than using a long tap. c) Also the "Ctrl-D" control character can now be send (to end a program that waits for further input). Use with care since, if send to the shell (instead of to a program started via the shell), the shell itself exits an thus the whole program. Best regards, Jens |
09-15-2013, 04:29 PM | #26 |
Zealot
Posts: 117
Karma: 37584
Join Date: Nov 2012
Location: Milan / Italy
Device: pocketbook touch 622
|
hi jtt
i used version 1.4. with the 4.2 firmware you must use pbterm.kbd, otherways you can't type more than 4 characters in the command window. comment or not pbterm.cfg file doesn''t change the behaviour thanks |
09-15-2013, 07:09 PM | #27 | |
Connoisseur
Posts: 97
Karma: 90350
Join Date: Aug 2013
Location: Berlin, Germany
Device: PB 622, PB 623
|
Quote:
Best regards, Jens |
|
09-17-2013, 07:27 AM | #28 |
Connoisseur
Posts: 97
Karma: 90350
Join Date: Aug 2013
Location: Berlin, Germany
Device: PB 622, PB 623
|
Version 1.5 available
Hi,
there's a new version that now uses a set of pipes for communication with the shell as a fallback for the case that a pseudoterminal can't be used due to permission issues. In that case the shell can't do job control and sending it control characters is disabled since the shell doesn't recognize them. Best regards, Jens |
09-17-2013, 10:05 AM | #29 | |
Zealot
Posts: 117
Karma: 37584
Join Date: Nov 2012
Location: Milan / Italy
Device: pocketbook touch 622
|
Quote:
The only 'uncomfortable' things is that if I want to use other keyboards I've to move the pbterm.kbd away and then move it back once i did with those layouts. To comment pbterm.cfg still has no effect May be you can add the preference to the pop-up dialog with history & ctrl keys? thanks Paolo Last edited by paolog; 09-17-2013 at 12:29 PM. |
|
09-17-2013, 03:15 PM | #30 | |
Connoisseur
Posts: 97
Karma: 90350
Join Date: Aug 2013
Location: Berlin, Germany
Device: PB 622, PB 623
|
And here's version 1.6
Hi Paolo,
Quote:
You can now also disable the use of the custom keyboard completely by putting nothing on the right side of the colon in "keyboard_file" entry in the confguration file. In an ideal world I would have prefered to be able to switch from the custom keyboard to the default keyboard(s) from within the on-screen keyboard. Unformtunately, the "language button" doesn't seem to work in custom keyboard layouts:-( Best regards, Jens |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Terminal-Programm für PB622 und 623 | jtt | PocketBook | 9 | 09-15-2013 12:56 PM |
New user questions PB622 | muntesco | PocketBook | 2 | 02-02-2013 09:29 AM |
Zeiteinstellungen PB622 | fr3d | PocketBook | 5 | 07-11-2012 02:00 PM |
wlan mit pb622 | sebigbos | PocketBook | 13 | 07-11-2012 10:03 AM |
Tastatursperre PB622 | fr3d | PocketBook | 1 | 07-03-2012 04:20 AM |