A high level C++1y event loop using libev.
hamidr / libevpp Goto Github PK
View Code? Open in Web Editor NEWAn ASIO-like library for evented IO based on libEV for *nix systems
License: MIT License
An ASIO-like library for evented IO based on libEV for *nix systems
License: MIT License
How to reproduce?
Run the only example(./build/a1.out
| tcp_server's code ) in this code base and then run following ruby codes.
def close_from_client_crashs
x = TCPSocket.new "localhost", 9090
x.close
end
def close_from_server_is_okay
x = TCPSocket.new "localhost", 9090
x.puts "close"
sleep(2)
x.close if !x.closed?
end
close_from_server_is_okay
close_from_client_crashs
this will happen on the server side.
======= Backtrace: =========
/lib64/libc.so.6(+0x791fb)[0x7f22db2c01fb]
/lib64/libc.so.6(+0x8288a)[0x7f22db2c988a]
/lib64/libc.so.6(cfree+0x4c)[0x7f22db2cd2bc]
./a1.out(_ZNSt14_Function_base13_Base_managerISt5_BindIFSt7_Mem_fnIMN7libevpp7network12async_socketEFvPciRKSt8functionIFvlEEEEPS5_S6_iS9_EEE10_M_managerERSt9_Any_dataRKSJ_St18_Manager_operation+0x54)[0x409954]
./a1.out(_ZN7libevpp10event_loop14socket_watcher9call_readEv+0x9f)[0x40b17f]
/lib64/libev.so.4(ev_invoke_pending+0x53)[0x7f22dbeb9113]
/lib64/libev.so.4(ev_run+0x966)[0x7f22dbebc706]
./a1.out(main+0x39)[0x407549]
/lib64/libc.so.6(__libc_start_main+0xf1)[0x7f22db267401]
./a1.out(_start+0x2a)[0x4075aa]
======= Memory map: ========
00400000-0040f000 r-xp 00000000 08:09 10359442 /home/hamid/adro/libevpp/build/a1.out
0060e000-0060f000 r--p 0000e000 08:09 10359442 /home/hamid/adro/libevpp/build/a1.out
0060f000-00610000 rw-p 0000f000 08:09 10359442 /home/hamid/adro/libevpp/build/a1.out
01430000-01462000 rw-p 00000000 00:00 0 [heap]
7f22d4000000-7f22d4021000 rw-p 00000000 00:00 0
7f22d4021000-7f22d8000000 ---p 00000000 00:00 0
7f22db247000-7f22db404000 r-xp 00000000 08:07 925496 /usr/lib64/libc-2.24.so
7f22db404000-7f22db603000 ---p 001bd000 08:07 925496 /usr/lib64/libc-2.24.so
7f22db603000-7f22db607000 r--p 001bc000 08:07 925496 /usr/lib64/libc-2.24.so
7f22db607000-7f22db609000 rw-p 001c0000 08:07 925496 /usr/lib64/libc-2.24.so
7f22db609000-7f22db60d000 rw-p 00000000 00:00 0
7f22db60d000-7f22db623000 r-xp 00000000 08:07 925049 /usr/lib64/libgcc_s-6.3.1-20161221.so.1
7f22db623000-7f22db822000 ---p 00016000 08:07 925049 /usr/lib64/libgcc_s-6.3.1-20161221.so.1
7f22db822000-7f22db823000 r--p 00015000 08:07 925049 /usr/lib64/libgcc_s-6.3.1-20161221.so.1
7f22db823000-7f22db824000 rw-p 00016000 08:07 925049 /usr/lib64/libgcc_s-6.3.1-20161221.so.1
7f22db824000-7f22db92c000 r-xp 00000000 08:07 925632 /usr/lib64/libm-2.24.so
7f22db92c000-7f22dbb2b000 ---p 00108000 08:07 925632 /usr/lib64/libm-2.24.so
7f22dbb2b000-7f22dbb2c000 r--p 00107000 08:07 925632 /usr/lib64/libm-2.24.so
7f22dbb2c000-7f22dbb2d000 rw-p 00108000 08:07 925632 /usr/lib64/libm-2.24.so
7f22dbb2d000-7f22dbca5000 r-xp 00000000 08:07 926122 /usr/lib64/libstdc++.so.6.0.22
7f22dbca5000-7f22dbea5000 ---p 00178000 08:07 926122 /usr/lib64/libstdc++.so.6.0.22
7f22dbea5000-7f22dbeaf000 r--p 00178000 08:07 926122 /usr/lib64/libstdc++.so.6.0.22
7f22dbeaf000-7f22dbeb1000 rw-p 00182000 08:07 926122 /usr/lib64/libstdc++.so.6.0.22
7f22dbeb1000-7f22dbeb5000 rw-p 00000000 00:00 0
7f22dbeb5000-7f22dbec2000 r-xp 00000000 08:07 925662 /usr/lib64/libev.so.4.0.0
7f22dbec2000-7f22dc0c1000 ---p 0000d000 08:07 925662 /usr/lib64/libev.so.4.0.0
7f22dc0c1000-7f22dc0c2000 r--p 0000c000 08:07 925662 /usr/lib64/libev.so.4.0.0
7f22dc0c2000-7f22dc0c3000 rw-p 0000d000 08:07 925662 /usr/lib64/libev.so.4.0.0
7f22dc0c3000-7f22dc0e8000 r-xp 00000000 08:07 928337 /usr/lib64/ld-2.24.so
7f22dc2c9000-7f22dc2ce000 rw-p 00000000 00:00 0
7f22dc2e5000-7f22dc2e8000 rw-p 00000000 00:00 0
7f22dc2e8000-7f22dc2e9000 r--p 00025000 08:07 928337 /usr/lib64/ld-2.24.so
7f22dc2e9000-7f22dc2ea000 rw-p 00026000 08:07 928337 /usr/lib64/ld-2.24.so
7f22dc2ea000-7f22dc2eb000 rw-p 00000000 00:00 0
7ffd7898c000-7ffd789ad000 rw-p 00000000 00:00 0 [stack]
7ffd789e2000-7ffd789e4000 r--p 00000000 00:00 0 [vvar]
7ffd789e4000-7ffd789e6000 r-xp 00000000 00:00 0 [vdso]
ffffffffff600000-ffffffffff601000 r-xp 00000000 00:00 0 [vsyscall]
[1] 17476 abort (core dumped) ./a1.out
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.