W0rmSp17
Posts: 13
Joined: Tue Mar 03, 2015 2:20 pm

Raspberry Pi Scratch: Segmentation fault

Tue Mar 03, 2015 2:32 pm

Hello, I'm fairly new Pi user. I've been working on this RFID project using scratch. However, Once attempting to run 'Scratch' I noticed the tool failed to run. I thought it was usage problems... So once closing down some processes, I ran it again with the same failure. Once that failed I rebooted my Pi and attempted again. The tool sometimes opens but quickly crashes, other times it doesn't open at all. When attempting to open it via Terminal it gave me a "segmentation fault". So I 'apt-get' all upgrades and updates (dist-upgrade, rpi-update, update...) and still i'm experiencing the same error. Except this time the error is a little different; it now displays "-1676252484 SmallInteger>?, Segmentation Fault"

pl0x help

ERROR copy n paste below

Thank you

Executing: /usr/lib/squeak/4.10.2-2793/squeakvm -encoding UTF-8 -vm-display-x11 -xshm -plugins /usr/lib/scratch/plugins/:/usr/lib/squeak/4.10.2-2793/ -vm-sound-alsa /usr/share/scratch/Scratch20131203.image
Xlib: extension "MIT-SHM" missing on display "localhost:10.0".

Segmentation fault

-1676252484 SmallIn

W0rmSp17
Posts: 13
Joined: Tue Mar 03, 2015 2:20 pm

Scratch HELP!

Tue Mar 03, 2015 3:31 pm

Scratch crashes after booting.

Everything I do fails to overcome this problem. I've updated, upgraded, changed power supply... I know it's a problem with the settings on my SD card, because I've tried 2 separate Raspberry Pi B+'s.

Executing: /usr/lib/squeak/4.10.2-2793/squeakvm -encoding UTF-8 -vm-display-x11 -xshm -plugins /usr/lib/scratch/plugins/:/usr/lib/squeak/4.10.2-2793/ -vm-sound-alsa /usr/share/scratch/Scratch20131203.image
Xlib: extension "MIT-SHM" missing on display "localhost:10.0".

Segmentation fault

-1675403372 Object>retryWithGC:until:
-1675403464 StandardFileStream>open:forWrite:
-1675403668 FileStream class>readOnlyFileNamedOrNil:
-1675403760 ScratchFrameMorph>readSettingsFile
-1675403852 ScratchFrameMorph>processSettingsFile
-1675406568 ScratchFrameMorph>startup
-1680767056 ScratchFrameMorph>saveImageForEndUser
-1680767256 SelectionMenu>invokeOn:
-1680767664 ScratchFrameMorph>developersMenu
-1680767756 ScratchFrameMorph>mouseDown:
-1680767896 HandMorph>handleMouseDown:
-1680767988 HandMorph>handleEvent:
-1680768080 HandMorph>processEvents
-1680768264 [] in PasteUpMorph>doOneCycleNow
-1680768172 SequenceableCollection>do:
-1680768356 PasteUpMorph>handsDo:
-1680768448 PasteUpMorph>doOneCycleNow
-1680768540 PasteUpMorph>doOneCycle
-1680768844 [] in Project>spawnNewProcess
-1680768752 [] in BlockContext>newProcess
Aborted

User avatar
B.Goode
Posts: 10438
Joined: Mon Sep 01, 2014 4:03 pm
Location: UK

Re: Raspberry Pi Scratch: Segmentation fault

Tue Mar 03, 2015 5:32 pm

How are you accessing your RPi? Via a directly-connected keyboard, mouse and display? Or 'headless' over a network connection via ssh or some other form of remote access?

(Scratch is so widely used that if there was an error in the package as distributed as part of Raspbian I assume it would have been noticed and rectified.)

timrowledge
Posts: 1348
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
Contact: Website

Re: Scratch HELP!

Tue Mar 03, 2015 5:44 pm

The first thing we should do is move both your posts to the Scratch forum where there is a far better chance of me seeing your requests for help; if there's a moderator listening, please could you do the neccessary?

I notice in the other post that you say you've done all the updates; well clearly something went wrong since you are running a very, very, old version of Scratch according to the error log.

Now, the log itself shows that things are starting up ok and get to where a config file is checked - the
"1675403760 ScratchFrameMorph>readSettingsFile
-1675403852 ScratchFrameMorph>processSettingsFile"
part is all expected.
The part that goes wrong is
"1675403464 StandardFileStream>open:forWrite:"
aka the actual attempt to open the relevant file. What happens here is that - because of rather infelicitous behaviour on Windows that needs compensating for - we try the file open, if it fails we try a garbage collect to clean up any WeakPointers that are holding on to file descriptors and retry the file open. The nature of the failure here implies that something went wrong in the actual code trying the file opening; if it were the garbage collect there'd be an entry for
"- {big number} SystemDictionary>garbageCollectMost"
and that would be surprising since we really, really, know how to garbage collection in the Smalltalk world.

So my best guess right now is that the updating you've done has actually caused problems and there is a fault that makes (attempting) opening the file cause a segfault. Most likely the only good answer is to load up a fresh card with a full download of the latest Raspbian. You do have backups of the important content of the original card, don't you?
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

timrowledge
Posts: 1348
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
Contact: Website

Re: Raspberry Pi Scratch: Segmentation fault

Tue Mar 03, 2015 5:45 pm

Please see also http://www.raspberrypi.org/forums/viewt ... 3&t=102578 and probably lock this one.
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

User avatar
abishur
Posts: 4477
Joined: Thu Jul 28, 2011 4:10 am
Location: USA
Contact: Website

Re: Scratch HELP!

Tue Mar 03, 2015 7:11 pm

Mod Edit: Merged duplicate threads and moved to correct forum
Dear forum: Play nice ;-)

W0rmSp17
Posts: 13
Joined: Tue Mar 03, 2015 2:20 pm

Re: Raspberry Pi Scratch: Segmentation fault

Tue Mar 03, 2015 10:36 pm

B.Goode wrote:How are you accessing your RPi? Via a directly-connected keyboard, mouse and display? Or 'headless' over a network connection via ssh or some other form of remote access?

(Scratch is so widely used that if there was an error in the package as distributed as part of Raspbian I assume it would have been noticed and rectified.)
Normally I SSH, but when it began to crash. I plugged into a monitor. Seemed to marginally help. I did some more trouble shooting after I wrote this post. And i'm almost %100 sure it was a power issue. I changed my power supply to a 5V -- 1A and then used the terminal command 'nice -n1 scratch' and it runs with priority CPU.... very sloppy though. I personally wouldn't use this tool if I didn't have to... I couldn't help but think; Man they could conserve a lot more CPU usage, if they didn't make Scratch GUI look so pretty. CPU usage soars up to 100% when runs.

W0rmSp17
Posts: 13
Joined: Tue Mar 03, 2015 2:20 pm

Re: Scratch HELP!

Tue Mar 03, 2015 10:47 pm

timrowledge wrote:The first thing we should do is move both your posts to the Scratch forum where there is a far better chance of me seeing your requests for help; if there's a moderator listening, please could you do the neccessary?

I notice in the other post that you say you've done all the updates; well clearly something went wrong since you are running a very, very, old version of Scratch according to the error log.

Now, the log itself shows that things are starting up ok and get to where a config file is checked - the
"1675403760 ScratchFrameMorph>readSettingsFile
-1675403852 ScratchFrameMorph>processSettingsFile"
part is all expected.
The part that goes wrong is
"1675403464 StandardFileStream>open:forWrite:"
aka the actual attempt to open the relevant file. What happens here is that - because of rather infelicitous behaviour on Windows that needs compensating for - we try the file open, if it fails we try a garbage collect to clean up any WeakPointers that are holding on to file descriptors and retry the file open. The nature of the failure here implies that something went wrong in the actual code trying the file opening; if it were the garbage collect there'd be an entry for
"- {big number} SystemDictionary>garbageCollectMost"
and that would be surprising since we really, really, know how to garbage collection in the Smalltalk world.

So my best guess right now is that the updating you've done has actually caused problems and there is a fault that makes (attempting) opening the file cause a segfault. Most likely the only good answer is to load up a fresh card with a full download of the latest Raspbian. You do have backups of the important content of the original card, don't you?
Sorry for the double up on posts. I thought the first one didn't go through.
Thank you. I had a suspicion it was all the updating I did, to attempt to resolve the issue. As my other Pi's ran the program fine. However, I have somewhat resolved the issue. CPU usage I believe was the antagonist... I gave it priority in terminal and it seems to run okay. Would Scratch on update version with apt-get update?

timrowledge
Posts: 1348
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
Contact: Website

Re: Raspberry Pi Scratch: Segmentation fault

Fri Mar 06, 2015 12:13 am

W0rmSp17 wrote: Man they could conserve a lot more CPU usage, if they didn't make Scratch GUI look so pretty. CPU usage soars up to 100% when runs.
When Scratch is idling it uses a few % CPU and when it's busy it uses everything it can get; what else would you expect? Any UI process that doesn't is simply wasting your time.
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

timrowledge
Posts: 1348
Joined: Mon Oct 29, 2012 8:12 pm
Location: Vancouver Island
Contact: Website

Re: Scratch HELP!

Fri Mar 06, 2015 12:18 am

W0rmSp17 wrote: Would Scratch on update version with apt-get update?
I think you're asking if apt-get update will install the latest Scratch? I'd normally say yes but it sounds like you've already got your SD card in a state where it isn't too happy so I suggest doing a fresh download.
Making Smalltalk on ARM since 1986; making your Scratch better since 2012

ghp
Posts: 1546
Joined: Wed Jun 12, 2013 12:41 pm
Location: Stuttgart Germany
Contact: Website

Re: Scratch HELP!

Sat Mar 07, 2015 6:39 am

Hello,

I have seen strange system freezes and segmentation faults on a few systems in my school course. When overclocking was turned back from 1000 to 900, the systems worked fine.
For my school workshop, I set up all the SD-cards to same state. So most systems worked, but three of them needed lower cpu frequency.

Regards,
Gerhard

Return to “Scratch”