⚲
Project
General
Profile
Sign in
Register
Home
Projects
Help
Search
:
Ruby master
All Projects
Ruby
»
Ruby master
Overview
Activity
Roadmap
Issues
Repository
Like
Download (1.03 KB)
Bug #17382
» segfault.rb
Script to reproduce segfault -
tom_dalling (Tom Dalling)
, 02/25/2022 06:24 AM
require
'json'
def
trigger_segfault
JSON
.
parse
(
<<~
JSON
,
symbolize_names:
true
).
inspect
{
"squadName
#{
rand
}
": 1,
"homeTown
#{
rand
}
": 1,
"formed
#{
rand
}
": 2016,
"secretBase
#{
rand
}
": 1,
"active
#{
rand
}
": true,
"members
#{
rand
}
": [
{
"name
#{
rand
}
": 1,
"age
#{
rand
}
": 29,
"secretIdentity
#{
rand
}
": 1,
"powers
#{
rand
}
": [
1,
1,
1
]
},
{
"name": 1,
"age": 39,
"secretIdentity": 1,
"powers": [
1,
1,
1
]
},
{
"name": 1,
"age": 1000000,
"secretIdentity": 1,
"powers": [
1,
1,
1,
1,
1
]
}
]
}
JSON
end
i
=
0
loop
do
i
+=
1
puts
"Loop
#{
i
}
"
threads
=
12
.
times
.
map
do
Thread
.
new
do
1_000
.
times
do
trigger_segfault
end
end
end
threads
.
map
(
&
:join
)
end
« Previous
1
2
3
4
Next »
(2-2/4)
Loading...