Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add new line to log file, Segmentation fault #22

Open
jarlyn95 opened this issue Aug 22, 2016 · 20 comments
Open

add new line to log file, Segmentation fault #22

jarlyn95 opened this issue Aug 22, 2016 · 20 comments

Comments

@jarlyn95
Copy link

#0 0x00007fff90ef445c in pthread_mutex_lock () from /usr/lib/system/libsystem_pthread.dylib
#1 0x000000010003a912 in base::Mutex::lock() ()
#2 0x000000010003a8dc in base::ScopedLock::ScopedLock(base::Mutex&) ()
#3 0x000000010003a232 in base::ScopedLock::ScopedLock(base::Mutex&) ()
#4 0x00000001001092aa in logkafka::TailWatcher::isActive (this=0x0) at /Users/datasci/develop/logkafka/src/logkafka/tail_watcher.cc:307
#5 0x000000010007715c in logkafka::Manager::updateWatcherRotate (manager=0x10060c490, path_pattern=..., path=..., position_entry=0x102800100) at /Users/datasci/develop/logkafka/src/logkafka/manager.cc:770
#6 0x00000001001087b8 in logkafka::TailWatcher::onRotate (arg=0x1028007e0, file=0x7fff751e0808) at /Users/datasci/develop/logkafka/src/logkafka/tail_watcher.cc:247
#7 0x00000001001048e8 in logkafka::RotateHandler::onNotify (arg=0x100303f50) at /Users/datasci/develop/logkafka/src/logkafka/rotate_handler.cc:83
#8 0x000000010010736d in logkafka::TailWatcher::onNotify (arg=0x1028007e0) at /Users/datasci/develop/logkafka/src/logkafka/tail_watcher.cc:141
#9 0x00000001001284ad in base::TimerWatcher::cb_func (w=0x1003040f0) at /Users/datasci/develop/logkafka/src/base/timer_watcher.cc:64
#10 0x0000000100171d15 in uv__run_timers (loop=0x10100a400) at src/unix/timer.c:165
#11 0x00000001001661a3 in uv_run (loop=0x10100a400, mode=UV_RUN_DEFAULT) at src/unix/core.c:319
#12 0x000000010003eb0c in logkafka::LogKafka::start (this=0x10060c220) at /Users/datasci/develop/logkafka/src/logkafka/logkafka.cc:91
#13 0x000000010003fa25 in run (option=...) at /Users/datasci/develop/logkafka/src/logkafka/main.cc:130
#14 0x000000010003ef8c in main (argc=5, argv=0x7fff5fbff880) at /Users/datasci/develop/logkafka/src/logkafka/main.cc:54

@zheolong
Copy link
Collaborator

zheolong commented Aug 22, 2016

@iwenjun I will check for this as soon as possible :)

Did you update the code to the latest version and try ?

@jarlyn95
Copy link
Author

@zheolong yes. My computer is mac.

@jarlyn95
Copy link
Author

@zheolong your kafka version?

@zheolong
Copy link
Collaborator

@iwenjun it's not a problem caused by the kafka version, you better try the linux system now :)

@jarlyn95
Copy link
Author

@zheolong I tried in ubuntu, the problem still exists.

@jarlyn95
Copy link
Author

screen shot 2016-08-24 at 10 56 51 am

@jarlyn95
Copy link
Author

screen shot 2016-08-24 at 11 01 08 am

@zheolong
Copy link
Collaborator

zheolong commented Aug 24, 2016

@iwenjun Did you try to delete/modify the log config? What's the action which triggers this problem?

@jarlyn95
Copy link
Author

which file did mean?

@zheolong
Copy link
Collaborator

@iwenjun You just run the program and do no other actions?

@jarlyn95
Copy link
Author

I appended new lines to the watching log file.
I desire to collect logs in realtime.

@zheolong
Copy link
Collaborator

@iwenjun OK, let me test on my mac

@jarlyn95
Copy link
Author

Thank you.

@zheolong
Copy link
Collaborator

@iwenjun It is ok on my mac, show me the 'cmake' command you use to compile

@jarlyn95
Copy link
Author

cmake -H. -B_build -DCMAKE_INSTALL_PREFIX=_install
-DINSTALL_LIBRDKAFKA=ON
-DINSTALL_LIBZOOKEEPER_MT=ON
-DINSTALL_LIBUV=ON
-DINSTALL_LIBPCRE2=ON

@zheolong
Copy link
Collaborator

zheolong commented Aug 24, 2016

@iwenjun I use the same command, this command will generate the same executables

@jarlyn95
Copy link
Author

dingtalk20160825114150

@jarlyn95
Copy link
Author

TailMap::iterator iter = (manager->m_tails).find(path);
the result: iter == manager->m_tails.end()

@jarlyn95
Copy link
Author

I solved it.
in void Manager::startWatchers(set paths) method, m_tails[path_pattern] = tw;
in bool Manager::updateWatcherRotate(Manager *manager,
string path_pattern,
string path,
PositionEntry *position_entry) method, TailMap::iterator iter
= (manager->m_tails).find(path_pattern);

@zheolong
Copy link
Collaborator

@iwenjun Can you create a pull request?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants