Bug 36483 - 5.0.0-alt1: ошибка "can't seek on file descriptor 5" в момент запуска
Summary: 5.0.0-alt1: ошибка "can't seek on file descriptor 5" в момент запуска
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: opencpn (show other bugs)
Version: unstable
Hardware: all Linux
: P3 normal
Assignee: Sergey Y. Afonin
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-04-01 01:30 MSK by Sergey Y. Afonin
Modified: 2021-02-03 22:55 MSK (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Sergey Y. Afonin 2019-04-01 01:30:35 MSK
При старте выводится информация о двух ошибках ошибках (но не заметно, что это влияет на дальнейшую работоспособность):

can't seek on file descriptor 5 (error 22: Invalid argument)
can't find length of file on file descriptor 5 (error 0: Success)
can't seek on file descriptor 5 (error 22: Invalid argument)
can't find length of file on file descriptor 5 (error 0: Success)

Вероятно, это соответствует выводу strace

openat(AT_FDCWD, "/proc/self/statm", O_RDONLY) = 5
lseek(5, 0, SEEK_CUR)                   = 0
lseek(5, 0, SEEK_END)                   = -1 EINVAL (Invalid argument)

openat(AT_FDCWD, "/proc/meminfo", O_RDONLY) = 5
lseek(5, 0, SEEK_CUR)                   = 0
lseek(5, 0, SEEK_END)                   = -1 EINVAL (Invalid argument)

Соответствующий код есть в src/chart1.cpp.
Comment 1 Sergey Y. Afonin 2019-04-01 20:32:18 MSK
Ошибки из исходного сообщения выводятся в окошке при старте и в ~/.opencpn/opencpn.log не попадают. Однако позже там тоже начинает появляться похожая ошибка:

21:15:28 +04: Error: can't seek on file descriptor 10 (error 22: Invalid argument)
21:15:28 +04: Error: can't find length of file on file descriptor 10 (error 0: Success)

Соответствует практически тому же самому, но тут сам фрагмент лога в strace видно уже:

openat(AT_FDCWD, "/proc/self/statm", O_RDONLY) = 10
lseek(10, 0, SEEK_CUR)                  = 0
lseek(10, 0, SEEK_END)                  = -1 EINVAL (Invalid argument)
write(5, "21:15:28 +04: Error: can't seek "..., 83) = 83
write(5, "21:15:28 +04: Error: can't find "..., 88) = 88
read(10, "141564 25261 18288 1445 0 12268 "..., 4096) = 34
close(10)                               = 0
Comment 2 Sergey Y. Afonin 2019-04-02 00:48:14 MSK
тут вот утверждают, что виновник wxWidgets 3.1:
http://www.cruisersforum.com/forums/f134/opencpn-version-5-beta-release-4-99-1426-a-214545-12.html

On linux file under /proc/ aren't seekable and 3.1 is complaining about it while testing for file 'seekability'.

Too bad O is using /proc/meminfo a lot and it makes 3.1 unusable on Linux.

Must be fixed in wx.
Comment 3 Антон Мидюков 2019-04-03 09:38:09 MSK
(В ответ на комментарий №2)
> тут вот утверждают, что виновник wxWidgets 3.1:
> http://www.cruisersforum.com/forums/f134/opencpn-version-5-beta-release-4-99-1426-a-214545-12.html

Так собирайте с 3.0. 3.1 нестабильная версия.
Comment 4 Sergey Y. Afonin 2019-04-03 10:18:21 MSK
(In reply to comment #3)

> Так собирайте с 3.0. 3.1 нестабильная версия.

Да, в планах есть попробовать, но пока то одно, то другое. В общем до выходных видимо. Но это может быть проблематично: я изначально когда собирал, 3.0 пробовал, и там надо было код opencpn как минимум в одном месте патчить. А так как дальше 5% не прошёл, может там и не одно место совсем, вероятно сами разработчики уже на 3.1 ориетируются.
Comment 5 Антон Мидюков 2019-04-03 10:24:29 MSK
(В ответ на комментарий №4)
> вероятно сами
> разработчики уже на 3.1 ориетируются.

Надо задать им этот вопрос, повесить баг-репорт, что не собирается с wxGTK3.0. Может выяснится, что проблема в нашей сборке wxGTK3.0, вот тогда будем исправлять её.
Comment 6 Sergey Y. Afonin 2021-02-03 20:06:04 MSK
(In reply to Антон Мидюков from comment #5)

> Надо задать им этот вопрос, повесить баг-репорт, что не собирается с
> wxGTK3.0. Может выяснится, что проблема в нашей сборке wxGTK3.0, вот тогда
> будем исправлять её.

В 5.2.0 обнаружился такой код в CMakeLists.txt:

  if (GTK3_FOUND)
    list(APPEND wxWidgets_LIBRARIES "-lwx_gtk3u_aui-3.0")
    if (OPENGL_FOUND)
      list(APPEND wxWidgets_LIBRARIES "-lwx_gtk3u_gl-3.0")
    endif ()
  endif ()

Похоже таки собирают с 3.0 тоже где-то. Но пока 5.2.0 всё рано с 3.1 собрал и смотрю.
Comment 7 Sergey Y. Afonin 2021-02-03 22:55:02 MSK
(In reply to Sergey Y. Afonin from comment #0)

> can't seek on file descriptor 5 (error 22: Invalid argument)
> can't find length of file on file descriptor 5 (error 0: Success)

В OpenCPN 5.2.0-alt1 ошибка не появляется. Собрано с wxGTK3.1 3.1.3-alt2.