maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Development (https://talk.maemo.org/forumdisplay.php?f=13)
-   -   "Internal error. Application 'Settings' closed." What is the error?... (https://talk.maemo.org/showthread.php?t=54850)

omeriko9 2010-06-01 21:36

"Internal error. Application 'Settings' closed." What is the error?...
 
How can I see the error?

nosa101 2010-06-01 21:43

Re: "Internal error. Application 'Settings' closed." What is the error?...
 
My Nokia?
.


EDIT: Stupid me #carryon

omeriko9 2010-06-01 21:47

Re: "Internal error. Application 'Settings' closed." What is the error?...
 
Quote:

Originally Posted by nosa101 (Post 694769)
My Nokia?
.

My code...

qwerty12 2010-06-01 21:49

Re: "Internal error. Application 'Settings' closed." What is the error?...
 
Can you pastebin the code and how you're compiling it?

omeriko9 2010-06-01 22:03

Re: "Internal error. Application 'Settings' closed." What is the error?...
 
Quote:

Originally Posted by qwerty12 (Post 694784)
Can you pastebin the code and how you're compiling it?

code: http://pastebin.com/E9eEKiB4

Compiling with Madde (unfortunatelly, I need to compile against PR1.2 libs and esbox & scratchbox are un-updatable to PR1.2 for me) with "lib_simple" template, and adding this:

Quote:

CFLAGS += `pkg-config --cflags hildon-1 libosso`
LDFLAGS += `pkg-config --libs hildon-1 libosso`
CFLAGS += `pkg-config --cflags gtk+-2.0`
LDFLAGS += `pkg-config --libs gtk+-2.0`
To the MakeFile.

qwerty12 2010-06-01 22:25

Re: "Internal error. Application 'Settings' closed." What is the error?...
 
OK, took a quick look.

In a Scratchbox with the PR 1.2 SDK installed (dunno what "lib_simple" is, nor how it works), " gcc `pkg-config --cflags hildon-control-panel hildon-1 libosso` -fPIC -c libcallnotify.c && gcc -module -avoid-version -shared -Wl,-soname,libcallnotify.so -o libcallnotify.so libcallnotify.o -lc " created a properly working library. Though, libtool would be a lot better than that.

However, it still crashed because fclose () was being called on a NULL pointer (the file didn't exist) so I moved that inside the if statement that checks for this. (As an aside, you'd probably find g_file_get_contents() easier).

omeriko9 2010-06-01 22:28

Re: "Internal error. Application 'Settings' closed." What is the error?...
 
Quote:

Originally Posted by qwerty12 (Post 694854)
OK, took a quick look.

In a Scratchbox with the PR 1.2 SDK installed (dunno what "lib_simple" is, nor how it works), " gcc `pkg-config --cflags hildon-control-panel hildon-1 libosso` -fPIC -c libcallnotify.c && gcc -module -avoid-version -shared -Wl,-soname,libcallnotify.so -o libcallnotify.so libcallnotify.o -lc " created a properly working library. Though, libtool would be a lot better than that.

However, it still crashed because fclose () was being called on a NULL pointer (the file didn't exist) so I moved that inside the if statement that checks for this. (As an aside, you'd probably find g_file_get_contents() easier).

Thank you!!

A few questions:
First, any chance you can send me the .so file so I can finally update CallNotify?
How did you manage to "catch" the fclose thingy?
What is libtool?

Thanks again!

BTW: did you manage to run this on an N900 or just in scratchbox? because it worked for me in scratchbox as well... but not on the device,

MohammadAG 2010-06-01 22:33

Re: "Internal error. Application 'Settings' closed." What is the error?...
 
A bit off topic (or not, not sure :))
I broke my scratchbox install the other day by trying to make a chroot image.
Tried to install it about 6 times which all failed till I remembered scratchbox uses a mount point
Remove all scratchbox packages installed, rm -rf /scratchbox/*, if you get symlink loops then touch /forcefsck and reboot to fsck /, then redo rm -rf /scratchbox/*.
After that reboot again and run the maemo-scrathcbox script and continue from there.

Hope that helps

qwerty12 2010-06-01 22:34

Re: "Internal error. Application 'Settings' closed." What is the error?...
 
Quote:

Originally Posted by omeriko9 (Post 694860)
Thank you!!

A few questions:
First, any chance you can send me the .so file so I can finally update CallNotify?
How did you manage to "catch" the fclose thingy?
What is libtool?

Thanks again!

No problem :)

http://www.freemoe.org/users/qwerty12/libcallnotify.so

Well, for me, I knew what it was trying to open didn't exist and the rest of your code looked legit so I could only assume that fopen had returned NULL :)

http://en.wikipedia.org/wiki/GNU_Libtool - I can't really explain it properly, but I guess it's a long and complicated script that makes libraries straight from C files. I have no idea how to invoke it on its own actually :o; I use Autotools in my **** and the macros take care of that for me...

Oh, I tested on the device

omeriko9 2010-06-02 06:31

Re: "Internal error. Application 'Settings' closed." What is the error?...
 
MohammadAG - Thanks! I'll try that.

Any idea where can I download Scratchbox for PR1.2 ?
This site doesn't give any useful links for download (or I just can't find it...).

omeriko9 2010-06-02 06:36

Re: "Internal error. Application 'Settings' closed." What is the error?...
 
Quote:

Originally Posted by qwerty12 (Post 694873)
No problem :)

http://www.freemoe.org/users/qwerty12/libcallnotify.so

Well, for me, I knew what it was trying to open didn't exist and the rest of your code looked legit so I could only assume that fopen had returned NULL :)

http://en.wikipedia.org/wiki/GNU_Libtool - I can't really explain it properly, but I guess it's a long and complicated script that makes libraries straight from C files. I have no idea how to invoke it on its own actually :o; I use Autotools in my **** and the macros take care of that for me...

Oh, I tested on the device

Unfortunately it still crashes my settings menu.
I think i once saw a way to display to terminal these errors, but I can't seem to find it...

EDIT: it crashes in more devices, see this...

omeriko9 2010-06-02 15:32

Re: "Internal error. Application 'Settings' closed." What is the error?...
 
http://wiki.maemo.org/PyMaemo/HildonDesktop

See "Debugging tips"

I wonder if there's an DEBUG_OUTPUT way for hildon-control-panel like there is for hildon-status-menu?...

qwerty12 2010-06-02 15:44

Re: "Internal error. Application 'Settings' closed." What is the error?...
 
Quote:

Originally Posted by omeriko9 (Post 695276)
Unfortunately it still crashes my settings menu.
I think i once saw a way to display to terminal these errors, but I can't seem to find it...

EDIT: it crashes in more devices, see this...

Make "char *fileContent;" "char fileContent[64];" (64's probably a little too much I guess for a file with its contents being rather small, I guess, but it works)

Try it now: http://www.freemoe.org/users/qwerty12/libcallnotify.so

MohammadAG 2010-06-02 15:53

Re: "Internal error. Application 'Settings' closed." What is the error?...
 
Full instructions with scripts to install the SDK are here http://wiki.maemo.org/Documentation/...l_Installation
Thanks to qwerty12 for bumping this thread, otherwise I wouldn't have seen your post (I would autosubscribe to all posts I reply to, but this forum has a lot of threads that turned into rants) :)

aldevil 2010-06-02 16:01

Re: "Internal error. Application 'Settings' closed." What is the error?...
 
http://img692.imageshack.us/img692/4...0052810090.png


Got a quick Screen shot of MY NOKIA..

omeriko9 2010-06-02 16:54

Re: "Internal error. Application 'Settings' closed." What is the error?...
 
Quote:

Originally Posted by qwerty12 (Post 696040)
Make "char *fileContent;" "char fileContent[64];" (64's probably a little too much I guess for a file with its contents being rather small, I guess, but it works)

Try it now: http://www.freemoe.org/users/qwerty12/libcallnotify.so

Thank you very much, it's working! I took the liberty to add it to the CallNotify update if you don't mind.
Any idea what's wrong with char pointer?..

omeriko9 2010-06-02 16:56

Re: "Internal error. Application 'Settings' closed." What is the error?...
 
Quote:

Originally Posted by MohammadAG (Post 696062)
Full instructions with scripts to install the SDK are here http://wiki.maemo.org/N900_USB_networking
Thanks to qwerty12 for bumping this thread, otherwise I wouldn't have seen your post (I would autosubscribe to all posts I reply to, but this forum has a lot of threads that turned into rants) :)

Thanks to qwerty12 is an understatement! :)

Thank you too. Are you sure that the link you provided is for the SDK? Looks like a USB networking thingy...

Joorin 2010-06-02 19:53

Re: "Internal error. Application 'Settings' closed." What is the error?...
 
Quote:

Originally Posted by omeriko9 (Post 696146)
Thank you very much, it's working! I took the liberty to add it to the CallNotify update if you don't mind.
Any idea what's wrong with char pointer?..

Changing from a pointer to instead using allocated memory usually means that you tried to use the char * without allocating memory for it.

Hence the segmentation fault.

omeriko9 2010-06-02 20:41

Re: "Internal error. Application 'Settings' closed." What is the error?...
 
Quote:

Originally Posted by Joorin (Post 696457)
Changing from a pointer to instead using allocated memory usually means that you tried to use the char * without allocating memory for it.

Hence the segmentation fault.

I see... so this is a case where I should have used "malloc" & "free"... or use an allocated memory. Right?

Joorin 2010-06-02 21:44

Re: "Internal error. Application 'Settings' closed." What is the error?...
 
Quote:

Originally Posted by omeriko9 (Post 696552)
I see... so this is a case where I should have used "malloc" & "free"... or use an allocated memory. Right?

Most likely, yes. Depending on how you get the string, you get three distinct cases:

You allocate the memory yourself using malloc. You need to use free to release it when it's no longer needed or your application will have a memory leak.

You allocate the memory on the stack, as in the fix above, and the memory will be deallocated as soon as you leave that specific stack scope/frame.

You get a pointer to statically, or otherwise, allocated memory that you should not try to deallocate when you're done with it. This is, from time to time, the most tricky case since you need to either know what to do or read the documentation carefully.

MohammadAG 2010-06-02 21:50

Re: "Internal error. Application 'Settings' closed." What is the error?...
 
My bad, someone wanted a USB networking link on the IRC channel and I guess I forgot it overwrote what was in my clipboard :P
Fixed it in the post above.


All times are GMT. The time now is 07:50.

vBulletin® Version 3.8.8