Skip to content

Instantly share code, notes, and snippets.

@ArcticLight
Created February 18, 2015 02:32
Show Gist options
  • Save ArcticLight/885d994389cb0b7c8759 to your computer and use it in GitHub Desktop.
Save ArcticLight/885d994389cb0b7c8759 to your computer and use it in GitHub Desktop.
Wat the segfault
int lastS;
float munge;
void setup() {
size(300,300);
lastS = second();
munge = 0;
}
void draw() {
munge += TWO_PI/60./60.;
if(lastS != second()) {
munge = 0;
lastS = second();
}
background(0);
pushMatrix();
translate(width/2,height/2);
ellipseMode(CENTER);
stroke(255);
fill(0);
ellipse(0,0,25,25);
float much = (second()/60.) * TWO_PI + munge;
rotate(much);
translate(0,-50);
rotate(-much);
ellipse(0,0,25,25);
fill(255);
textAlign(CENTER,CENTER);
text(second(), 0,-2);
much = (minute()/60.) * TWO_PI + (TWO_PI/second()/60.);
rotate(much);
translate(0,-20);
rotate(-much);
fill(0);
ellipse(0,0,15,15);
fill(255);
textAlign(CENTER,CENTER);
text(minute(), 0,-2);
popMatrix();
}
@hawkw
Copy link

hawkw commented Feb 18, 2015

It segfaults on Mac too:

Process:               java [15041]
Path:                  /Applications/Processing.app/Contents/PlugIns/jdk1.7.0_55.jdk/Contents/Home/jre/bin/java
Identifier:            net.java.openjdk.cmd
Version:               1.0 (1.0)
Code Type:             X86-64 (Native)
Parent Process:        Processing [15036]
Responsible:           Processing [15036]
User ID:               501

Date/Time:             2015-02-17 21:34:00.625 -0500
OS Version:            Mac OS X 10.10.2 (14C109)
Report Version:        11
Anonymous UUID:        5390C93A-45A5-FDCE-A2D3-1BC1B13B66F9

Sleep/Wake UUID:       244CD73B-A52C-4569-8453-FBC4CBE3E247

Time Awake Since Boot: 19000 seconds
Time Since Wake:       6900 seconds

Crashed Thread:        29  Java: Animation Thread

Exception Type:        EXC_BAD_ACCESS (SIGABRT)
Exception Codes:       KERN_PROTECTION_FAILURE at 0x00007f9daf0153d0

VM Regions Near 0x7f9daf0153d0:
    MALLOC_SMALL           00007f9dac000000-00007f9daf000000 [ 48.0M] rw-/rwx SM=PRV  
--> MALLOC_TINY            00007f9daf000000-00007f9daf100000 [ 1024K] rw-/rwx SM=COW  
    MALLOC_TINY            00007f9daf100000-00007f9daf300000 [ 2048K] rw-/rwx SM=PRV  

Application Specific Information:
abort() called

@hawkw
Copy link

hawkw commented Feb 18, 2015

I didn't copy the entire thread dump (it's long) but if you want to see exactly what was going on, I still have the dump open...

@hawkw
Copy link

hawkw commented Feb 18, 2015

On, Procelling also reports the following message:


#
# A fatal error has been detected by the Java Runtime Environment:
#
#  SIGBUS (0xa) at pc=0x00007f9daf0153d0, pid=15041, tid=60939
#
# JRE version: Java(TM) SE Runtime Environment (7.0_55-b13) (build 1.7.0_55-b13)
# Java VM: Java HotSpot(TM) 64-Bit Server VM (24.55-b03 mixed mode bsd-amd64 compressed oops)
# Problematic frame:
# C  0x00007f9daf0153d0
#
# Failed to write core dump. Core dumps have been disabled. To enable core dumping, try "ulimit -c unlimited" before starting Java again
#
# An error report file with more information is saved as:
# /Users/hawk/hs_err_pid15041.log
#
# If you would like to submit a bug report, please visit:
#   http://bugreport.sun.com/bugreport/crash.jsp
# The crash happened outside the Java Virtual Machine in native code.
# See problematic frame for where to report the bug.
#

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment