Unoffical empeg BBS

Quick Links: Empeg FAQ | RioCar.Org | Hijack | BigDisk Builder | jEmplode | emphatic
Repairs: Repairs

Page 1 of 2 1 2 >
Topic Options
#109435 - 05/08/2002 20:04 preinit v4 and launcher problems?
oliver
addict

Registered: 02/04/2002
Posts: 691
Hi, I just reinstalled preinit, with the launcher app. Haven't gotten around to installing them after beta13. After i got everything setup, with the slightly modified launcher script. I get this error durning bootup.

Starting launcher...
: No such hijack(9): memory violation at pc=0x020045a0, lr=0x02004548 (bad addre
ss=0x464c4587, code 2)
file or direcpc : [<020045a0>] lr : [<02004548>]
sp : bffffe80 ip : bffffea0 fp : bffffe9c
tory
r10: 020006c8 r9 : 00000000 r8 : 0202f010
r7 : 0203ff30 r6 : 464c457f r5 : 0203ff20 r4 : 00000010
r3 : 00001049 r2 : 00000010 r1 : 00001048 r0 : 464c457f
Flags: nZCv IRQs on FIQs on Mode USER_32 Segment user
Control: C0F8517D Table: C0F8517D DAC: 00000015
Function entered at [<02004578>] from [<02004548>]
r7 = 00000000 r6 = 020000C0 r5 = 0203FF20 r4 = 464C457F
Function entered at [<020044a0>] from [<020009c0>]
r5 = BFFFFF74 r4 = 00000001
Function entered at [<020006c8>] from [<02000b64>]
Function entered at [<02000a88>] from [<02000104>]
r10 = 00000000 r8 = 00000000 r7 = 00000000 r6 = 00000000
r5 = 00000000 r4 = 00000000

Just upgraded to the latest hijack (291) double check everything is 755, and double checked i had the directory right in the launcher script. Here is my slightly modified launcher script (just changed the dir it was looking for.)
#!/bin/sh
echo "Starting launcher..."
/usr/apps/launcher

I used the command line 'edit' program in xp to change the file. I also double checked the file with the file browser userland app included with the launcher.

If i goto /usr/apps/ and type ./launcher the program loads and runs exactly how it should.

How should i go about fixing this error?
_________________________
Oliver mk1 30gb: 129 | mk2a 30gb: 040104126

Top
#109436 - 06/08/2002 00:15 Re: preinit v4 and launcher problems? [Re: oliver]
canuckInOR
carpal tunnel

Registered: 13/02/2002
Posts: 3212
Loc: Portland, OR
Hrm... I'm getting that, as well. Does Launcher still run despite that output? In my case, it does...

I don't think it's related to launcher. As a test, I removed all my preinit scripts from the preinit.d directory (except for N01mountdrives, and N02telnetd). I rebooted the player, and got no warning messages. I added M01launcher back in, and got the error again. I took MO1launcher out, and replaced it with M02empacman (which runs /usr/local/bin/empacman). Rebooting again, I get the error.

I've tested with preinit.v3, v4, and v5 beta.

My best guess is that preinit is bulding a list of M scripts to run, and after everything gets started, tries to start a non-existant script -- a potential example of the classic "off by one" error. As a test, I added a bunch of extra preinit scripts that just have "echo starting $0" in them. It doesn't matter how many are in the directory, I only get the error after all of them have been run. Similarly, I don't get the error if there aren't any M scripts at all...

Oh, and in my testing, there is definately something very strange going on with empacman. It immediately yanks all the button bindings and display for itself. It's done that consistently whenever I try launching any other user hijack app.

Cheers,

Top
#109437 - 06/08/2002 00:32 Re: preinit v4 and launcher problems? [Re: oliver]
canuckInOR
carpal tunnel

Registered: 13/02/2002
Posts: 3212
Loc: Portland, OR
Oh, I just noticed this in your output:

Starting launcher...
: No such hijack(9): memory violation at pc=0x020045a0, lr=0x02004548 (bad addre
ss=0x464c4587, code 2)
file or direcpc : [<020045a0>] lr : [<02004548>]
sp : bffffe80 ip : bffffea0 fp : bffffe9c
tory
r10: 020006c8 r9 : 00000000 r8 : 0202f010


You might be making the same mistake I did in thinking that adding /dev/hda2 to the /etc/fstab is enough to get the partition mounted. As I was duly informed, it's not -- that file is only there to make the df program happy. So I have to ask if you have a preinit script to automatically mount /usr/apps. If you don't have a similar script already, you need an N01mountdrives script:

#!/bin/sh
echo "Mounting /usr/apps..."
mount -n -o ro /usr/apps
exit

Give that a whirl, and see if that solves your problem...

Cheers,

Top
#109438 - 06/08/2002 03:55 Re: preinit v4 and launcher problems? [Re: canuckInOR]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
So you can get this error even if the only scripts you have just echo stuff? Nuts. I guess it is my problem. I've never seen it on mine, though.

Can you give me an example of exactly what you have in your preinit.d directory?
_________________________
Bitt Faulk

Top
#109439 - 06/08/2002 09:33 Re: preinit v4 and launcher problems? [Re: wfaulk]
canuckInOR
carpal tunnel

Registered: 13/02/2002
Posts: 3212
Loc: Portland, OR
Tarball attached...

When I get rid of all the M scripts, I get rid of the error. As soon as I put one of the M scripts in, the error comes back.



Attachments
108118-preinit.d.tar.gz (38 downloads)


Top
#109440 - 06/08/2002 09:41 Re: preinit v4 and launcher problems? [Re: canuckInOR]
oliver
addict

Registered: 02/04/2002
Posts: 691
I haven't bothered formatting the 32mb dev partition yet. I just made a new directory in usr, this is how i've done it before but without the launcher. I tried that that script, even though i didn't need it before (when beta 11 was on my empeg) Just in case it might have solved my problem. But nope, still same error message.

The Launcher does not run, i have to go type ./launcher in my apps directory in order to get it to bind to the hijack menu.

EDIT: The only thing i have preinit v4 starting is the launcher. The M01launcher script is the only thing in my directory, well now i also have that mountdrive script, but i'm about to delete it because it didn't work.

Any other ideas on how to solve this problem?


Edited by oliver (06/08/2002 09:43)
_________________________
Oliver mk1 30gb: 129 | mk2a 30gb: 040104126

Top
#109441 - 06/08/2002 11:43 Re: preinit v4 and launcher problems? [Re: canuckInOR]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
So if any one of the M scripts is there, you get that error?

The first problem I see is that the launcher is in /usr/local/bin. Is that directory on a mounted filesystem?

I guess it is. You said it still ran, right?

Edit: Oh. M. Nevermind. My head's screwed on wrong. Gimme a few to test it.


Edited by wfaulk (06/08/2002 11:44)
_________________________
Bitt Faulk

Top
#109442 - 06/08/2002 20:10 Re: preinit v4 and launcher problems? [Re: oliver]
canuckInOR
carpal tunnel

Registered: 13/02/2002
Posts: 3212
Loc: Portland, OR
Wild speculation here, since I can't think of anything else...

If you edited the script in Windows, and ftp'd it to the empeg, there could be miscellaneous carriage returns in the file that are causing the preinit to barf. Make sure that when you ftp the file to the empeg, you set the mode to ascii. It should translate things appropriately. Just in case, you could get a shell on the empeg, mount the drive rw, and try this:

sh-2.03# cat > /etc/preinit.d/M01launcher
#!/bin/sh
echo Starting launcher...
/usr/apps/launcher
CTRL-D
sh-2.03#

Remount, and reboot.




Top
#109443 - 07/08/2002 08:29 Re: preinit v4 and launcher problems? [Re: canuckInOR]
oliver
addict

Registered: 02/04/2002
Posts: 691
Ok, i just typed that command, and i don't see any extra returns. I used the command line edit program to edit this file on my windows machine. Here is what i typed:

empeg:/etc/preinit.d# rw
empeg:/etc/preinit.d# cat M01launcher
#!/bin/sh
echo "Starting launcher..."
/usr/apps/launcher
empeg:/etc/preinit.d# ro

This looked good to me, anything else that might be wrong?
_________________________
Oliver mk1 30gb: 129 | mk2a 30gb: 040104126

Top
#109444 - 07/08/2002 09:04 Re: preinit v4 and launcher problems? [Re: oliver]
suomi35
enthusiast

Registered: 16/02/2002
Posts: 290
Loc: Denver, CO
I have been using the preinit script to launch things for awhile now and I recall running into a similar problem.

My hypothesis was that partitions outside of root get brought up after preinit is executed and therefore any calls it makes to apps living on other partitions won't be sucessful. I moved all the apps I wanted preinit to exec into /bin and it worked perfectly.
_________________________
-Jason

Top
#109445 - 07/08/2002 11:18 Re: preinit v4 and launcher problems? [Re: suomi35]
jheathco
enthusiast

Registered: 21/12/2001
Posts: 326
Loc: Mission Viejo, California
To bad it can't wait for a mount
_________________________
John Heathco - 30gig MKIIa w/ tuner module

Top
#109446 - 07/08/2002 12:05 Re: preinit v4 and launcher problems? [Re: canuckInOR]
oliver
addict

Registered: 02/04/2002
Posts: 691
Ok, i just found ae again. I then saw a blank line at the bottom of the screen. Deleted it. And now launcher loads at startup. But, i still get the memory errors.

kftpd: listening on port 21
player.cpp : 385:empeg-car 2.00-beta13 2002/07/24.
Starting launcher...
hijack(9): memory violation at pc=0x020045a0, lr=0x02004548 (bad address=0x464c4
587, code 2)
pc : [<020045a0>] lr : [<02004548>]
sp : bffffe80 ip : bffffea0 fp : bffffe9c
r10: 020006c8 r9 : 00000000 r8 : 0202f010
r7 : 0203ff30 r6 : 464c457f r5 : 0203ff20 r4 : 00000010
r3 : 00001049 r2 : 00000010 r1 : 00001048 r0 : 464c457f
Flags: nZCv IRQs on FIQs on Mode USER_32 Segment user
Control: C0F8517D Table: C0F8517D DAC: 00000015
Function entered at [<02004578>] from [<02004548>]
r7 = 00000000 r6 = 020000C0 r5 = 0203FF20 r4 = 464C457F
Function entered at [<020044a0>] from [<020009c0>]
r5 = BFFFFF74 r4 = 00000001
Function entered at [<020006c8>] from [<02000b64>]
Function entered at [<02000a88>] from [<02000104>]
r10 = 00000000 r8 = 00000000 r7 = 00000000 r6 = 00000000
r5 = 00000000 r4 = 00000000
Prolux 4 empeg car - 2.1434 Jul 24 2002
Vcb: 0x4086d000

I had a hell of a time finding out how to save the file in ae. The only thing i could find was ctrl+x ctrl+c, but after guessing key strokes, i found ctrl+x+w would save the file.

So now i guess i'm in the same boat as you are, with these errors, but launcher still working.
_________________________
Oliver mk1 30gb: 129 | mk2a 30gb: 040104126

Top
#109447 - 07/08/2002 16:52 Re: preinit v4 and launcher problems? [Re: oliver]
oliver
addict

Registered: 02/04/2002
Posts: 691
ok, after getting everything working on my deck today. I tarred up everything (preinit v4, apps, preinit.d scripts) to make a backup for the next time i run an .upgrade. I also did this to easily put these files on the 6 or 8 decks that i keep up. After un-tarring the files, and rebooting. I noticed that the second player everything works, but it doesn't give the memory violation error. Could this mean that my player has bad ram? I don't understand why this would happen on some players and not all? Thanks in advance!
_________________________
Oliver mk1 30gb: 129 | mk2a 30gb: 040104126

Top
#109448 - 07/08/2002 21:32 Re: preinit v4 and launcher problems? [Re: oliver]
genixia
Carpal Tunnel

Registered: 08/02/2002
Posts: 3411
Do you have reservecache set in config.ini?
_________________________
Mk2a 60GB Blue. Serial 030102962 sig.mp3: File Format not Valid.

Top
#109449 - 07/08/2002 22:21 Re: preinit v4 and launcher problems? [Re: genixia]
oliver
addict

Registered: 02/04/2002
Posts: 691
I don't see it set in my config.ini
Here is my config file
[tuner]

region=us
[controls]
stalk_side=none
[hush]
hushpercent=50
[display]
visual_names=1
caching=0
[volumecap]
enabled=1
[kenwood]
disabled=0
[ramp]
disabled=0
[menu]
quit=0
sort_playlist=1
[Options]
Name=UzI-O
[User Info]
[email protected]
Phone=555-555-5555
Name=Oliver Hine
[Network]
Gateway=0.0.0.0
Netmask=0.0.0.0
IPAddress=0.0.0.0
DHCP=1
[sense]
muteaction=0
mute=-1
[power]
off_timeout=20000
[aux]
source=
title=
artist=
[synchronise]
seq_num=58
[wendy]
flag_amount=0
[custom]
wendy=
[searches]
amount=0
[VisualFavourites_AM]
count=0
[VisualFavourites_AUX]
count=0
[VisualFavourites_DSP]
count=0
[VisualFavourites_FM]
count=0
[launcher]
approot=/usr/apps/
item=Games.Pacman,empacman
item=Games.Sokoban,empsoko,l
item=Games.Tetris,emptris
item=Games.Emptriv,/usr/scripts/startEmptriv
item=Utils.File Viewer,viewer
item=Utils.telnetd.Start,/etc/preinit.d/N02telnetd,start
item=Utils.telnetd.Stop,/etc/preinit.d/N02telnetd,stop
item=Utils.telnetd.Restart,/etc/preinit.d/N02telnetd,restart
_________________________
Oliver mk1 30gb: 129 | mk2a 30gb: 040104126

Top
#109450 - 08/08/2002 05:27 Re: preinit v4 and launcher problems? [Re: oliver]
genixia
Carpal Tunnel

Registered: 08/02/2002
Posts: 3411
Try adding the following and see if you still get the memory errors:

[Startup]
reservecache=2
_________________________
Mk2a 60GB Blue. Serial 030102962 sig.mp3: File Format not Valid.

Top
#109451 - 08/08/2002 11:41 Re: preinit v4 and launcher problems? [Re: genixia]
oliver
addict

Registered: 02/04/2002
Posts: 691
Hi Genixia,
I added that line at the top of my ini, and it, i guess, fixed the problem with the memory errors. My next questions is
What exactly did this reservecache=2 change on my player?

And if all of our empegs are pretty much the same, why would only a few people see this problem, and most people don't?

Thanks for your help.


Edited by oliver (08/08/2002 11:42)
_________________________
Oliver mk1 30gb: 129 | mk2a 30gb: 040104126

Top
#109452 - 08/08/2002 12:27 Re: preinit v4 and launcher problems? [Re: oliver]
genixia
Carpal Tunnel

Registered: 08/02/2002
Posts: 3411
As I understand it, It tells the player how much of the available RAM to *not* grab for itself, By default, the player allocates as much memory as it can for buffering music.
_________________________
Mk2a 60GB Blue. Serial 030102962 sig.mp3: File Format not Valid.

Top
#109453 - 24/09/2002 15:07 Re: preinit v4 and launcher problems? [Re: wfaulk]
Warp10
member

Registered: 18/02/2002
Posts: 179
Loc: Germany
I've got the same problem canuckInLA described: The memory violation only appears if there are scripts in the preinit.d folder. Anything new about this? Should I ignore the violation?

Cheers,
Thorsten
_________________________
---------------------------- MK1: 00314 (4GB) MK2a: 030103104 (30GB) Installed in a BMW 323ti

Top
#109454 - 24/09/2002 20:00 Re: preinit v4 and launcher problems? [Re: Warp10]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Honestly, I'm at a loss here. I can't imagine why the program would core dump. Maybe it's my compiler. Anyone else want to try compiling it? The source code's available.
_________________________
Bitt Faulk

Top
#109455 - 25/09/2002 08:13 Re: preinit v4 and launcher problems? [Re: wfaulk]
jaharkes
enthusiast

Registered: 20/08/2002
Posts: 340
Loc: Pittsburgh, PA
I've not compiled it yet, but I noticed that you are passing /bin/sh %s to system(3). But system itself is already a wrapper around exec that adds /bin/sh -c

So you end up forking off, execing a shell that runs a shell, that possibly runs a shell as well (because of the missing -c?), that runs the script. At least as far I can tell you at least want to drop the /bin/sh there and preferable switch to using

execv("/bin/sh", {"/bin/sh", "-c", "/etc/preinit.d/%s", NULL});
_________________________
40GB - serial #40104051 gpsapp

Top
#109456 - 25/09/2002 08:23 Re: preinit v4 and launcher problems? [Re: jaharkes]
jaharkes
enthusiast

Registered: 20/08/2002
Posts: 340
Loc: Pittsburgh, PA
Ohh, it might even be simpler than that. Just ran it through valgrind, this is without any /etc/preinit.d scripts (and ofcourse not on the player itself).

==13932== Invalid write of size 4
==13932== at 0x8048D39: main (empeg-preinit.c:226)
==13932== by 0x4025D0BF: (within /lib/libc-2.2.5.so)
==13932== by 0x80486F1: alarm:GLIBC_2.0 (in /home/jaharkes/empeg/gps/empeg-preinit.v4/empeg-preinit.test)
==13932== Address 0x42AE2060 is 0 bytes after a block of size 4 alloc'd
==13932== at 0x4004328B: malloc (vg_clientfuncs.c:100)
==13932== by 0x8048CFD: main (empeg-preinit.c:216)
==13932== by 0x4025D0BF: (within /lib/libc-2.2.5.so)

which points at this

empeg-preinit.c:216
- mounttime = malloc(sizeof(struct filelist *));
+ mounttime = malloc(sizeof(struct filelist));
_________________________
40GB - serial #40104051 gpsapp

Top
#109457 - 25/09/2002 08:36 Re: preinit v4 and launcher problems? [Re: jaharkes]
peter
carpal tunnel

Registered: 13/07/2000
Posts: 4180
Loc: Cambridge, England
Just ran it through valgrind

Valgrind rules.

Peter

Top
#109458 - 25/09/2002 09:14 Re: preinit v4 and launcher problems? [Re: jaharkes]
jaharkes
enthusiast

Registered: 20/08/2002
Posts: 340
Loc: Pittsburgh, PA
Ok, this time I ran it with an /etc/preinit.d directory and a couple of scripts. Found some double free's and some issues in the part where system() is called, some error paths could either leak or double free. With the deep nesting this code is quite hard to follow.

Patch against preinit.v3 is attached.


Attachments
116227-patch (148 downloads)

_________________________
40GB - serial #40104051 gpsapp

Top
#109459 - 25/09/2002 10:34 Re: preinit v4 and launcher problems? [Re: jaharkes]
wfaulk
carpal tunnel

Registered: 25/12/2000
Posts: 16706
Loc: Raleigh, NC US
Ooh! There you have it. I've been outed as a bad programmer.

Seriously, though, I thought I'd triple-checked all that stuff. I'll go back and do it again. Didn't know about valgrind. I'll have to check it out.

And no more cracks about my indentation style.
_________________________
Bitt Faulk

Top
#109460 - 25/09/2002 10:57 Re: preinit v4 and launcher problems? [Re: wfaulk]
jaharkes
enthusiast

Registered: 20/08/2002
Posts: 340
Loc: Pittsburgh, PA
It wasn't me, it was all valgrind's fault. btw. Looking at the stuff I replaced around the call to system, the old code did the alloc/free right, so the segfaults must have come from either the bad malloc or one of the double free's.

And as far as indentation is concerned, at least you're not following the fsf coding style and as an additional ++ you are using vi
_________________________
40GB - serial #40104051 gpsapp

Top
#109461 - 27/09/2002 08:15 Re: preinit v4 and launcher problems? [Re: jaharkes]
Warp10
member

Registered: 18/02/2002
Posts: 179
Loc: Germany
Has anyone tested if the patch fixed the memory vioaltion errors?

Uuh, that was post # 12000 plus ONE in the programming forum... and... I'm now a 'journeyman' -yeah!


Edited by Warp10 (27/09/2002 08:18)
_________________________
---------------------------- MK1: 00314 (4GB) MK2a: 030103104 (30GB) Installed in a BMW 323ti

Top
#109462 - 27/09/2002 12:25 Re: preinit v4 and launcher problems? [Re: Warp10]
Daria
carpal tunnel

Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
Has anyone tested if the patch fixed the memory vioaltion errors?

yup

Top
#109463 - 27/09/2002 17:14 Re: preinit v4 and launcher problems? [Re: Daria]
Warp10
member

Registered: 18/02/2002
Posts: 179
Loc: Germany
Mmhhh ;-))) would you .... please.... attach a compiled version with the patch? I'm an absolute beginner concerning compiling...
_________________________
---------------------------- MK1: 00314 (4GB) MK2a: 030103104 (30GB) Installed in a BMW 323ti

Top
#109464 - 27/09/2002 17:34 Re: preinit v4 and launcher problems? [Re: Warp10]
Daria
carpal tunnel

Registered: 24/01/2002
Posts: 3937
Loc: Providence, RI
Enjoy.

Top
Page 1 of 2 1 2 >