Re: Trapping application "crashes"?

2007-09-04 Thread Eero Tamminen
Hi,

ext Jayesh Salvi wrote:
> If you can modify application's code (at least the main() entry point) you
> can register signal handlers for SIGSEGV, SIGABRT (most common causes of
> program crashes) etc. Do "man signal" for more info. If the program is in
> other languages then there should be corresponding ways to register these
> signal handlers.
> 
> If you don't have access to source code then only way that I can suggest is
> running from debugger.
> 
> If you end up registering your signal handlers - do only little in those
> signal handlers. It's not a good idea to keep executing once you have
> corrupted memory - you might run into more ugly errors.

In general trapping FATAL signals causes more troubles than it's worth.

On ARM you cannot get working backtraces (unless you compile all code on
the target with -fno-omit-frame-pointer), so it's pretty pointless to
catch SIGSEGV & SIGABRT.  At worst you make it impossible to find the
real problem.

E.g. if C-library aborts your program due to memory corruption, no
function requiring memory allocation, such as backtrace(), printf() etc
works properly, they crash instead (maybe causing recursion and
eventually really "fun to debug" backtrace in the core dump).


- Eero
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Trapping application "crashes"?

2007-09-04 Thread Daniel Stone
On Tue, Sep 04, 2007 at 11:01:40PM -0700, ext Jayesh Salvi wrote:
> If you end up registering your signal handlers - do only little in those
> signal handlers. It's not a good idea to keep executing once you have
> corrupted memory - you might run into more ugly errors.

Indeed, man signal (at least from glibc) explicitly lists the only calls
that are safe to run from signal handlers.

Cheers,
Daniel


signature.asc
Description: Digital signature
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Trapping application "crashes"?

2007-09-04 Thread Jayesh Salvi
If you can modify application's code (at least the main() entry point) you
can register signal handlers for SIGSEGV, SIGABRT (most common causes of
program crashes) etc. Do "man signal" for more info. If the program is in
other languages then there should be corresponding ways to register these
signal handlers.

If you don't have access to source code then only way that I can suggest is
running from debugger.

If you end up registering your signal handlers - do only little in those
signal handlers. It's not a good idea to keep executing once you have
corrupted memory - you might run into more ugly errors.

HTH
Jayesh

On 9/4/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
> Is it possible for an application to trap abnormal termination? In other
> words, can a callback be registered that will be invoked when the
> application is about to be shut down because of an error that the
> application itself has caused (e.g. memory allocation errors or other
> problems that would cause the OS to terminate the application).
>
>
> David Hazel
> ___
> maemo-developers mailing list
> maemo-developers@maemo.org
> https://lists.maemo.org/mailman/listinfo/maemo-developers
>
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: mpd

2007-09-04 Thread Austin Che
Jeffrey Barish <[EMAIL PROTECTED]> wrote:

> I find that uncommenting any of the audio output sections seems to do the
> trick.  I have the ALSA section uncommented now.

But you weren't actually able to play anything right? I got a
segfault during the playing of a file with alsa, not on the
startup. Running mpd manually and then starting it playing, I see:

decoder PID: 1895
decoder (or child) got SIGTERM
copyMpdTagToOB: !acceptMetadata || !tag
main process got SIGCHLD
SIGCHLD caused by player process
player process died from signal: 11

So I'd be interested to know if you can actually get it to output
sound via alsa (assuming you get it to index files below).

> mpd is running now (according to ps), but I still can't get it to index any
> sound files.  I stuck a symbolic link in /var/lib/mpd/music to the
> directory containing my soundfiles (ogg).  I run mpd --create-db.  The only
> output I get is:
>
> current locale is "C"
> setting filesystem charset to ISO-8859-1

How did you get this output? Did you try running mpd manually
with:
mpd --no-daemon --stdout --verbose --create-db

> The files in /var/log/mpd are empty.  Everything is owned by user mpd and
> mpd has permission to read and write.  I must have missed an important
> step.  Any idea?

Are you sure that mpd has permission to read the directory
containing your soundfiles? I'd try just copying over a file or
two to /var/lib/mpd/music to test. I also haven't tested with ogg
files so try copying over a mp3 file also to test.

Also, as you manually ran adduser, you may have also missed out on
some step in the installation script. Perhaps you could try
installing the adduser package and reinstalling the package.
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: mpd

2007-09-04 Thread Jeffrey Barish
Austin Che wrote:

> Creating the mpd user manually should let you run it. I would edit
> /etc/mpd.conf and uncomment the libao section. I was getting
> segfaults with alsa output while ao output worked fine.

I find that uncommenting any of the audio output sections seems to do the
trick.  I have the ALSA section uncommented now.

mpd is running now (according to ps), but I still can't get it to index any
sound files.  I stuck a symbolic link in /var/lib/mpd/music to the
directory containing my soundfiles (ogg).  I run mpd --create-db.  The only
output I get is:

current locale is "C"
setting filesystem charset to ISO-8859-1

The files in /var/log/mpd are empty.  Everything is owned by user mpd and
mpd has permission to read and write.  I must have missed an important
step.  Any idea?
-- 
Jeffrey Barish

___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: N800 audio connector jack

2007-09-04 Thread Gopi Flaherty

On Sep 4, 2007, at 7:24 PM, Jami Pekkanen wrote:
> Is it possible that something special is required in the input
> connection? There at least seems to be some resistors in the headset's
> circuit, but I assumed they are just for the push-button. Also does
> anybody have a pinout for the jack?

I've worked with some systems that sensed the input impedance. You  
may want to try putting a small resistor in there. I believe that one  
of the iPaqs even tried to work as mono out/ mono in or stereo out on  
three pins, depending on the impedance of the output.

Perhaps measuring the impedance of the headset first, then putting  
resistors on to your device, and then taking them off one by one to  
see which was necessary would work?



___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: N800 audio connector jack

2007-09-04 Thread Erik Hovland
On Wed, Sep 05, 2007 at 02:24:52AM +0300, Jami Pekkanen wrote:
> Hello,
> 
> This isn't exactly maemo specific question, but I think this is the best 
> forum anyway.
> 
> I'm trying to solder together an adapter that splits the N800's 4-pole 
> audio plug to two separate 3.5 mm females so that I can plug in separate 
> input and output devices, eg electric guitar input and amplifier output 
> (with maemo doing effects in between).
> 
> So I took apart the headset that comes with the device and got the 
> output part working fine, but I don't seem to get any signal to the 
> input. In fact the device even doesn't switch the internal microphone 
> off when I plug the modified system in.
> 
> I'm assuming that there's two grounds (golden wires, another without 
> coating), left output on a red wire, right output on green and input on 
> white. The guesses were right for output, but as I said, the input 
> doesn't get any signal at all.
> 
> Is it possible that something special is required in the input 
> connection? There at least seems to be some resistors in the headset's 
> circuit, but I assumed they are just for the push-button. Also does 
> anybody have a pinout for the jack?

I know of a pinout for a very similar device:
http://web.it.kth.se/~maguire/iPAQ-photos/iPAQ-audio-adapter.html

E

-- 
Erik Hovland
mail: [EMAIL PROTECTED]
web: http://hovland.org/
PGP/GPG public key available on request

___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


N800 audio connector jack

2007-09-04 Thread Jami Pekkanen
Hello,

This isn't exactly maemo specific question, but I think this is the best 
forum anyway.

I'm trying to solder together an adapter that splits the N800's 4-pole 
audio plug to two separate 3.5 mm females so that I can plug in separate 
input and output devices, eg electric guitar input and amplifier output 
(with maemo doing effects in between).

So I took apart the headset that comes with the device and got the 
output part working fine, but I don't seem to get any signal to the 
input. In fact the device even doesn't switch the internal microphone 
off when I plug the modified system in.

I'm assuming that there's two grounds (golden wires, another without 
coating), left output on a red wire, right output on green and input on 
white. The guesses were right for output, but as I said, the input 
doesn't get any signal at all.

Is it possible that something special is required in the input 
connection? There at least seems to be some resistors in the headset's 
circuit, but I assumed they are just for the push-button. Also does 
anybody have a pinout for the jack?

- Jami
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: mpd

2007-09-04 Thread Austin Che

>> So I went ahead and ported mpd and mpg321 to maemo. In
>> case anyone else wants these packages as I couldn't find them
>> already out there: http://austin.mit.edu/maemo
>
> chage: can't open shadow password fileStopped: `/usr/bin/chage -M 9 mpd'
> returned error code 1. Exiting.

I don't know where that is coming from as I don't think any of the
mpd scripts calls chage. It does use adduser so that should be
added to the dependency list.

> I tried creating the mpd user by running adduser manually, but then I get
> segmentation fault whenever I run mpd.

Creating the mpd user manually should let you run it. I would edit
/etc/mpd.conf and uncomment the libao section. I was getting
segfaults with alsa output while ao output worked fine.
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Python and GStreamer

2007-09-04 Thread Jeffrey Barish
Austin Che wrote:

> So I went ahead and ported mpd and mpg321 to maemo. In
> case anyone else wants these packages as I couldn't find them
> already out there: http://austin.mit.edu/maemo

I'm having trouble installing mpd.  I installed all the packages that mpd
requires.  When I try to install mpd, I get:

/media/mmc1 # dpkg -i mpd_0.13.0-1_armel.deb
Selecting previously deselected package mpd.
(Reading database ... 15122 files and directories currently installed.)
Unpacking mpd (from mpd_0.13.0-1_armel.deb) ...
Setting up mpd (0.13.0-1) ...
chage: can't open shadow password fileStopped: `/usr/bin/chage -M 9 mpd'
returned error code 1. Exiting.

Removing user `mpd' ...
dpkg: error processing mpd (--install):
 subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
 mpd


I tried shadowconfig on, but then I get "bash: not found".  Installing bash
would change everything.

I tried creating the mpd user by running adduser manually, but then I get
segmentation fault whenever I run mpd.

Hints?
-- 
Jeffrey Barish

___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


sbox2 mapping mode rework

2007-09-04 Thread Lauri Leukkunen
Hi,

I changed sbox2 default mapping style so that it by default uses files
from the host and only maps the bare minimum to target buildroot. This
simplified the rules dramatically and I think it means that most tools
will "just work" and only special cases like apt, dpkg, gcc and qemu
need special treatment. I did a quick test and managed to build debian
packages pretty well, there's maybe a little glitch somewhere with
respect to fakeroot and qemu and LD_PRELOAD passing, but overall
things look pretty damn good considering that now the whole set of
rules is just 54 lines long.

I also disabled the mapping cache by default, it was causing some
trouble and the new rule set is so small that I don't think any cache
is needed.

This stuff is currently in the git repository so pull from there to
give it a shot.

/lauri
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Treeview multiple selection mode

2007-09-04 Thread Jeffrey Barish
Jeffrey Barish wrote:

> I just got multiple selection to work in a test application using PyGTK,
> so something is wrong in my application.

Although I have multiple selection working in a test program, I still have
not been able to get it to work in my application.  Only the first item
that I touch gets selected.  I am now capturing button-press-event and
button-release-event, so I can see the press when I contact the first row
and the release after I sweep out a region, but none of the other rows get
selected.  I have confirmed that the mode is SELECTION_MULTIPLE when I
receive the first selection event.  I disabled the handler for the tree
selection changed signal, so the problem cannot be in my handler.  I can't
think what else to try.  Any suggestions?
-- 
Jeffrey Barish

___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Network connection with hildon-app-mgr in the scratchbox

2007-09-04 Thread Mario Sánchez Prada
Marius Vollmer escribió:
> ext Mario Sánchez Prada <[EMAIL PROTECTED]> writes:
> 
>> ...and compiling hildon-application-manager without problem I can
>> perfectly run it but I can't get network connection so I'm not able
>> to install anything from the repositories using this program.
> 
> Please try the 'assume-connection' setting, available in red-pill mode
> in the "Tools > Settings" dialog.  The AM is trying to get a
> network connection up, but that doesn't work in Scratchbox.
> 
Thanks for your suggestion, but IMHO that doesn't fix the real problem
behind the scenes... I mean, why some applications (such as the
osso-xterm) can use a network connection inside the scratchbox while
hildon-app-mgr can't?

That's what really looks strange to me, and I didn't found a solution
yet, I just have to install applications from the commandline but I
still think that there should be a way to "fix" that, and I'd like to
find it.

Regards

Mario
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Trapping application "crashes"?

2007-09-04 Thread david . hazel
Is it possible for an application to trap abnormal termination? In other words, 
can a callback be registered that will be invoked when the application is about 
to be shut down because of an error that the application itself has caused 
(e.g. memory allocation errors or other problems that would cause the OS to 
terminate the application).


David Hazel
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Re: Network connection with hildon-app-mgr in the scratchbox

2007-09-04 Thread Marius Vollmer
ext Mario Sánchez Prada <[EMAIL PROTECTED]> writes:

> ...and compiling hildon-application-manager without problem I can
> perfectly run it but I can't get network connection so I'm not able
> to install anything from the repositories using this program.

Please try the 'assume-connection' setting, available in red-pill mode
in the "Tools > Settings" dialog.  The AM is trying to get a
network connection up, but that doesn't work in Scratchbox.
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers


Network connection with hildon-app-mgr in the scratchbox

2007-09-04 Thread Mario Sánchez Prada
Hi,

After installing all this stuff:
  - Scratchbox Apophis r4 [1]
  - Maemo 4.0 Chinook alpha SDK   [2]
  - Hildon application manager (SVN)  [3]

...and compiling hildon-application-manager without problem I can
perfectly run it but I can't get network connection so I'm not able to
install anything from the repositories using this program.

I know I can install all what I want from the scratchbox command line
with 'apt-get' as usual, but the fact is that I'd like to know why this
strange behavior occurs with the application manager, since it's
something which doesn't happen with other installed programs from the
emu, such as the osso-xterm (I can do an 'wget URL' without problems
using this app).

I've tried to look into the code to see if I can find what it's going
wrong there but all I got is a problem resolving the name of the
repositories in the apt client utility built-in with the
hildon-application-manager... but I don't know why it happens either.

Any idea?

Thanks in advance

Mario

--
[1] http://scratchbox.org/download/scratchbox-apophis
[2] http://maemo.org/development/sdks/maemo_4-0_chinook_alpha_sdk.html
[3] svn checkout https://garage.maemo.org/svn/hildon-app-mgr
___
maemo-developers mailing list
maemo-developers@maemo.org
https://lists.maemo.org/mailman/listinfo/maemo-developers