{"action":"created","issue":{"url":"https://api.github.com/repos/jjk-jacky/anopa/issues/8","repository_url":"https://api.github.com/repos/jjk-jacky/anopa","labels_url":"https://api.github.com/repos/jjk-jacky/anopa/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/jjk-jacky/anopa/issues/8/comments","events_url":"https://api.github.com/repos/jjk-jacky/anopa/issues/8/events","html_url":"https://github.com/jjk-jacky/anopa/issues/8","id":179666605,"number":8,"title":"aa-start fails with latest s6 (2.3.0.0)","user":{"login":"linsam","id":13092909,"avatar_url":"https://avatars.githubusercontent.com/u/13092909?v=3","gravatar_id":"","url":"https://api.github.com/users/linsam","html_url":"https://github.com/linsam","followers_url":"https://api.github.com/users/linsam/followers","following_url":"https://api.github.com/users/linsam/following{/other_user}","gists_url":"https://api.github.com/users/linsam/gists{/gist_id}","starred_url":"https://api.github.com/users/linsam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linsam/subscriptions","organizations_url":"https://api.github.com/users/linsam/orgs","repos_url":"https://api.github.com/users/linsam/repos","events_url":"https://api.github.com/users/linsam/events{/privacy}","received_events_url":"https://api.github.com/users/linsam/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-09-28T02:36:17Z","updated_at":"2016-09-28T03:55:39Z","closed_at":null,"body":"After upgrading s6 from 2.2.4.2 to 2.3.0.0 (and skalibs from 2.3.8.0 to 2.3.10.0), aa-start is crashing with SIGFPE due to a divide-by-zero in the call to ftrigr_subscribe. I don't yet know if this is a bug in anopa or in s6; I'm reporting here first as anopa is user-facing, and I didn't see any obvious issues between the s6 versions, though there are changes in the ftrig code) \r\n\r\nHere is an early failing session:\r\n\r\n```\r\n==> ERROR: System initialization failed\r\n  -> Trying to open a shell...\r\nsh: cannot set terminal process group (-1): Inappropriate ioctl for device\r\nsh: no job control in this shell\r\nsh-4.3# gdb aa-start\r\nGNU gdb (GDB) 7.9.1\r\nCopyright (C) 2015 Free Software Foundation, Inc.\r\nLicense GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>\r\nThis is free software: you are free to change and redistribute it.\r\nThere is NO WARRANTY, to the extent permitted by law.  Type \"show copying\"\r\nand \"show warranty\" for details.\r\nThis GDB was configured as \"i586-oe-linux\".\r\nType \"show configuration\" for configuration details.\r\nFor bug reporting instructions, please see:\r\n<http://www.gnu.org/software/gdb/bugs/>.\r\nFind the GDB manual and other documentation resources online at:\r\n<http://www.gnu.org/software/gdb/documentation/>.\r\nFor help, type \"help\".\r\nType \"apropos word\" to search for commands related to \"word\"...\r\nReading symbols from aa-start...Reading symbols from /bin/.debug/aa-start...done.\r\ndone.\r\n(gdb) run getty@ttyS0\r\nStarting program: /bin/aa-start getty@ttyS0\r\n[tcsetpgrp failed in terminal_inferior: Inappropriate ioctl for device]\r\n[tcsetpgrp failed in terminal_inferior: Inappropriate ioctl for device]\r\n[tcsetpgrp failed in terminal_inferior: Inappropriate ioctl for device]\r\n[tcsetpgrp failed in terminal_inferior: Inappropriate ioctl for device]\r\nStarting getty@ttyS0...\r\n\r\nProgram received signal SIGFPE, Arithmetic exception.\r\ngensetdyn_ready (g=0x805745c <_aa_ft+284>, n=1)\r\n    at src/libdatastruct/gensetdyn_ready.c:12\r\n12        n += g->base + (n * g->fracnum) / g->fracden ;\r\n(gdb) print n\r\n$1 = 1\r\n(gdb) print g\r\n$2 = (gensetdyn *) 0x805745c <_aa_ft+284>\r\n(gdb) print *g\r\n$3 = {storage = {s = 0x0, len = 0, a = 16}, freelist = {\r\n    s = 0x2 <error: Cannot access memory at address 0x2>, len = 0, a = 1}, \r\n  esize = 0, base = 0, fracnum = 0, fracden = 0}\r\n(gdb) where\r\n#0  gensetdyn_ready (g=0x805745c <_aa_ft+284>, n=1)\r\n    at src/libdatastruct/gensetdyn_ready.c:12\r\n#1  0x448dfe4d in gensetdyn_new (g=0x805745c <_aa_ft+284>, i=0xbffffae4)\r\n    at src/libdatastruct/gensetdyn_new.c:9\r\n#2  0x449013fa in ftrigr_subscribe (a=0x8057340 <_aa_ft>, \r\n    path=0xbffffb50 \"getty@ttyS0/event\", re=0x8052f0b \"u\", options=0, \r\n    deadline=0xbffffba0, stamp=0x8058ee4) at src/libs6/ftrigr_subscribe.c:20\r\n#3  0x0804d97f in _exec_longrun (si=0, mode=AA_MODE_START)\r\n    at src/libanopa/exec_longrun.c:53\r\n#4  0x08050217 in aa_exec_service (si=0, mode=AA_MODE_START)\r\n    at src/libanopa/service.c:694\r\n#5  0x0804d086 in mainloop (mode=AA_MODE_START, scan_cb=0x8049ff0 <scan_cb>)\r\n    at src/anopa/start-stop.c:1221\r\n#6  0x080499a9 in main (argc=<optimized out>, argv=<optimized out>)\r\n    at src/anopa/aa-start.c:358\r\n```\r\n\r\nWith the old version of the libs, g looks like the following at about the point of the crash:\r\n\r\n```\r\nBreakpoint 2, gensetdyn_ready (g=0x8057a6c <_aa_ft+268>, n=1)\r\n   at src/libdatastruct/gensetdyn_ready.c:8\r\n8        {\r\n(gdb) print *g\r\n$1 = {storage = {s = 0x0, len = 0, a = 0}, freelist = {s = 0x0, len = 0,\r\n        a = 0}, esize = 16, base = 2, fracnum = 0, fracden = 1}\r\n```\r\n\r\nThe g comes from the data element of the statically allocated _aa_ft"},"comment":{"url":"https://api.github.com/repos/jjk-jacky/anopa/issues/comments/250065560","html_url":"https://github.com/jjk-jacky/anopa/issues/8#issuecomment-250065560","issue_url":"https://api.github.com/repos/jjk-jacky/anopa/issues/8","id":250065560,"user":{"login":"linsam","id":13092909,"avatar_url":"https://avatars.githubusercontent.com/u/13092909?v=3","gravatar_id":"","url":"https://api.github.com/users/linsam","html_url":"https://github.com/linsam","followers_url":"https://api.github.com/users/linsam/followers","following_url":"https://api.github.com/users/linsam/following{/other_user}","gists_url":"https://api.github.com/users/linsam/gists{/gist_id}","starred_url":"https://api.github.com/users/linsam/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/linsam/subscriptions","organizations_url":"https://api.github.com/users/linsam/orgs","repos_url":"https://api.github.com/users/linsam/repos","events_url":"https://api.github.com/users/linsam/events{/privacy}","received_events_url":"https://api.github.com/users/linsam/received_events","type":"User","site_admin":false},"created_at":"2016-09-28T03:55:39Z","updated_at":"2016-09-28T03:55:39Z","body":"So far, I've found a disparity in where the fracden are at the point of the crash.\r\n\r\nOn a working system, they are the same address (as I expect from skimming the code, given that g is derived from data from _aa_ft):\r\n```\r\n(gdb) p &_aa_ft.data.fracden\r\n$3 = (unsigned int *) 0x8057a90 <_aa_ft+304>\r\n(gdb) p &g->fracden\r\n$4 = (unsigned int *) 0x8057a90 <_aa_ft+304>\r\n```\r\n\r\nWhen not working, they are different:\r\n```\r\n(gdb) p &g->fracden\r\n$5 = (unsigned int *) 0x8057480 <_aa_ft+320>\r\n(gdb) p &_aa_ft.data.fracden\r\n$6 = (unsigned int *) 0x8057470 <_aa_ft+304>\r\n```\r\n\r\nI'm looking for when the deviation occurs"}}
{"actor":{"display_login":"linsam"}}