Блог пользователя DEGwer

Автор DEGwer, 11 лет назад, По-английски

I wrote Topcoder SRM 450 Div1 medium's solution and submitted and ran system test, I got segmentation fault on some case. I ran system test again and again, every time I ran it, segmentation fault appeared on different case on same solution. (Once I got RE on test 3, but another time I got AC on test 3, but I got RE on test 27... etc)

ryo_issy also say that he got same trouble on SRM573 Div1 medium...

What is happening?

  • Проголосовать: нравится
  • +1
  • Проголосовать: не нравится

»
11 лет назад, # |
  Проголосовать: нравится +6 Проголосовать: не нравится

Delta003 and I have been solving some practice SRM and TCHS competitions and we also get segmentation fault on random test cases.

»
11 лет назад, # |
  Проголосовать: нравится +6 Проголосовать: не нравится
»
11 лет назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

I've got a problem too. I get segmentation fault on both SRM573 Div2 easy and SRM573 Div2 medium on random cases. Something weird is happening.

»
11 лет назад, # |
  Проголосовать: нравится +6 Проголосовать: не нравится

I am getting the same error for SRM 413 Div2 Hard.

»
11 лет назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

Yeah, they are complaining about the same thing on TopCoder forums. Seems like a system bug.

»
11 лет назад, # |
  Проголосовать: нравится +9 Проголосовать: не нравится

Its my fault (or segfault XD), sorry guys :/

»
11 лет назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

Now this trouble has disappeared. Thank you!

»
3 года назад, # |
Rev. 3   Проголосовать: нравится -119 Проголосовать: не нравится

I had the same problem in a contest in codechef. I reached out to them via mail, and apparently it was an array out of bounds. They said that array out of bounds in a C style array is not very strict and sometimes it goes undetected. And hence using vectors or std::array is a better option if you think there might be an array out of bounds

I tried to report it as a bug. Here is a bug report response

Here are the links to my answers

https://www.codechef.com/viewsolution/30545573 https://www.codechef.com/viewsolution/30545583

  • »
    »
    3 года назад, # ^ |
      Проголосовать: нравится -9 Проголосовать: не нравится

    Why so many downvotes???

    • »
      »
      »
      3 года назад, # ^ |
        Проголосовать: нравится +38 Проголосовать: не нравится
      1. Because you revived a 8-year-old blog to post this, and it's not completely related.
      2. Because a programming competition platform can't enforce what is not in the language (this time, array bounds checking).