Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Sign in / Register
Sortix
Sortix
  • Project
    • Project
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
    • Locked Files
  • Issues 410
    • Issues 410
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
  • Merge Requests 1
    • Merge Requests 1
  • Wiki
    • Wiki
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Commits
  • Issue Boards
  • sortix
  • SortixSortix
  • Issues
  • #701

Closed
Open
Opened Feb 28, 2018 by Davin McCall@davmac
  • Report abuse
  • New issue
Report abuse New issue

Trivial C++ program crashes

The following program crashes if compiled and run with current nightly build:

#include <iostream>
#include <sys/types.h>
#include <sys/socket.h>

void some_func(int filedes[]) {
    socketpair(AF_UNIX, SOCK_STREAM, 0, filedes);
}

int main(int argc, char **argv) {
    return 0;
}

Note that the #include <iostream> is necessary to cause the crash even though nothing from it is used, and the call to socketpair is necessary to cause the crash even though it is never executed.

root@dragonsort ~/prog/simplecc # g++ testme.cc
root@dragonsort ~/prog/simplecc # ./a.out
The current process (pid 1195 `./a.out') crashed and was terminated:
Page fault exception at ip=0x0 (cr2=0x0, err_code=0x14)
Segmentation fault

Related issues

Assignee
Assign to
Epic
None
Milestone
None
Assign milestone
Time tracking
None
Due date
No due date
0
Labels
None
Assign labels
  • View project labels
Reference: sortix/sortix#701